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

Get RAW values of the servo outputs #1198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TongBingda
Copy link

@morzack Thank you for replying to my email, I would love to be a maintainer of this program!

The RAW value of the servo output can be acquired based on the SERVO_OUTPUT_RAW information.

An object of this type is returned by :py:attr:Vehicle.servos.

:param port: Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
:param servo_raw['1'] ~ servo_raw['16']: Servo output 1 ~ 16 value.

The RAW values of the servo outputs.

    An object of this type is returned by :py:attr:`Vehicle.servos`.

    :param port: Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
    :param servo_raw['1'] ~ servo_raw['16']: Servo output 1 ~ 16 value.
spelling mistake correction
@morzack morzack self-requested a review July 12, 2023 13:48
@morzack
Copy link
Contributor

morzack commented Jul 19, 2023

Sorry for the delay in taking a look at this. Overall, it looks good to me. Did you do any testing on actual hardware for this change?
@TongBingda

When running ardupilot firmware using the sitl method, SERVO_OUTPUT_RAW usually uses mavlink 2.0, whereas this message usually uses mavlink 1.0 when I run ardupilot firmware using the Cube Orange, which makes it impossible to get the values from servo9_raw to servo16 _raw values. So I used len(m.lengths) to get the actual number of servo_outputs.
@TongBingda
Copy link
Author

Sorry for the delay in taking a look at this. Overall, it looks good to me. Did you do any testing on actual hardware for this change? @TongBingda

Yes, I recently tested this new feature using a Cube Orange and a CUAV X7+. I found some problems with the previous code. When running ardupilot firmware using the sitl method, SERVO_OUTPUT_RAW usually uses mavlink 2.0, whereas this message usually uses mavlink 1.0 when I run ardupilot firmware using Cube Orange, which makes it impossible to get the servo9_raw to servo16 _raw values. So in the latest code I used len(m.lengths) to get the actual number of servo_outputs to prevent errors.

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.

2 participants