NavData¶
To access navdata:
>>> from pyardrone import ARDrone, at
>>> drone = ARDrone()
>>> drone.navdata_ready.wait() # wait for first navdata
>>> drone.navdata
NavData(checksum=928, cks=Cks(value=928), metadata=Metadata(header=1432778632, state=1333790928, sequence_number=79367, vision_flag=1))
>>> drone.navdata.metadata
Metadata(header=1432778632, state=1333790928, sequence_number=79367, vision_flag=1)
For navdata demo data, according to the Developer Guide from parrot, you have to send an AT*CONFIG command, which is:
>>> drone.send(at.CONFIG('general:navdata_demo', True))
in pyardrone.
And drone.navdata.demo will be available then.
A higher level API for configuring ARDrone will be available in future versions, though.
The NavData Class¶
- exception pyardrone.navdata.ChecksumError[source]¶
Bases:
NavDataError
- exception pyardrone.navdata.IncorrectChecksum[source]¶
Bases:
ChecksumError
- exception pyardrone.navdata.ChecksumNotPresent[source]¶
Bases:
ChecksumError
- exception pyardrone.navdata.InvalidSize[source]¶
Bases:
NavDataError
- class pyardrone.navdata.NavData(buffer)[source]¶
Bases:
SimpleNamespace
Container of navdata options.
NavData of
ARDrone
is available afternavdata_ready
.is_set() isTrue
.You can call
navdata_ready
.wait() to wait for it.To fetch an option:
>>> drone.navdata.demo Demo(altitude=0, ctrl_state=131072, detection_camera_rot=...)
List of navdata Options¶
This module corresponds to ARDroneLib/Soft/Common/navdata_common.h
- class pyardrone.navdata.options.Metadata[source]¶
Header of
NavData
.Available via
NavData
.metadataCorresponds to C struct
navdata_t
.- header¶
Should be 0x55667788
- state¶
raw drone state, see also:
DroneState
- sequence_number¶
- vision_flag¶
- class pyardrone.navdata.options.OptionHeader[source]¶
- tag¶
Structure/Union member
- size¶
Structure/Union member
- class pyardrone.navdata.options.Demo[source]¶
Minimal navigation data for all flights.
Corresponds to C struct
navdata_demo_t
.- ctrl_state¶
Flying state (landed, flying, hovering, etc.) defined in CTRL_STATES enum.
- vbat_flying_percentage¶
battery voltage filtered (mV)
- theta¶
UAV’s pitch in milli-degrees
- phi¶
UAV’s roll in milli-degrees
- psi¶
UAV’s yaw in milli-degrees
- altitude¶
UAV’s altitude in centimeters
- vx¶
UAV’s estimated linear velocity
- vy¶
UAV’s estimated linear velocity
- vz¶
UAV’s estimated linear velocity
- num_frames¶
streamed frame index Not used -> To integrate in video stage.
- detection_camera_rot¶
Deprecated ! Don’t use !
- detection_camera_trans¶
Deprecated ! Don’t use !
- detection_tag_index¶
Deprecated ! Don’t use !
- detection_camera_type¶
Type of tag searched in detection
- drone_camera_rot¶
Deprecated ! Don’t use !
- drone_camera_trans¶
Deprecated ! Don’t use !
- class pyardrone.navdata.options.Time[source]¶
Timestamp
Corresponds to C struct
navdata_time_t
.- time¶
32 bit value where the 11 most significant bits represents the seconds, and the 21 least significant bits are the microseconds.
- class pyardrone.navdata.options.RawMeasures[source]¶
Raw sensors measurements
Corresponds to C struct
navdata_raw_measures_t
.- raw_accs¶
filtered accelerometers
- raw_gyros¶
filtered gyrometers
- raw_gyros_110¶
gyrometers x/y 110 deg/s
- vbat_raw¶
battery voltage raw (mV)
- us_debut_echo¶
Structure/Union member
- us_fin_echo¶
Structure/Union member
- us_association_echo¶
Structure/Union member
- us_distance_echo¶
Structure/Union member
- us_courbe_temps¶
Structure/Union member
- us_courbe_valeur¶
Structure/Union member
- us_courbe_ref¶
Structure/Union member
- flag_echo_ini¶
Structure/Union member
- nb_echo¶
Structure/Union member
- sum_echo¶
Structure/Union member
- alt_temp_raw¶
Structure/Union member
- gradient¶
Structure/Union member
- class pyardrone.navdata.options.PressureRaw[source]¶
Corresponds to C struct
navdata_pressure_raw_t
.- up¶
Structure/Union member
- ut¶
Structure/Union member
- Temperature_meas¶
Structure/Union member
- Pression_meas¶
Structure/Union member
- class pyardrone.navdata.options.Magneto[source]¶
Corresponds to C struct
navdata_magneto_t
.- mx¶
Structure/Union member
- my¶
Structure/Union member
- mz¶
Structure/Union member
- magneto_raw¶
magneto in the body frame, in mG
- magneto_rectified¶
Structure/Union member
- magneto_offset¶
Structure/Union member
- heading_unwrapped¶
Structure/Union member
- heading_gyro_unwrapped¶
Structure/Union member
- heading_fusion_unwrapped¶
Structure/Union member
- magneto_calibration_ok¶
Structure/Union member
- magneto_state¶
Structure/Union member
- magneto_radius¶
Structure/Union member
- error_mean¶
Structure/Union member
- error_var¶
Structure/Union member
- class pyardrone.navdata.options.WindSpeed[source]¶
Corresponds to C struct
navdata_wind_speed_t
.- wind_speed¶
estimated wind speed [m/s]
- wind_angle¶
estimated wind direction in North-East frame [rad] e.g. if wind_angle is pi/4, wind is from South-West to North-East
- wind_compensation_theta¶
Structure/Union member
- wind_compensation_phi¶
Structure/Union member
- state_x1¶
Structure/Union member
- state_x2¶
Structure/Union member
- state_x3¶
Structure/Union member
- state_x4¶
Structure/Union member
- state_x5¶
Structure/Union member
- state_x6¶
Structure/Union member
- magneto_debug1¶
Structure/Union member
- magneto_debug2¶
Structure/Union member
- magneto_debug3¶
Structure/Union member
- class pyardrone.navdata.options.KalmanPressure[source]¶
Corresponds to C struct
navdata_kalman_pressure_t
.- offset_pressure¶
Structure/Union member
- est_z¶
Structure/Union member
- est_zdot¶
Structure/Union member
- est_bias_PWM¶
Structure/Union member
- est_biais_pression¶
Structure/Union member
- offset_US¶
Structure/Union member
- prediction_US¶
Structure/Union member
- cov_alt¶
Structure/Union member
- cov_PWM¶
Structure/Union member
- cov_vitesse¶
Structure/Union member
- bool_effet_sol¶
Structure/Union member
- somme_inno¶
Structure/Union member
- flag_rejet_US¶
Structure/Union member
- u_multisinus¶
Structure/Union member
- gaz_altitude¶
Structure/Union member
- Flag_multisinus¶
Structure/Union member
- Flag_multisinus_debut¶
Structure/Union member
- class pyardrone.navdata.options.Zimmu3000[source]¶
Corresponds to C struct
navdata_zimmu_3000_t
.- vzimmuLSB¶
Structure/Union member
- vzfind¶
Structure/Union member
- class pyardrone.navdata.options.PhysMeasures[source]¶
Corresponds to C struct
navdata_phys_measures_t
.- accs_temp¶
Structure/Union member
- gyro_temp¶
Structure/Union member
- phys_accs¶
Structure/Union member
- phys_gyros¶
Structure/Union member
- alim3V3¶
3.3volt alim [LSB]
- vrefEpson¶
ref volt Epson gyro [LSB]
- vrefIDG¶
ref volt IDG gyro [LSB]
- class pyardrone.navdata.options.GyrosOffsets[source]¶
Corresponds to C struct
navdata_gyros_offsets_t
.- offset_g¶
Structure/Union member
- class pyardrone.navdata.options.EulerAngles[source]¶
Corresponds to C struct
navdata_euler_angles_t
.- theta_a¶
Structure/Union member
- phi_a¶
Structure/Union member
- class pyardrone.navdata.options.References[source]¶
Corresponds to C struct
navdata_references_t
.- ref_theta¶
Structure/Union member
- ref_phi¶
Structure/Union member
- ref_theta_I¶
Structure/Union member
- ref_phi_I¶
Structure/Union member
- ref_pitch¶
Structure/Union member
- ref_roll¶
Structure/Union member
- ref_yaw¶
Structure/Union member
- ref_psi¶
Structure/Union member
- vx_ref¶
Structure/Union member
- vy_ref¶
Structure/Union member
- theta_mod¶
Structure/Union member
- phi_mod¶
Structure/Union member
- k_v_x¶
Structure/Union member
- k_v_y¶
Structure/Union member
- k_mode¶
Structure/Union member
- ui_time¶
Structure/Union member
- ui_theta¶
Structure/Union member
- ui_phi¶
Structure/Union member
- ui_psi¶
Structure/Union member
- ui_psi_accuracy¶
Structure/Union member
- ui_seq¶
Structure/Union member
- class pyardrone.navdata.options.Trims[source]¶
Corresponds to C struct
navdata_trims_t
.- angular_rates_trim_r¶
Structure/Union member
- euler_angles_trim_theta¶
Structure/Union member
- euler_angles_trim_phi¶
Structure/Union member
- class pyardrone.navdata.options.RcReferences[source]¶
Corresponds to C struct
navdata_rc_references_t
.- rc_ref_pitch¶
Structure/Union member
- rc_ref_roll¶
Structure/Union member
- rc_ref_yaw¶
Structure/Union member
- rc_ref_gaz¶
Structure/Union member
- rc_ref_ag¶
Structure/Union member
- class pyardrone.navdata.options.Pwm[source]¶
Corresponds to C struct
navdata_pwm_t
.- motor1¶
Structure/Union member
- motor2¶
Structure/Union member
- motor3¶
Structure/Union member
- motor4¶
Structure/Union member
- sat_motor1¶
Structure/Union member
- sat_motor2¶
Structure/Union member
- sat_motor3¶
Structure/Union member
- sat_motor4¶
Structure/Union member
- gaz_feed_forward¶
Structure/Union member
- gaz_altitude¶
Structure/Union member
- altitude_integral¶
Structure/Union member
- vz_ref¶
Structure/Union member
- u_pitch¶
Structure/Union member
- u_roll¶
Structure/Union member
- u_yaw¶
Structure/Union member
- yaw_u_I¶
Structure/Union member
- u_pitch_planif¶
Structure/Union member
- u_roll_planif¶
Structure/Union member
- u_yaw_planif¶
Structure/Union member
- u_gaz_planif¶
Structure/Union member
- current_motor1¶
Structure/Union member
- current_motor2¶
Structure/Union member
- current_motor3¶
Structure/Union member
- current_motor4¶
Structure/Union member
- altitude_prop¶
Structure/Union member
- altitude_der¶
Structure/Union member
- class pyardrone.navdata.options.Altitude[source]¶
Corresponds to C struct
navdata_altitude_t
.- altitude_vision¶
Structure/Union member
- altitude_vz¶
Structure/Union member
- altitude_ref¶
Structure/Union member
- altitude_raw¶
Structure/Union member
- obs_accZ¶
Structure/Union member
- obs_alt¶
Structure/Union member
- obs_x¶
Structure/Union member
- obs_state¶
Structure/Union member
- est_vb¶
Structure/Union member
- est_state¶
Structure/Union member
- class pyardrone.navdata.options.VisionRaw[source]¶
Corresponds to C struct
navdata_vision_raw_t
.- vision_tx_raw¶
Structure/Union member
- vision_ty_raw¶
Structure/Union member
- vision_tz_raw¶
Structure/Union member
- class pyardrone.navdata.options.Vision[source]¶
Corresponds to C struct
navdata_vision_t
.- vision_state¶
Structure/Union member
- vision_misc¶
Structure/Union member
- vision_phi_trim¶
Structure/Union member
- vision_phi_ref_prop¶
Structure/Union member
- vision_theta_trim¶
Structure/Union member
- vision_theta_ref_prop¶
Structure/Union member
- new_raw_picture¶
Structure/Union member
- theta_capture¶
Structure/Union member
- phi_capture¶
Structure/Union member
- psi_capture¶
Structure/Union member
- altitude_capture¶
Structure/Union member
- time_capture¶
time in TSECDEC format (see config.h)
- body_v¶
Structure/Union member
- delta_phi¶
Structure/Union member
- delta_theta¶
Structure/Union member
- delta_psi¶
Structure/Union member
- gold_defined¶
Structure/Union member
- gold_reset¶
Structure/Union member
- gold_x¶
Structure/Union member
- gold_y¶
Structure/Union member
- class pyardrone.navdata.options.VisionPerf[source]¶
Corresponds to C struct
navdata_vision_perf_t
.- time_szo¶
Structure/Union member
- time_corners¶
Structure/Union member
- time_compute¶
Structure/Union member
- time_tracking¶
Structure/Union member
- time_trans¶
Structure/Union member
- time_update¶
Structure/Union member
- time_custom¶
Structure/Union member
- class pyardrone.navdata.options.TrackersSend[source]¶
Corresponds to C struct
navdata_trackers_send_t
.- locked¶
Structure/Union member
- point¶
Structure/Union member
- class pyardrone.navdata.options.VisionDetect[source]¶
Corresponds to C struct
navdata_vision_detect_t
.- nb_detected¶
Structure/Union member
- type¶
Structure/Union member
- xc¶
Structure/Union member
- yc¶
Structure/Union member
- width¶
Structure/Union member
- height¶
Structure/Union member
- dist¶
Structure/Union member
- orientation_angle¶
Structure/Union member
- rotation¶
Structure/Union member
- translation¶
Structure/Union member
- camera_source¶
Structure/Union member
- class pyardrone.navdata.options.VisionOf[source]¶
Corresponds to C struct
navdata_vision_of_t
.- of_dx¶
Structure/Union member
- of_dy¶
Structure/Union member
- class pyardrone.navdata.options.Watchdog[source]¶
Corresponds to C struct
navdata_watchdog_t
.- watchdog¶
Structure/Union member
- class pyardrone.navdata.options.AdcDataFrame[source]¶
Corresponds to C struct
navdata_adc_data_frame_t
.- version¶
Structure/Union member
- data_frame¶
Structure/Union member
- class pyardrone.navdata.options.VideoStream[source]¶
Corresponds to C struct
navdata_video_stream_t
.- quant¶
quantizer reference used to encode frame [1:31]
- frame_size¶
frame size (bytes)
- frame_number¶
frame index
- atcmd_ref_seq¶
atmcd ref sequence number
- atcmd_mean_ref_gap¶
mean time between two consecutive atcmd_ref (ms)
- atcmd_var_ref_gap¶
Structure/Union member
- atcmd_ref_quality¶
estimator of atcmd link quality
- out_bitrate¶
measured out throughput from the video tcp socket
- desired_bitrate¶
last frame size generated by the video encoder
- data1¶
Structure/Union member
- data2¶
Structure/Union member
- data3¶
Structure/Union member
- data4¶
Structure/Union member
- data5¶
Structure/Union member
- tcp_queue_level¶
Structure/Union member
- fifo_queue_level¶
Structure/Union member
- class pyardrone.navdata.options.HdvideoStream[source]¶
Corresponds to C struct
navdata_hdvideo_stream_t
.- hdvideo_state¶
Structure/Union member
- storage_fifo_nb_packets¶
Structure/Union member
- storage_fifo_size¶
Structure/Union member
- usbkey_size¶
USB key in kbytes - 0 if no key present
- usbkey_freespace¶
USB key free space in kbytes - 0 if no key present
- frame_number¶
‘frame_number’ PaVE field of the frame starting to be encoded for the HD stream
- usbkey_remaining_time¶
time in seconds
- class pyardrone.navdata.options.Games[source]¶
Corresponds to C struct
navdata_games_t
.- double_tap_counter¶
Structure/Union member
- finish_line_counter¶
Structure/Union member