I am using Uorb messages with ROS2 to make a drone move in gazebo simulation. I am using Trajectoy setpoint to make the drone go up at a certain velocity. However when I assign the velocity it goes to a certain height which is similar to the velocity value I assigned and then just stops going up. Its as if its taking the velocity value as a position value instead. I used a script made by px4 as a template.
Am I using the wrong uORB message?
link to script below:
Hi @Adam_Brown , if you take a look at the offboard mode documentation you will see that to track a velocity reference you must set position
field of the trajectorySetpoint message to NaN
. Any other finite value will switch on the position controller. So right now you are asking your drone to go to position 0 0 0 with feedforward velocity [0.0, 0.0, -2.0]. The equilibrium of this is exactly what you are seeing. See also Offboard mode set velocity not working - #2 by Benja
FYI @hamishwillee , I think the offboard mode doc should be better linked to the ROS 2 guide and reshaped a bit to have the different control modes better explained.
FYI @hamishwillee , I think the offboard mode doc should be better linked to the ROS 2 guide and reshaped a bit to have the different control modes better explained.
I’ve tried to keep that doc “abstracted” from implementations. But you’re right. Let’s talk about it next week.