Trajectory following in Avoidance

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

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.