AR Drone Guide Notes
Chapter 7 - Incoming Data Steam
- Navigation Data - navdata also known as navigation data is given an application continuously to keep up with the condition of the drone.
- Navigation Data Stream
- navdata sent from UDP Port 5554
- information is stored in a binary format
- made up of many data called options
- each option = 2 bytes (header)
- important options are
- navdata_demo_t
- navdata_cks_t
- navdata_host_angles_t
- navdata_vision_detect_t
- content is found in C structure primarily in navdata_common.h
- Initiating the reception of Navigation data
- to receive navigation data
- drone is in BOOTSTRAP mode when starting
- status and sequence counter set only
- to exit BOOTSTRAP mode, send AT command to modify the default settings on drone
- AT*CONFIG=\"general:navdata_demo\", \"TRUE\"\\r
- AT*CTRL=0
- drone is always started and navdata demos are send
- Augmented reality data stream
- drone detects up to four tags or oriented roundel
- The AR. Drone 1.0 video stream
- Image Structure
- image is split into group of blocks (GOB)
- split into Macroblocks to make a 16x16 image
- UVLC codec overview, UVLC codec close to JPEG
- P264 codec Review
- I Frames are complete frames, and it does not need any other frames to decode.
- P Frame use previous frames to predict
- use other frames as a reference to build upon
- best reference will be sent from the reference picture to the new image or P-picture
- Initiating the video stream
- client needs to send UDP packet on drone video port
- starts to stream
- if there is no connection between the client and drone
- stream ends
- The AR.Drone 2.0 video stream
- uses H264 (MPEG4.10 AVC) to video stream
- FPS, frames per second, 15 ~ 30
- Bitrate, 250 kbps and 4Mbps
- Resolution: 360p (640x360) or 720p (1280x720)
- On Apple products it will change
- Default 720p, 30FPS, 4Mbps
- Live stream uses MPEG4.2 Visual encoder
- can be adjusted between 15 to 30 fps and 250 kbps to 1Mbps
- video frames are sent with custom headers which informs the user about the frames
- headers can be found on page 68
- Network transmission of video stream
- transmitted on TCP socket 5555
- Drone immediately sends frames when connected to socket
- Since the frame can be sent in numerous TCP packets
- reassemble it by application before doing
- In ARDroneTool done within Video/video_stage_tcp.c file
- Latency reduction mecanism
- latency arises when TCP transmission permits application to all frames
- latency reduction mecanism from Video/video_stage_tcp.c file remove the older frames and send the newer ones to the decoder
- Video record stream
- uses TCP socket 5553 to send out H264-720p frames
- stream will not run if application is not running either
- converts H264 stream into files that are more accessible like .mov or .mp4 is done by Video/video_stage_encoded_recorder.c file
- uses utils/ardrone_video_atoms and utils/ardrone_video_encapsuler
Chapter 8 - Drone Configuration
- With ARDroneTool
- include <ardrone_tool/ardrone_tool_configuration.h> file into code to access ardrone_control_config structure
- has the configuration of drone
- Without ARDroneTool
- to get drone configuration without ARDroneTool, send AT*CRTL command with a mode parameter equaling 4
- sends on control communication port (TCP port 5559)
- Setting the drone configuration
- With ARDroneTool
- ARDRONE_TOOL_CONFIGURATION_ADDEVENT
- set configuration parameters
- allows the drone to understand new adjustments
- First parameter = name
- Second is a pointer of the new value that will be sent to drone
- Third is a callback saying that signals completion
- if success, 1 - if fail, 0 and repeats eventually
- From the Control Engine for iPhone
- Without ARDroneTool
- AT*CONFIG with correct sequence #, parameter note between double-quotes, and parameter value between double-quote to configure drone
- Multiconfiguration
- share AR.Drone with different configurations
- Configuration Keys:
- CAT_COMMON - default, all application
- holds config keys common to all applications and users
- CAT_APPLI - setting saved for current application
- application specific configuration
- video encoding & navdata_options
- CAT_USER - setting saved for current user
- switch active users at runtime for applications
- CAT_SESSION - setting saved for whole flight
- current flight settings
- active video camera & detection
- default setting after reboot or disconnect
- With ARDRoneTool
- ardrone_tool_init function takes 2 string pointers to application name and user
- sets ardrone_config_t structure called ardrone_application_default_config which holds default configuration
- sent to AR.Drone and overwrites default configuration
- Without ARDroneTool
- if new configuration, AR.Drone requires AT*CONFIG_IDS identifiers that match the default configuration before AT*CONFIG to change settings
- General Configuration - GENERAL:
- CAT_COMMON, read only
- num_version_config - congiuration subsystem version
- num_version_mb - drone motherboard hardware version
- num_version_soft - drone firmware version
- drone_serial - drone serial number
- soft_build_date - drone firmware compilation date
- motor1_soft - motor 1 board software version, applicable to other motors
- motor1_hard - motor 1 board hardware version, applicable to other motors
- motor1_supplier - motor 1 board supplier version, applicable to other motors
- flying_time - how long the drone spend flying in seconds
- vbat_min - minimum battery life before AR.Drone shutting down
- CAT_COMMON, read/write
- ardrone_name - name of AR.Drone
- AT command example: AT*CONFIG=605,"general:ardrone_name","My ARDrone Name"
- API use example: ARDRONE_TOOL_CONFIGURATION_ADDEVENT (ardrone_name, "My ARDrone Name", myCallback);
- navdata_demo - send navdata to clients or all available information that may or may not contain irrelevant information
- TRUE = reduced
- FALSE = all data
- AT command example: AT*CONFIG=605,"gneeral:navdata_demo","TRUE"
- API use example:
bool_t value = TRUE
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (navdata_demo, &value, myCallback); - com_watchdog - how long the drone can wait without being commanded by a client program, if exceeds then Com Watchdog triggered state (hovering)
- disabled at the moment
- video_enable - TRUE default, should not be FALSE (not implemented)
- vision_enable - TRUE default, should not be FALSE (not implemented)
- CAT_APPLI, read/write
- navdata_options - application asks for navdata packets, all navdata packets are found in navdata_common.h file
- AT command example: AT*CONFIG=605,"general:navdata_options","105971713"
- Control Configuration - CONTROL:
- CAT_COMMON, read only
- accs_offset - AR.Drone accelerometers offsets
- accs_gains - AR.Drone accelerometers gains
- gyros_offset - AR.Drone gyrometers offsets
- gyros_gains - AR.Drone gyrometers gains
- gyros110_offset -
- gryos110_gains -
- magneto_offset -
- magneto_radius -
- gyro_offset_thr_x - also for y and z axis
- pwm_ref_gyros -
- osctun-value -
- osctun_test -*All are Parrot internal debug informations*
- CAT_APPLI, read/write
- control_level - how drone interprets progressive commands from user
- Bit 0 is global enable bit, should be active
- Bit 1 is combined yaw mode, roll commands make roll+yaw based turns, good for racing
- AT command example: AT*CONFIG=605,"control:control_level","3"
- CAT_USER, read/write
- euler_angle_max - maximum bending angle in radians for pitch&roll angles
- prefer ardrone_at_set_progress_cmd_with_magneto for AR.Drone 2.0, AT command: AT*PCMD_MAG
- parameter is a value between 0 to 0.52
- AT*CONFIG=605,"control:euler_angle_max",".25"
- control_iphone_tilt
- angle in radians for iPhone acelerometer command
- on AR.FreeFlight, progressive command sent is between 0 and 1 for angles going from 0 to 90.
- AT command example: AT*CONFIG=605,"control:control_iphone_tilt",".25"
- API use example:
float iTiltMax = .25;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (control_iphone_tilt, &iTiltMax, myCallback); - control-vz_max
- maximum vertical speed of AR.Drone, millimeters per second, 200~2000
- AT command example: AT*CONFIG=605,"control:control_vz_max","1000"
- API use example:
uint32_t vzMax = 1000;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (control_vz_max, &vzMax, myCallback); - control_yaw - maximum yaw speed of AR.Drone in radians per second, .7 rads/s to 6.11 rads/s
- AT command example: AT*CONFIG=605,"control:control_yaw","3.0"
- API use example:
float yawSpeed = 3.0;
ARDRONE_TOOL_CONFIGURATION-ADDEVENT (control_yaw, &yawSpeed, myCallback); - indoor_euler_angle_max - used when CONTROl:outdoor is false
- indoor_control_vz_max - used when CONTROL:outdoor is false
- indoor_control_yaw - used when CONTROL:outdoor is false
- outdoor_euler_angle_max - used when CONTROL:outdoor is true
- outdoor_control_vz_max - used when CONTROL:outdoor is true
- outdoor_control_yaw - used when CONTROl:outdoor is true
- CAT_COMMON, read/write
- altitude_min - minimum drone altitude in millimeters
- AT command example: AT*CONFIG=605,"control:altitude_min","50"
- API use example:
uint32_t altMin = 50;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (altitude_min, &altMin, myCallback); - altitude_max - maximum drone altitude in millimeters
- AT command example: AT*CONFIG=605, "control:altitude_max","3000"
- API use example:
uint32_t altMax = 3000;
ARDRONE_TOOL-CONFIGURATION_ADDEVENT (altitude_max, &altMax, myCallback); - outdoor - tells control loop that AR.Drone is flying outside, adjusts to outdoor or indoor settings
- AT command example: AT*CONFIG=605,"control:outdoor","TRUE"
- API use example:
boot_t isOutdoor = TRUE;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (outdoor, &isOutdoor, myCallback); - flight_without_shell - tells control loop that AR.Drone is using outdoor hull, turn off when indoor hull different than outdoor setting and matches with setting for outdoor hull
- AT command example: AT*CONFIG=605,"control:flight_without_shell","TRUE"
- API use example:
boot_t withoutShell = TRUE;
ARDRONE_TOOL_CONFIGURATION-ADDEVENT (flight_without_shell, &withoutShell, myCallback); - autonomous_flight - no longer useful but previously used to put drone on autonomous flight mode
- flight_anim - launch drone animations, animations can be found in config.h file
- MAYDAY_TIMEOUT contains default duration for each flight animation
- AT command example: AT*CONFIG=605,"control:flight_anim","3,2"
- CAT_USER, read only
- manual_trim - should be only used if drone is using manual trims, should not be used - put FALSE setting
- CAT_SESSION, read/write
- flying_mode - has two flight modes which is either
- legacy FreeFlight mode where user controls the drone
- semi-autonomous mode, "HOVER_ON_TOP_OF_ROUNDEL" hover on top of ground tag
- AT command example: AT*CONFIG=605,"control:flying_mode","0"
- API use example:
FLYING_MODE fMode = FLYING_MODE_FREE_FLIGHT;
ARDRONE_TOOL_CONFIGURATION-ADDEVENT (flying_mode, &fMode, myCallback); - hovering_range - used when flying mode is "HOVER_ON_TOP_OF_(ORIENTED_)ROUNDEL"
- Network Configuration - NETWORK:
- CAT_COMMON, read/write
- ssid_single_player - applied when rebooted
- AT command example: AT*CONFIG=605,"network:ssid_single_player","myArdroneNetwork"
- API use example:
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (ssid_single_player, "myArdroneNetwork", myCallback); - ssid_multi_player - not usable
- wifi_mode - adjusts WiFi network, should not be changed
- 0 - drone is access point
- 1 - drone creates or joins network in Ad-Hoc mode
- 2 - drone join network as station
- wifi_rate - debug configuration, should not be modified
- owner_mac - MAC address pair with AR.Drone
- reset by 00:00:00:00:00:00
- AT command example: AT*CONFIG=605,"network:owner_mac","01:23:45:67:89:ab"
- API use example:
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (owner_mac, "cd:ef:01:23:45:67", myCallback); - Nav-board Configuration - PIC:
- CAT_COMMON, read/write
- ultrasound_freq
- frequency of ultrasound measures for altitude
- 22.22Hz or 25 Hz
- AT command example: AT*CONFIG=605,"pic:ultrasound_freq","7"
- API use example:
ADC_COMMANDS uFreq = ADC_CMD_SELECT_ULTRASOUND_22Hz;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (ultrasound_freq, &uFreq, myCallback); - values are found in ardrone_common_config.h file
- ultrasound_watchdog - should not be modified
- CAT_COMMON, read only
- pic_version - software version of Nav-board
- Video Configuration - VIDEO:
- CAT_COMMON, read only
- camif_fps - FPS of video interface, may differ from actual framerate
- camif_buffers - buffer depth for video interface
- num_trackers - number of tracking point for the speed estimation
- video_storage_space - size of wifi video record buffer
- CAT_COMMON, read/write
- codec_fps - current FPS of live video codec, max 30
- AT command example: AT*CONFIG=605,"video:codec_fps","30"
- API use example:
uint32_t codecFps = 30;
ARDRONE_TOOL_CONFIGURATION-ADDEVENT (codec_fps, &codecFps, myCallback); - video_on_usb - TRUE with USB key more than 100 MB of space, video stream will be placed there
- AT command example: AT*CONFIG=605,"video:video_on_usb","TRUE"
- API use example:
bool_t recordonUSB = TRUE;
ARDRONE_TOOL-CONFIGURATION_ADDEVENT (video_on_usb, &recordOnUsb, myCallback); - video_file_index - AR.Drone 2.0 number on last recorded video on USB key
- application should not adjust the value on key
- CAT_SESSION, read/write
- video_codec - current video codec of AR.Drone
- AR.Drone 2.0, start/stop record stream
- MP4_360P_CODEC - live stream with MPEG4.2 soft encoder, no record stream
- H264_360P_CODEC - live sream with H264 hardware encoder in 360p, no record stream
- MP4_360P_H264_720P_CODEC - live stream with MPEG4.2 soft encoder, record stream with H264 hardware encoder in 720p
- H264_720P_CODEC - live stream with H264 hardware encoder in 720p, no record stream
- MP4_360P_H264_360P_CODEC - live stream with MPEG4.2 soft encoder, record stream with H264 hardware encorder in 360p
- AT command example: AT*CONFIG=605,"video:video_codec","129"
- API use example:
codec_type_t newCodec = H264_360P_CODEC;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (video_codec, &newCodec, myCallback); - video_slices - should not be modified
- video_live_socket - should not be modified
- CAT_APPLI, read only, multiconfig - read/write
- bitrate - when using bitrate control in "VBC_MANUAL", bitrate of video transmission in kilobits per second (500~4000kbps)
- different when in VBC_MODE_DYNAMIC, will change kbps dynamically
- AT command example: AT*CONFIG=605,"video:bitrate","1000"
- API use example:
uint32_t newBitrate = 4000;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (bitrate, &newBitrate, myCallback); - bitrate_control_mode - enables automatic bitrate control of video stream and also enables configuration to reduce bandwith used by video stream under bad WiFi
- CAT_SESSION, read only, multiconfig - read/write
- bitrate_control_mode - maximum bitrate a device can handle
- VBC_MANUAL, maximum bitrate ignored
- VBC_MODE_DISABLED, maximum bitrate applied
- AT command example: AT*CONFIG=605,"video:max_bitrate","1000"
- API use example:
uint32_t newMaxBitrate = 4000;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (max_bitrate, &maxNewBitrate, myCallback); - CAT_APPLI, read/write
- bitrate_storage - for AR.Drone 2.0 Bitrate *kps) of recording stream
- both USB and WiFi record
- CAT_SESSION, read/write
- video_channel - video channel that will be sent to controller
- ZAP_CHANNEL_HORI
- ZAP_CHANNEL_VERT
- AT command example: AT*CONFIG=605,"video:video_channel","2"
- API use example:
ZAP_VIDEO_CHANNEL nextChannel = ZAP_CHANNEL_HORI;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (video_channel, &nextChannel, myCallback); - Leds Configuration - LEDS:
- CAT_COMMON, read/write
- use to launch leds animations
- animation names found in led_animation.h file
- animation number, frequency, duration
- AT command example: AT*CONFIG=605,"leds:leds_anim","3,1073741824,2"
- Detection Configuration - DETECT:
- CAT_COMMON, read/write
- enemy_colors - what color hulls you want to detect: green, yellow, blue - 1,2,3
- AT command example: AT*CONFIG=605,"detect:enemy_colors","2"
- API use example:
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (enemy_colors, &enemyColors, myCallback); - enemy_without_shell - to detect outdoor hulls, deactivate for indoor hulls
- AT command example: AT*CONFIG=605,"detect:enemy_without_shell","1"
- API use example:
uint32_t activated = 0;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (enemy_without_shell, &activated, myCallback); - CAT_SESSION, read/write
- detect_type - active tag detection, values at ardrone_api.h
- CAD_TYPE_NONE - no detection
- CAD_TYPE_MULTIPLE_DETECTION_MODE - configure detection on camera
- CAD_TYPE_ORIENTED_COCARDE_BW - black and white oriented roundel detected on bottom facing camera
- CAD_TYPE_VISION_V2 - standard tag detection
- AT command example: AT*CONFIG=605,"detect:detect_type","10"
- API use example:
CAD_TYPE detectType = CAD_TYPE_MULTIPLE_DETECTION_MODE;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (detect_type, &detectType, myCallback); - detections_select_h - bitfields to select detection that should be enabled on horizontal camera, values at ardrone_api.h
- TAG_TYPE_NONE - no tag detection
- TAG_TYPE_SHELL_TAG_V2 - standard indoor and outdoor hulls tag
- TAG_TYPE_BLACK_ROUNDEL - black and white oriented roundel
- AT command example: AT*CONFIG=605,"detect:detections_select_h","1"
- API use example:
uint32_t detectH = TAG_TYPE_MASK (TAG_TYPE_SHELL_TAG);
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (detections_select_h, &detectH, myCallback); - detections_select_v_hsync - bitfields to select detection that should be enabled on vertical camera
- syncs with hsync mode, 30fps which reduces CPU load
- AT command example: AT*CONFIG=605,"detect:detections_select_v_hsync","2"
- API use example:
uint32_t detectVhsync = TAG_TYPE_MASK (TAG_TYPE_ROUNDEL);
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (detections_select_v_hsync, &detectVhsync, myCallback); - detections_select_v - same as previous point but without the hsync mode
- runs at 60 Hz instead of 30 fps
- heavier on CPU
- should not be used with previous point
- AT command example: AT*CONFIG=605,"detect:detections_select_v","2"
- API use example:
uint32_t detectV = TAG_TYPE_MASK (TAG_TYPE_ROUNDEL);
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (detections_select_v, &detectV, myCallback); - USERBOX section - save navigation data from drone during a time period and take photos
- USERBOX:userbox_cmd
- USERBOX_CMD_STOP - stop userbox, no parameter
- USERBOX_CMD_CANCEL - cancel userbox, deletes content in userbox as well
- USERBOX_CMD_START - start userbox, uses date as a string parameter
- USERBOX_CMD_SCREENSHOT - takes photo from AR.Drone, 3 parameter
- delay - delay between each screenshot
- number of burst - # of screenshots
- current date - date of screenshot
- AT command example: AT*CONFIG=605,"userbox:userbox_cmd","0"
- GPS section - GPS:
- CAT_SESSION, read/write
- latitude - GPS Latitude sent by device
- used for media tagging and userbox recording
- AT command example: AT*CONFIG=605,"gps:latitude","4631107791820423168"
- API use example:
double gpsLatitutde = 42.0;
ARDRONE_TOOL-CONFIGURATION_ADDEVENT (latitude, &gpsLatitude, myCallback); - longitude - GPS Longitude sent by device
- used for media tagging and userbox recording
- AT command example: AT*CONFIG=605,"gps:longitude","461107791820423168"
- API use example:
double gpsLongitude = 42.0;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (longitude, &gpsLongitude, myCallback); - altitude - GPS Altitude sent by device
- used for media tagging and userbox recording
- AT command: example: AT*CONFIG=605,"gps:altitude","461107791820423168"
- API use example:
double gpsAltitude = 42.0;
ARDRONE_TOOL_CONFIGURATION_ADDEVENT (altitude, &gpsAltitude, myCallback);
We remembered how you mentioned that the previous group had trouble with flight control and processing time, so we decided to read the latter chapters of the guide. These two chapters a lot of information about the drone in general. We learned how to configure many settings in the drone - not necessarily the flight control or navigation data - and we think that it could help us in the future.
No comments:
Post a Comment