# How to calculate the Trajectory velocity setpoint in Px4 PositionControl

**URL:** <https://discuss.px4.io/t/how-to-calculate-the-trajectory-velocity-setpoint-in-px4-positioncontrol/35027>\
**Category:** PX4 Autopilot\
**Created:** [October 31, 2023, 11:40am UTC](https://discuss.px4.io/t/how-to-calculate-the-trajectory-velocity-setpoint-in-px4-positioncontrol/35027 "2023-10-31T11:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GHSong](https://discuss.px4.io/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@GHSong](https://discuss.px4.io/u/GHSong)\
**Post date:** [October 31, 2023, 11:40am UTC](https://discuss.px4.io/t/how-to-calculate-the-trajectory-velocity-setpoint-in-px4-positioncontrol/35027/1 "2023-10-31T11:40:59Z")

</div>

Hi. I’m analyzing the Px4-autopilot PositionControl.cpp

 ![111](https://discuss.px4.io/uploads/default/original/2X/2/26063a1c9f9a2a11a8c0ad3bc1054edb5c81b642.png)

I’m wondering about where and how Trajectory calculations are performed. I’d like to know how real-timeTrajectory calculations are made with respect to real-time data. Additionally, I’m interested in how time is factored into Trajectory calculations in real-time, and I’d like to know which specific code is used for these calculations.
