# Trajectory following in Avoidance

**URL:** <https://discuss.px4.io/t/trajectory-following-in-avoidance/14162>\
**Category:** PX4 Autopilot\
**Created:** [December 3, 2019, 5:34am UTC](https://discuss.px4.io/t/trajectory-following-in-avoidance/14162 "2019-12-03T05:34:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrazshad](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@shrazshad](https://discuss.px4.io/u/shrazshad)\
**Post date:** [December 3, 2019, 5:34am UTC](https://discuss.px4.io/t/trajectory-following-in-avoidance/14162/1 "2019-12-03T05:34:42Z")

</div>

Hi,

From my understanding, there are two trajectory following methods used in the Avoidance repo. Setpoint for Offboard mode and Trajectory\_setpoints in Mission Mode.

In Offboard setpoint mode, points are sent sequentially to mavros/setpoint\_position/local, while in Mission mode, Mavros::Trajectory is sent to /mavros/trajectory/generated.

My question is, in Offboard mode, if it is using setpoint directly to control the drone, how does it control the drone to fly a smooth flying path? From simulation it seems that the flight was quite smooth, can anyone shed some light here.

Thanks.  
Joe

---

<div class="post-metadata">

**Author:** ![hhenryy](https://discuss.px4.io/user_avatar/discuss.px4.io/hhenryy/32/16488_2.png) [@hhenryy](https://discuss.px4.io/u/hhenryy)\
**Post date:** [December 7, 2019, 9:03pm UTC](https://discuss.px4.io/t/trajectory-following-in-avoidance/14162/2 "2019-12-07T21:03:43Z")

</div>

Hi,

How do you define smooth?

The setpoints sent to the controller through mavros will be sent with a frequency based on how `ros::rate()` was initialised. Thus if you have a continuous setpoint signal stored in memory (which isn’t the case, but lets make the assumption) the signal will be sampled at the `ros::rate()` frequency, resulting in a descretised signal.

The descretised setpoint signal is thus sent to the controller. The controller reacts to this new signal, and your system (the UAV) will have a smooth response, since it is a continuous system.
