How to control trajectory of quadcopter ?

Hello Guys … .

I am attempting to make my quadcopter go around a tree at a constant radial distance (say 50cm ) from it using dronekit python running on a raspberry pi . I will be using a distance sensor (Lidar or ultrasonic sensor) mounted in front.

I have understood that i need to trigger Yaw and Roll constantly to achieve circular motion while keeping the drone’s nose pointed towards the tree . I am using a Pixhawk running Ardupilot . My question is how do i send these yaw and roll signals to my Pixhawk from Raspberry Pi ?

Is it possible to use the circular mode of Ardupilot in this scenario ???

Thanks in advance !!

I haven’t used dronekit, but I suppose you should be able to send RC commands (e.g. RC 1 1750, RC 4 1700) to produce a roll and yaw. However, there may be a better/easier way to do what you want: Circle Mode or Region of Interest.

Circle Mode allows you to set a radius and speed with CIRCLE_RATE and CIRCLE_RADIUS parameters. When the copter enters this mode, it will fly in a circle around the object with its nose pointed towards the middle. This mode can also be invoked in a mission with the LOITER_TURNS command.

Ardupilot also has a function called Region of Interest (ROI). This function takes a GPS location (lat, long, alt) as input. When it is enabled, the drone will face its nose (or its camera gimbal, if configured) towards that location at all times until ROI is turned off. This will allow you to maneuver the drone in any way while having it face the tree. It can be used in combination with a circle command or waypoints.

Thanks Rick
I will surely try out ROI mode . Can you please explain how to send rc commands as you told . In that case will it discard the signal obtained from the rc receiver ??


Use mission planner circle survey. Way easier.

I’m not familiar with dronekit, but with Mavproxy, yes, the RC commands act as overrides and the signal from the receiver is ignored for that channel until you cancel the override.

But I must warn you to be careful if you choose to pursue this method. I don’t know what your application is, but RC overrides are probably not a good way to maneuver the drone in most situations. If you have GPS, using mission waypoints or Circle mode would be safer and probably more accurate.