-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
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 b241f72
nuttx-configs: aerofc: Remove GPIO_I2C*_S**_GPIO
zehortigoza 79e93ff
aerofc: Enable I2C bus 2
zehortigoza afafb13
aerofc_adc: Add support to use others I2C besides PX4_I2C_BUS_EXPANSION
zehortigoza 20822ec
ll40ls: Refactor interface(PWM and I2C) selection and allow probe in …
zehortigoza 3098c77
aerofc: Use the additional I2C
zehortigoza a0fe6f2
aerofc: Reboot board when force bootloader pin is set
zehortigoza 00f8024
aerofc: switch companion baud to 921600
lucasdemarchi d928fd3
aerofc: allow to use 921600 baud to reboot
lucasdemarchi 2b28497
* added new airframe, new mixer and kitepower vtol controller (still …
GabrielKoenig 8a0169f
* Add rigid_wing target for gazebo_sitl repo
GabrielKoenig 48fd8c8
Working new kitepower controller within simulation (simple transition…
GabrielKoenig 6260b45
Update model.
xgerrmann 2889e87
Update submodule
xgerrmann 8fdc4df
submodule update
xgerrmann 0fac808
Mixer for yaw and pitch working correctly in simulation.
xgerrmann 981b9fc
More descriptive comments in mixed file, and add null channel.
xgerrmann 7ab2ec6
Remove redundant mixer (was only for simulation). Invert yaw channel.
xgerrmann 8bacbf0
Different channels in mixers, require a model update.
xgerrmann 1a1b67d
Merge mixer files. Remove mixer only for sitl.
xgerrmann 99f89ef
Change channels of yaw and pitch.
xgerrmann 33ef82d
Merge branch 'fig_8_actuator_mixer' into gamma_rigid_wing
xgerrmann bb5b88c
submodule update.
xgerrmann b2e85f1
Use control group target from mavlink message.
xgerrmann 05d5acd
Fix style.
xgerrmann cd9f333
Add check and fix for changing control groups.
xgerrmann e303bae
Changed !(x==y) to (x!=y). Unadvertise when a different control group…
xgerrmann 09e5fb5
cleaned up, working servo outputs, proper switch mc to fw
GabrielKoenig 5f79220
inverted parachute output signal
GabrielKoenig b4eed22
Merge branch 'gamma_rigid_wing' into set_actuator_pr
xgerrmann 69d106f
Revert "Merge branch 'gamma_rigid_wing' into set_actuator_pr"
xgerrmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
||
/* 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)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?