Hello, i would like to know how and where in the flight code is the velocity setpoints are generated from the given position setpoints to be fed later into the position controller.
Hi @eldewany ,
The high-level logic is here:
- Get waypoints in global position from the mission plan and convert to local frame + checks: PX4-Autopilot/FlightTaskAuto.cpp at 3d8a35288e2c663a53caa8cae9281eb9927d87de · PX4/PX4-Autopilot · GitHub
- Computes the required speed to reach the next waypoint (switches from L1-stlye turns to straight line): PX4-Autopilot/FlightTaskAutoLineSmoothVel.cpp at 3d8a35288e2c663a53caa8cae9281eb9927d87de · PX4/PX4-Autopilot · GitHub
Then the trajectory generator class used before is defined here: PX4-Autopilot/src/lib/motion_planning at master · PX4/PX4-Autopilot · GitHub
Some documentation can be found here:
https://docs.px4.io/master/en/flight_modes/mission.html#rounded-turns-inter-waypoint-trajectory
https://docs.px4.io/master/en/config_mc/mc_jerk_limited_type_trajectory.html#jerk-limited-type-trajectory-for-multicopters
1 Like
Thanks for your reply, this is exactly what i was looking for.