Hi all, I am thinking about using CAN servos on a research vehicle. First of all, I am wondering if CAN servos have a way of measuring their actual position (in the same way that CAN ESCs can give you actual motor rpm, not just the ‘target’ rpm). If my understanding is correct and that is the case, then how might one log the servo position? I know there is provision for logging the data from CAN ESCs, is there a topic for CAN servos as well? Thanks for the help.
There is the uavcan.equipment.actuator.Status
message. But it has not been implemented in PX4 code yet.
Gotcha, good to know. Is there a known workaround in PX4, or would you say it would be best to get an external device (maybe some kind of arduino with a microSD) and plug that into the CAN bus and log the data to that?
If your servo emits the message then I would just add support to PX4
Duly noted. I’m pretty green with PX4, any documentation or tutorials you’d recommend I start with? I’m guessing its not as simple as adding some lines to this file: PX4-Autopilot/src/drivers/uavcan/actuators/servo.cpp at 832a90e07fab2815da1efd8c80f7c1372367810b · PX4/PX4-Autopilot · GitHub
It is indeed that simple! Take a look in uavcan/sensors to see how other messages are being handled/published. You’ll also need to extend the uORB ActuatorServos.msg to add the fields you’re interested in. If your node doesn’t already publish the information, you can add publication to the CANnode firmware in src/drivers/uavcannode/Publishers
Not sure if this is appropriate for this thread, but I’ll give it a go anyhow: I made the requisite additions to the servo.cpp and servo.hpp files, as well as adding .msg files and updating the CMakeList in msg. I’m now trying to build and running into this error, which I’m fairly sure is unrelated to the changes:
gmake[3]: *** No rule to make target ‘src/modules/uxrce_dds_client/dds_topics.h’, needed by ‘events/px4.json’. Stop.
I’ve seen a few posts about a similar problem, but that was for SITL builds. I am building with a cubepilot cubeorange+ as the target. Any ideas would be greatly appreciated!
Not sure. I would need to see your changes as well as the full build output.
Unfortunately my organization’s rules disallow my sharing the code. I can share the output from the terminal:
user@computer:~/PX4-Autopilot$ make cubepilot_cubeorangeplus
[ 0%] Built target flighttasks_generated
[ 0%] Built target nuttx_context
[ 0%] Built target events_header
[ 0%] Built target uorb_headers
[ 0%] Built target nuttx_fs_build
[ 0%] Built target parameters_header
[ 0%] Built target nuttx_drivers_build
[ 1%] Built target nuttx_sched_build
[ 1%] Built target nuttx_xx_build
[ 2%] Built target libvnc
[ 2%] Built target mode_util
[ 2%] Built target nuttx_c_build
[ 2%] Built target geo
[ 2%] Built target lat_lon_alt
[ 2%] Built target world_magnetic_model
[ 3%] Built target bias_estimator
[ 3%] Built target yaw_estimator
[ 3%] Built target git_micro_xrce_dds_client
[ 3%] Built target parameters_xml
[ 4%] Built target ver_gen
gmake[3]: *** No rule to make target ‘src/modules/uxrce_dds_client/dds_topics.h’, needed by ‘events/px4.json’. Stop.
gmake[2]: *** [CMakeFiles/Makefile2:15813: src/lib/events/CMakeFiles/events_json.dir/all] Error 2
gmake[2]: *** Waiting for unfinished jobs…
[ 4%] Built target actuators_json
[ 4%] Built target git_nuttx
[ 5%] Built target nuttx_arch_build
gmake[1]: *** [Makefile:156: all] Error 2
make: *** [Makefile:232: cubepilot_cubeorangeplus] Error 2
That’s everything. If there’s any clue in the output I’d love to know, but no sweat if its impossible to diagnose without the code.
Thanks
They allow using open source code but don’t allow contributing back? What a shame