-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Add AP_Servo_Telem #28651
Add AP_Servo_Telem #28651
Conversation
@@ -343,7 +346,11 @@ class AP_DroneCAN : public AP_CANDriver, public AP_ESC_Telem_Backend { | |||
Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_debug_LogMessage> debug_cb{this, &AP_DroneCAN::handle_debug}; | |||
Canard::Subscriber<uavcan_protocol_debug_LogMessage> debug_listener{debug_cb, _driver_index}; | |||
|
|||
#if AP_DRONECAN_VOLZ_FEEDBACK_ENABLED | |||
#if AP_DRONECAN_HIMARK_SERVO_SUPPORT && AP_SERVO_TELEM_ENABLED | |||
Canard::ObjCallback<AP_DroneCAN, com_himark_servo_ServoInfo> himark_servo_ServoInfo_cb{this, &AP_DroneCAN::handle_himark_servoinfo}; |
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.
himark servo was just broken, there was a function but the callback was never registered.
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.
this must have been a regression, it worked when it went in
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.
In the change of DroneCAN library I think, I fixed the same thing for the volz message, #27924 we should probably check all the rest....
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.
I have checked the rest, we are OK no others missing.
.command_position = servo.commandedPosition(), | ||
.measured_position = servo.position(), |
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.
Strictly these are not the correct units, should be degrees. I'm not familiar enough with piccolo CAN to know if we can do a conversion.
@@ -131,7 +131,6 @@ class AP_PiccoloCAN : public AP_CANDriver, public AP_ESC_Telem_Backend | |||
AP_Int16 _ecu_id; //!< ECU Node ID | |||
AP_Int16 _ecu_hz; //!< ECU update rate (Hz) | |||
|
|||
HAL_Semaphore _telem_sem; |
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.
This was only ever called in one place, so its not needed.
telem.data[i].primary_current, | ||
telem.data[i].secondary_current, | ||
telem.data[i].primary_voltage, | ||
telem.data[i].secondary_voltage, |
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.
We do loose logging of the secondary current and voltage, they could be added as extra fields in the future.
@IamPete1 I have added simulation of DroneCAN actuator status and fixed some bugs in the PR here: |
@@ -343,7 +346,11 @@ class AP_DroneCAN : public AP_CANDriver, public AP_ESC_Telem_Backend { | |||
Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_debug_LogMessage> debug_cb{this, &AP_DroneCAN::handle_debug}; | |||
Canard::Subscriber<uavcan_protocol_debug_LogMessage> debug_listener{debug_cb, _driver_index}; | |||
|
|||
#if AP_DRONECAN_VOLZ_FEEDBACK_ENABLED | |||
#if AP_DRONECAN_HIMARK_SERVO_SUPPORT && AP_SERVO_TELEM_ENABLED | |||
Canard::ObjCallback<AP_DroneCAN, com_himark_servo_ServoInfo> himark_servo_ServoInfo_cb{this, &AP_DroneCAN::handle_himark_servoinfo}; |
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.
this must have been a regression, it worked when it went in
bf25f51
to
f6a94ff
Compare
Thanks, I have pulled in your changes. |
allows for testing of DroneCAN servo logging in SITL
and fixed typo in logging
f6a94ff
to
e8c5252
Compare
@@ -68,6 +68,7 @@ Please keep the names consistent with Tools/autotest/param_metadata/param.py:33 | |||
| 's' | "s" | seconds| | |||
| 'q' | "rpm" | revolutions per minute| Not an SI unit, but sometimes more intuitive than Hertz| | |||
| 'r' | "rad" | radians| | |||
| 't' | "N.m" | Newton meters | torque | |
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.
This should be "N-m" or "N m"
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.
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.
Very nice!
@IamPete1 nice work, thanks! |
Unfortunately, this broke the DDS build.
I'm not happy about the generator using global defines, but it's written for C... Is an easy fix to rename the enum in this class? |
This adds a servo telem library. Logging only at this stage. There are some benefits, DroneCAN servo logging can be rate limited, this is currently not possible as each instance is logged when it arrives, so it is rate limited individual rather than as a block of each instance.
In the longer term scripting bindings will be added to get and provide this data. That will allow servo health checking and failsafes.