-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Labels
Milestone
Description
The documentation for the velocity command is very wrong. After working with the drones for the past week and going through Parrot's ardronelib, here's what I have found about cmd_vel:
linear.x - percentage of maximum tilt angle forward to backward (1 to -1)
linear.y - percentage of maximum tilt angle left to right (1 to -1)
linear.z - velocity of altitude in meters / second (parrot's docs are wrong)
angular.z - velocity of yaw in ~95 degrees / second
This means that x and y are force parameters, not velocity. They can be approximately related to acceleration using the following formula which makes use of the assumption that the drone tries to maintain the same altitude for all orientations it might be in:
accelX = tan (linear.x * maxTiltAngleX) * G
accelY = tan (linear.y * maxTiltAngleY) * G
so
linear.(x or y) = ( atan ( accel / G ) ) / maxTiltAngle
where G is 9.8ms^2, and the max tilt angles are parameters for ardrone_autonomy.
See the file ARDroneLib/Soft/Common/ardrone_api.h starting at lines 697 for the documentation of ardrone_at_set_progress_cmd
* @param phi Left/right angle between -1 to +1 - negative values bend leftward.
* @param roll Front/back angle between -1 to +1 - negative values bend forward.
* @param gaz Vertical speed - negative values make the drone go down.
* @param yaw Angular speed - negative values make the drone spin left.
* @param magneto_psi floating value between -1 to +1.
* @param magneto_psi_accuracy floating value between -1 to +1
* This function allows the client program to control the drone by giving it a front/back
* and left/right bending order, a vertical speed order, and a rotation order.
* All values are given as a percentage of the maximum bending angles (in degrees),
* vertical speed (in millimeters per second) and angular speed (in degrees per second).