Repository navigation
AP_DroneCAN: fix Himark servo telemetry index - #34586
Conversation
The Himark ServoInfo servo_id is zero indexed: it matches the servo position in the com.himark.servo.ServoCmd array, where cmd.data[0] is SERVO1. Subtracting one shifted the telemetry of every Himark servo down by one channel and dropped the servo with servo_id 0, whose index wrapped to 255. The one indexing was introduced for uavcan.equipment.actuator.Status, whose actuator_id is one indexed, and was applied to Himark by mistake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Global Size Summary (Total Flash delta in bytes)Built from 4a95837 rebased onto cafe674
|
|
Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Reviewed at head Thanks, this looks right. The Himark ServoInfo |
|
Thanks! |
Summary
Fix Himark DroneCAN servo telemetry (CSRV) being logged one channel too low, with the servo on SERVO1 missing entirely, since 4.7.0.
Classification & Testing (check all that apply and add your own)
Built for CubeOrangePlus (Plane).
Hardware: CubeOrangePlus with 8 Himark DroneCAN servos on SERVO1-8,
CAN_D1_UC_OPTIONbit 6 (UseHimarkServo) set.com.himark.servo.ServoInfowithservo_id = 0, SERVO2 withservo_id = 1Description
Himark
ServoInfo.servo_idis zero indexed: it matches the servo's position in thecom.himark.servo.ServoCmdarray, whichSRV_send_himark()fills starting with SERVO1 atcmd.data[0]. The DSDL also documents it as "servo ID from 0 to 17".#31577 (880b978) changed the servo telemetry handlers to
id - 1becauseuavcan.equipment.actuator.Status.actuator_idis one indexed. The same change was applied tohandle_himark_servoinfo(), which shifted every Himark servo's telemetry down by one channel. Forservo_id = 0, the index wraps to 255,AP_Servo_Telem::update_telem_data()rejects it, and that servo's telemetry is never logged.This PR uses
servo_iddirectly. The actuator Status and Volz handlers are unchanged.Affects 4.7.0 and 4.7.1, so this is a backport candidate for 4.7.