Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use control group target from mavlink message. #8908

Closed
wants to merge 31 commits into from
Closed
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c6110f8
aerofc: Move GPS to UART7
zehortigoza Apr 18, 2017
b241f72
nuttx-configs: aerofc: Remove GPIO_I2C*_S**_GPIO
zehortigoza Apr 18, 2017
79e93ff
aerofc: Enable I2C bus 2
zehortigoza Apr 18, 2017
afafb13
aerofc_adc: Add support to use others I2C besides PX4_I2C_BUS_EXPANSION
zehortigoza May 4, 2017
20822ec
ll40ls: Refactor interface(PWM and I2C) selection and allow probe in …
zehortigoza May 4, 2017
3098c77
aerofc: Use the additional I2C
zehortigoza Apr 18, 2017
a0fe6f2
aerofc: Reboot board when force bootloader pin is set
zehortigoza Jul 24, 2017
00f8024
aerofc: switch companion baud to 921600
lucasdemarchi Aug 28, 2017
d928fd3
aerofc: allow to use 921600 baud to reboot
lucasdemarchi Aug 28, 2017
2b28497
* added new airframe, new mixer and kitepower vtol controller (still …
GabrielKoenig Dec 1, 2017
8a0169f
* Add rigid_wing target for gazebo_sitl repo
GabrielKoenig Jan 17, 2018
48fd8c8
Working new kitepower controller within simulation (simple transition…
GabrielKoenig Jan 18, 2018
6260b45
Update model.
xgerrmann Jan 19, 2018
2889e87
Update submodule
xgerrmann Jan 20, 2018
8fdc4df
submodule update
xgerrmann Jan 20, 2018
0fac808
Mixer for yaw and pitch working correctly in simulation.
xgerrmann Jan 20, 2018
981b9fc
More descriptive comments in mixed file, and add null channel.
xgerrmann Jan 20, 2018
7ab2ec6
Remove redundant mixer (was only for simulation). Invert yaw channel.
xgerrmann Jan 20, 2018
8bacbf0
Different channels in mixers, require a model update.
xgerrmann Jan 20, 2018
1a1b67d
Merge mixer files. Remove mixer only for sitl.
xgerrmann Jan 20, 2018
99f89ef
Change channels of yaw and pitch.
xgerrmann Jan 20, 2018
33ef82d
Merge branch 'fig_8_actuator_mixer' into gamma_rigid_wing
xgerrmann Jan 20, 2018
bb5b88c
submodule update.
xgerrmann Jan 20, 2018
b2e85f1
Use control group target from mavlink message.
xgerrmann Feb 18, 2018
05d5acd
Fix style.
xgerrmann Feb 19, 2018
cd9f333
Add check and fix for changing control groups.
xgerrmann Mar 6, 2018
e303bae
Changed !(x==y) to (x!=y). Unadvertise when a different control group…
xgerrmann Mar 26, 2018
09e5fb5
cleaned up, working servo outputs, proper switch mc to fw
GabrielKoenig Apr 10, 2018
5f79220
inverted parachute output signal
GabrielKoenig Apr 10, 2018
b4eed22
Merge branch 'gamma_rigid_wing' into set_actuator_pr
xgerrmann May 11, 2018
69d106f
Revert "Merge branch 'gamma_rigid_wing' into set_actuator_pr"
xgerrmann May 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions src/modules/mavlink/mavlink_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,18 +1055,47 @@ MavlinkReceiver::handle_message_set_actuator_control_target(mavlink_message_t *m
if (_control_mode.flag_control_offboard_enabled) {

actuator_controls.timestamp = hrt_absolute_time();
uint8_t control_group = set_actuator_control_target.group_mlx;
static int8_t control_group_previous = -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the static into the class?


/* Set duty cycles for the servos in actuator_controls_0 */
for (size_t i = 0; i < 8; i++) {
actuator_controls.control[i] = set_actuator_control_target.controls[i];
memcpy(actuator_controls.control, set_actuator_control_target.controls, 8 * sizeof(float));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above is now a bit lonely. Either remove or move it.


/* Reset orb advertising when current control group is unequal to the previous control group */
if (control_group != control_group_previous) {

orb_unadvertise(_actuator_controls_pub);

_actuator_controls_pub = nullptr;
}

if (_actuator_controls_pub == nullptr) {
_actuator_controls_pub = orb_advertise(ORB_ID(actuator_controls_0), &actuator_controls);
switch (control_group) {
case 0: _actuator_controls_pub = orb_advertise(ORB_ID(actuator_controls_0), &actuator_controls); break;

case 1: _actuator_controls_pub = orb_advertise(ORB_ID(actuator_controls_1), &actuator_controls); break;

case 2: _actuator_controls_pub = orb_advertise(ORB_ID(actuator_controls_2), &actuator_controls); break;

case 3: _actuator_controls_pub = orb_advertise(ORB_ID(actuator_controls_3), &actuator_controls); break;

default: break;
}

} else {
orb_publish(ORB_ID(actuator_controls_0), _actuator_controls_pub, &actuator_controls);
switch (control_group) {
case 0: orb_publish(ORB_ID(actuator_controls_0), _actuator_controls_pub, &actuator_controls); break;

case 1: orb_publish(ORB_ID(actuator_controls_1), _actuator_controls_pub, &actuator_controls); break;

case 2: orb_publish(ORB_ID(actuator_controls_2), _actuator_controls_pub, &actuator_controls); break;

case 3: orb_publish(ORB_ID(actuator_controls_3), _actuator_controls_pub, &actuator_controls); break;

default: break;
}
}

control_group_previous = (int8_t) control_group;
}
}

Expand Down