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

Added new code for MAV_CMD_DO_SET_SERVO ArduPilot #2113

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

trolledbypro
Copy link
Contributor

Pull request in support of #2111
I added support for actuator control in ArduPilot by modifying the set_actuator function from the Action plugin. I added an if statement that uses the MAV_CMD_DO_SET_SERVO command on ArduPilot systems due to the MAV_CMD_DO_SET_ACTUATOR command not being implemented in ArduPilot. PX4 will continue to use MAV_CMD_DO_SET_ACTUATOR as before.

A word on MAV_CMD_DO_SET_ACTUATOR: this command is capable of setting multiple actuator values at once, while MAV_CMD_DO_SET_SERVO only sets one actuator at a time. Since the set_actuator function is only setting one actuator at a time, MAV_CMD_DO_SET_SERVO is a one-to-one substitute of MAV_CMD_DO_SET_ACTUATOR.

@julianoes julianoes self-requested a review August 13, 2023 23:14
julianoes
julianoes previously approved these changes Aug 13, 2023
Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

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

  • Would you mind fixing the style, with ./tools/fix_style.sh . from the root of the repo?
  • The musl CI errors are unrelated (that's a timeout, just ignore it).
  • There seems to be a Werror in windows, that should be fixed as well: warning C4244: '=': conversion from 'const int' to 'float', possible loss of data. I guess that's your line 524?
command.params.maybe_param1 = index;

@trolledbypro
Copy link
Contributor Author

I ran ./tools/fix_style.sh as per these instructions and performed the required cast to eliminate the warning

Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

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

Thanks a lot! 🚀

@JonasVautherin JonasVautherin merged commit 9e06fc4 into mavlink:main Aug 15, 2023
30 checks passed
@trolledbypro trolledbypro deleted the pr-ardupilot-set-servo branch August 15, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants