I am trying to follow a car detected by the drone’s camera. I have reliable lat, lon, alt or x,y,z (wrt drone’s home) target positions. How can I use the FOLLOW mode to keep following this target?
Note: the car does not have mavros messages sent out to use the traditional FOLLOW pipeline. Instead I will have to setup a ROS topic that publishes the target position. Any help as to how I can setup this FOLLOW mode on custom positions will be appreciated. Thanks
That is one way to do it - specifying the location you want the vehicle to go to. Using position is actually not a particularly good way to do it, as the controllers tend to accelerate hard to get up to speed, then decelerate hard to stop on-point. Its recommended that you use the velocity control options you have if you’re going to do it that way.
Your better option is to investigate the onboard “follow” mode. Configure your quad to follow a specific system ID, then stream the position of that vehicle to the quad using GLOBAL_POSITION_INT. This ought to be much, much less work…
I strongly suggest you SITL this first. Altitude frames can be a problem.
Thanks. So I was able to get the drone to move by publishing to setpoint_velocity topic /mavros/setpoint_velocity/cmd_vel_unstamped.
The drone seemed to move East when I gave it some X velocity, and North when I gave it Y velocity. Aka it follow global ENU coordinates. Is this expected behavior? Can someone point me to the correct documentation.
Thank you for taking the time to respond to my queries.