# Issue with uORB message TrajectorySetponit

**URL:** <https://discuss.px4.io/t/issue-with-uorb-message-trajectorysetponit/32175>\
**Category:** PX4 Autopilot\
**Created:** [May 11, 2023, 4:25pm UTC](https://discuss.px4.io/t/issue-with-uorb-message-trajectorysetponit/32175 "2023-05-11T16:25:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Brown](https://discuss.px4.io/user_avatar/discuss.px4.io/adam_brown/32/12846_2.png) [@Adam\_Brown](https://discuss.px4.io/u/Adam_Brown)\
**Post date:** [May 11, 2023, 4:25pm UTC](https://discuss.px4.io/t/issue-with-uorb-message-trajectorysetponit/32175/1 "2023-05-11T16:25:43Z")

</div>

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:

> <https://github.com/adamongerfoo/px4code/blob/650cf03aa21f24247e44c99256a26af7cccc0ca8/verticalvel.py>

---

<div class="post-metadata">

**Author:** ![Benja](https://discuss.px4.io/user_avatar/discuss.px4.io/benja/32/11872_2.png) [@Benja](https://discuss.px4.io/u/Benja)\
**Post date:** [May 12, 2023, 3:07am UTC](https://discuss.px4.io/t/issue-with-uorb-message-trajectorysetponit/32175/2 "2023-05-12T03:07:08Z")

</div>

Hi @Adam_Brown , if you take a look at the [offboard mode documentation](https://docs.px4.io/main/en/flight_modes/offboard.html#copter) 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](https://discuss.px4.io/t/offboard-mode-set-velocity-not-working/30104/2)

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.

---

<div class="post-metadata">

**Author:** ![hamishwillee](https://discuss.px4.io/user_avatar/discuss.px4.io/hamishwillee/32/3469_2.png) [@hamishwillee](https://discuss.px4.io/u/hamishwillee)\
**Post date:** [May 12, 2023, 4:22am UTC](https://discuss.px4.io/t/issue-with-uorb-message-trajectorysetponit/32175/3 "2023-05-12T04:22:41Z")

</div>

> 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.
