Skip to content

AP_Periph: add support for sending servo telemety#31577

Merged
peterbarker merged 7 commits intoArduPilot:masterfrom
IamPete1:periphServoTelem
Feb 18, 2026
Merged

AP_Periph: add support for sending servo telemety#31577
peterbarker merged 7 commits intoArduPilot:masterfrom
IamPete1:periphServoTelem

Conversation

@IamPete1
Copy link
Copy Markdown
Member

@IamPete1 IamPete1 commented Nov 24, 2025

Adds support for sending servo telem on periph, this allows remote attach of servos and telem to be relayed to the vehicle.

@IamPete1 IamPete1 force-pushed the periphServoTelem branch 2 times, most recently from 8ab0495 to c05e67f Compare February 6, 2026 16:46
@IamPete1 IamPete1 marked this pull request as ready for review February 6, 2026 16:46
@IamPete1
Copy link
Copy Markdown
Member Author

IamPete1 commented Feb 6, 2026

Rebased and tested with #31504

@IamPete1 IamPete1 requested a review from Huibean February 6, 2026 16:46
@IamPete1
Copy link
Copy Markdown
Member Author

IamPete1 commented Feb 6, 2026

@Huibean I have moved the actuator telem to use the servo telem lib.

@tridge
Copy link
Copy Markdown
Contributor

tridge commented Feb 9, 2026

pending testing from @Huibean

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Feb 9, 2026

I have test in VM-L431-SRV-Hub-4CHP, it has issue showing the correct actuator_id, all 0
image

tridge
tridge previously requested changes Feb 9, 2026
Comment thread Tools/AP_Periph/actuator_telem.cpp Outdated
Comment thread Tools/AP_Periph/Servo_telem.cpp Outdated
// Blank packet
const float nan = nanf("");
uavcan_equipment_actuator_Status pkt {
actuator_id: i,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this be i or index?

Copy link
Copy Markdown
Member

@Huibean Huibean Feb 10, 2026

Choose a reason for hiding this comment

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

I think it's index + 1, with this change it can send correct actuator_id

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed to index.

@IamPete1
Copy link
Copy Markdown
Member Author

@Huibean Thanks for testing! Should be fixed now. The key thing with the indexing is to see how it turns up in the log on the main flight controller.

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Feb 10, 2026

@Huibean Thanks for testing! Should be fixed now. The key thing with the indexing is to see how it turns up in the log on the main flight controller.

I tested the update, actuator_id 4 is missing

@IamPete1
Copy link
Copy Markdown
Member Author

I tested the update, actuator_id 4 is missing

I would have expected it to report 0,1,2,3 for 4 in total.

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Feb 10, 2026

I tested the update, actuator_id 4 is missing

I would have expected it to report 0,1,2,3 for 4 in total.

that's wired, https://ardupilot.org/dev/docs/AP_Periph-Parameters.html#out1-function, the input start from 1, OUT1_FUNCTION 51 is actuator_id 1, sending actuator_id 0 command to AP_Periph will not able get response, aslo Ardupilot side start from 1(different from esc command)

@IamPete1
Copy link
Copy Markdown
Member Author

that's wired, https://ardupilot.org/dev/docs/AP_Periph-Parameters.html#out1-function, the input start from 1, OUT1_FUNCTION 51 is actuator_id 1, sending actuator_id 0 command to AP_Periph will not able get response, aslo Ardupilot side start from 1(different from esc command)

Actually our right, because of the +1 on actuator_telem line 170. So it should be 1,2,3,4. Your only seeing 1,2,3? I don't see any change in how the iteration over outputs is done.

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Feb 10, 2026

that's wired, https://ardupilot.org/dev/docs/AP_Periph-Parameters.html#out1-function, the input start from 1, OUT1_FUNCTION 51 is actuator_id 1, sending actuator_id 0 command to AP_Periph will not able get response, aslo Ardupilot side start from 1(different from esc command)

Actually our right, because of the +1 on actuator_telem line 170. So it should be 1,2,3,4. Your only seeing 1,2,3? I don't see any change in how the iteration over outputs is done.

only 1,2,3 is seen, fixed power output on channel 1, so it does not mixmatch
image

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Feb 10, 2026

by the way, there is build error in last change, I fixed it for continue testing

[862/883] Compiling Tools/AP_Periph/Servo_telem.cpp
[873/883] Compiling Tools/AP_Periph/actuator_telem.cpp
../../Tools/AP_Periph/actuator_telem.cpp: In member function 'void ActuatorTelem::send_telemetry(uint8_t, uint8_t)':
../../Tools/AP_Periph/actuator_telem.cpp:143:72: error: narrowing conversion of '(((int)AP_Servo_Telem::TelemetryData::CURRENT) | (((bool)have_duty_cycle) ? ((int)AP_Servo_Telem::TelemetryData::DUTY_CYCLE) : 0))' from 'int' to 'uint16_t' {aka 'short unsigned int'} [-Werror=narrowing]
  143 |         .present_types = AP_Servo_Telem::TelemetryData::Types::CURRENT |
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  144 |                          (have_duty_cycle ? AP_Servo_Telem::TelemetryData::Types::DUTY_CYCLE : 0)
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

@IamPete1
Copy link
Copy Markdown
Member Author

by the way, there is build error in last change, I fixed it for continue testing

I have fixed this and tested with GDB in SITL, I get all four messages being sent.

image

I'm not sure what is going on.

Comment thread Tools/AP_Periph/actuator_telem.cpp
Comment thread Tools/AP_Periph/Servo_telem.cpp Outdated
@IamPete1
Copy link
Copy Markdown
Member Author

rebased.

@IamPete1
Copy link
Copy Markdown
Member Author

Rebased and fixed indexing issue. This is a breaking change to DroneCAN servo telem numbering, this will affect logging and scripting.

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Feb 16, 2026

works now, LGTM

@peterbarker peterbarker merged commit a318c3b into ArduPilot:master Feb 18, 2026
115 of 119 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants