I am currently working on doing some system identification for a custom UAV I have built and I need data to do so, specifically my inputs and outputs of the system. Inputs being the thrust and torque setpoints, outputs being position and attitude.
I am flying my UAV using offboard control with ROS2 foxy and the uXRCE_dds_client with an onboard companion computer and a Vicon system for GPS. This offboard control code is publishing to the vehicle_attitude_setpoint topic.
I can easily record the values for thrust setpoint since I am writing to them directly, as well as position and attitude thanks to the vicon. But recording what PX4’s generic attitude controller is setting the torque setpoint to is a mystery to me.
Is there any way for me to see and record the torque setpoint?
Thanks
Yes, I know I can enable the vehicle_torque_setpoint topic through the dds_topics.yaml file when building my px4 version, however it appears I can only enable them as topics px4 will subscribe to not publish to.
What I would like to do is this:
Send my vehicle_attitude_setpoint command to my flight controller via publishing to the /fmu/in/vehicle_attitude_setpoint topic.
Record the vehicle_thrust_setpoint and vehicle_torque_setpoint that the flight controller has turned my vehicle_attitude_setpoint command into.
Assuming I understand the way PX4 and its setpoints work? I am under the impression that at the end ALL setpoints become thrust and torque setpoints, which are then converted into PWM signals for the motors.
I am attempting to do some system identification on a vehicle I have built, and I think having the thrust and torque setpoints generated from my attitude setpoint will help me.
This worked, PX4 is publishing data now! I thought I had tried this before and it hadn’t worked, very strange!
actuator_outputs and actuator_motors are publishing as well! Thank you so much, this is very helpful!
I have encountered another problem however, the uXRCE-dds-client appears to be remaking all published/subscribed topics at irregular intervals? This is causing pauses in the data stream that will be problematic when I am doing offboard control. This did not happen before I had added the new topics to the build. Should I open a new thread for this issue?
I am connected over serial. I can’t seem to increase the baud rate any higher than 921600, I see there are more options above it in QGroundControl but when setting it higher the dds agent and client don’t seem to connect.
Regardless, after removing all the topics I wasn’t using from the bridge I have managed to get a stable connection, but only when using one of the actuator_outputs or actuator_motors topics. When using both I have the same issue as before, though luckily I think I only need one of them.
For reference here are all the topics I was having PX4 publish to: