I am trying to navigate the drone using velocity commands.
I am using mavros_msgs/PositionTarget message (mavros_msgs/PositionTarget Documentation) to send velocity commands.
I am sending translational velocities to [geometry_msgs/Vector3] velocity and rotational velocity to yaw and ignored the position commands PX,PY,PZ.
So I am sending x velocity and yaw.
In mavros_msgs/PositionTarget, when I choose the coordinate_frame as FRAME_LOCAL_NED, the drone turns to the desired yaw angle but does not move forward in the turned angle, instead just continues in the x direction.
When I choose FRAME_BODY_NED, drone turns to desired yaw and continues to fly in the turned yaw angle. But the problem with FRAME_BODY_NED is initially the drone rotates to 90 degrees, thus, the coordinate frames with reference to world frame changes and it is a lot of confusion.
Also in both the frames, the drone’s center of gravity is not its origin.
So as the drone moves how can I always make its center to be its origin?
How can I deal with the above mentioned rotational and translational velocity problem?