API reference
puku0x edited this page Apr 30, 2016
·
20 revisions
This page introduces the APIs of CV Drone.
- ardrone_addr: IP adrress of AR.Drone.
- Initializes the AR.Drone.
- When it succeed it returns 1, if it failed it returns 0.
- Updates all datas of the AR.Drone.
- When it succeed it returns 1, if it failed it returns 0.
- NOTE: Only for backward compatibility.
- Finalizes the AR.Drone.
- This function is automatically called.
- Obtains a frame from the camera of AR.Drone.
- When it succeed it returns cv::Mat or IplImage*, if it failed it returns an empty cv::Mat() or NULL.
- Obtains AR.Drone's version.
- Obtains AR.Drone's role angle [rad]
- Obtains AR.Drone's pitch angle [radian].
- Obtains AR.Drone's yaw angle [radian].
- Obtains AR.Drone's altitude [m].
- *vx: The pointer to X (Front side of AR.Drone) velocity [m/s].
- *vy: The pointer to Y (Left side of AR.Drone) velocity [m/s].
- *vz: The pointer to Z (Upper side of AR.Drone) velocity [m/s].
- Obtains AR.Drone's velocities.
- This function returns a norm[m/s] of velocity vectors.
- *latitude: The pointer to north-latitude of AR.Drone 2.0.
- *longitude: The pointer to east-longitude of AR.Drone 2.0.
- *elevation: The pointer to elevation of AR.Drone 2.0.
- Obtains GPS information from the AR.Drone 2.0 Flight Recorder.
- This function returns 1 when the GPS data is reliable.
- Obtains AR.Drone's battery percentage.
- Takes off the AR.Drone.
- Lands the AR.Drone.
- Emergency stop.
- Not recommended.
- vx: X velocity [m/s].
- vy: Y velocity [m/s].
- vr: Rotational speed [rad/s].
- Moves the AR.Drone in 2D plane.
- vx: X velocity [m/s].
- vy: Y velocity [m/s].
- vz: Z velocity [m/s].
- vr: Rotational speed [rad/s].
- Moves the AR.Drone in 3D space.
- Checks AR.Drone is on ground or not.
- If YES it returns 1, if NO it returns 0.
- Calibrates the flat trim of AR.Drone.
- You should set your AR.Drone on a flat plane.
- device: Device ID (Magnetometer = 0)
- Calibrates the magnetometer of AR.Drone 2.0.
-
channel: Camera channel (0-3).
-
Changes the camera channel.
- id: Flight animation ID (0-20)
- duration: Duration [ms]
- Runs specified flight animation.
- id: LED animation ID (0-20)
- freq: Frequency [Hz]
- duration: Duration [s]
- Runs specified LED animation.
- activate: Start/stop recording
- Starts recording video in a USB key.
- You should set a USB key with > 100MB to your drone.
- Don't forget calling setVideoRecord(false) at the end of recording.
- You should disconnect AR.Drone first, when the video was not saved to USB.
- This function is only for AR.Drone 2.0.
- activate: Enable/disable outdoor mode
- Changes current mode to outdoor mode.
- NOTE: This is an experimental function.
- Checks whether the video thread has received a new image since the last getImage().
- NOTE: This is an experimental function.
For more details of ARDrone class, please see ardrone.h.
- How to build
- API reference
- FAQ