Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
ardrone2 navdata aquisition driver. More...
#include "std.h"
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | navdata_measure_t |
Main navdata structure from the navdata board This is received from the navdata board at ~200Hz. More... | |
struct | bmp180_calib_t |
struct | navdata_t |
Macros | |
#define | NAVDATA_PACKET_SIZE 60 |
#define | NAVDATA_START_BYTE 0x3A |
#define | NAVDATA_CMD_START 0x01 |
#define | NAVDATA_CMD_STOP 0x02 |
#define | NAVDATA_CMD_BARO_CALIB 0x17 |
#define | ARDRONE_GPIO_PORT 0x32524 |
#define | ARDRONE_GPIO_PIN_NAVDATA 177 |
Functions | |
bool | navdata_init (void) |
Initialize the navdata board. More... | |
void | navdata_update (void) |
Update the navdata (event loop) More... | |
int16_t | navdata_height (void) |
ssize_t | full_write (int fd, const uint8_t *buf, size_t count) |
Write to fd even while being interrupted. More... | |
ssize_t | full_read (int fd, uint8_t *buf, size_t count) |
Read from fd even while being interrupted. More... | |
Variables | |
struct navdata_t | navdata |
ardrone2 navdata aquisition driver.
The ardrone2 provides a navdata stream of packets containing info about all sensors at a rate of 200Hz.
Definition in file navdata.h.
struct navdata_measure_t |
Main navdata structure from the navdata board This is received from the navdata board at ~200Hz.
Data Fields | ||
---|---|---|
uint16_t | ax | |
uint16_t | ay | |
uint16_t | az | |
uint16_t | chksum | |
uint16_t | flag_echo_ini | |
int16_t | gradient | |
int16_t | mx | |
int16_t | my | |
int16_t | mz | |
uint16_t | nb_echo | |
uint16_t | nu_trame | |
int32_t | pressure | |
uint32_t | sum_echo | |
uint16_t | taille | |
uint16_t | temperature_acc | |
uint16_t | temperature_gyro | |
uint16_t | temperature_pressure | |
uint16_t | ultrasound | |
uint16_t | us_association_echo | |
uint16_t | us_curve_ref | |
uint16_t | us_curve_time | |
uint16_t | us_curve_value | |
uint16_t | us_debut_echo | |
uint16_t | us_distance_echo | |
uint16_t | us_fin_echo | |
int16_t | vx | |
int16_t | vy | |
int16_t | vz |
struct bmp180_calib_t |
struct navdata_t |
Data Fields | ||
---|---|---|
bool | baro_available | Whenever the baro is available. |
bool | baro_calibrated | Whenever the baro is calibrated. |
struct bmp180_calib_t | bmp180_calib | BMP180 calibration receieved from navboard. |
uint32_t | checksum_errors | |
int | fd | The navdata file pointer. |
bool | imu_lost | Whenever the imu is lost. |
bool | is_initialized | Check if the navdata board is initialized. |
uint16_t | last_packet_number | |
uint32_t | lost_imu_frames | |
struct navdata_measure_t | measure | Main navdata packet receieved from navboard. |
uint32_t | packetsRead | |
uint32_t | totalBytesRead |
#define ARDRONE_GPIO_PIN_NAVDATA 177 |
Definition at line 112 of file navdata.h.
Referenced by mag_freeze_check(), and navdata_init().
#define NAVDATA_CMD_BARO_CALIB 0x17 |
Definition at line 109 of file navdata.h.
Referenced by navdata_baro_calib().
#define NAVDATA_CMD_START 0x01 |
Definition at line 107 of file navdata.h.
Referenced by mag_freeze_check(), and navdata_init().
#define NAVDATA_CMD_STOP 0x02 |
Definition at line 108 of file navdata.h.
Referenced by mag_freeze_check(), and navdata_init().
#define NAVDATA_PACKET_SIZE 60 |
Definition at line 105 of file navdata.h.
Referenced by navdata_init(), navdata_read(), and navdata_update().
#define NAVDATA_START_BYTE 0x3A |
Definition at line 106 of file navdata.h.
Referenced by navdata_read().
ssize_t full_read | ( | int | fd, |
uint8_t * | buf, | ||
size_t | count | ||
) |
Read from fd even while being interrupted.
Definition at line 112 of file navdata.c.
Referenced by actuators_ardrone_cmd(), and navdata_baro_calib().
ssize_t full_write | ( | int | fd, |
const uint8_t * | buf, | ||
size_t | count | ||
) |
Write to fd even while being interrupted.
Definition at line 92 of file navdata.c.
Referenced by actuators_ardrone_cmd(), actuators_ardrone_set_leds(), actuators_ardrone_set_pwm(), and navdata_cmd_send().
int16_t navdata_height | ( | void | ) |
bool navdata_init | ( | void | ) |
Initialize the navdata board.
Definition at line 171 of file navdata.c.
References ARDRONE_GPIO_PIN_NAVDATA, ARDRONE_GPIO_PORT, B460800, navdata_t::baro_available, navdata_t::baro_calibrated, navdata_t::checksum_errors, DefaultPeriodic, navdata_t::fd, gpio_set(), gpio_setup_output(), navdata_t::imu_lost, navdata_t::is_initialized, navdata_t::last_packet_number, navdata_t::lost_imu_frames, navdata, navdata_baro_calib(), navdata_cmd_send(), NAVDATA_CMD_START, NAVDATA_CMD_STOP, NAVDATA_PACKET_SIZE, navdata_read(), navdata_t::packetsRead, register_periodic_telemetry(), send_navdata(), and navdata_t::totalBytesRead.
Referenced by imu_ardrone2_init(), and navdata_update().
void navdata_update | ( | void | ) |
Update the navdata (event loop)
Definition at line 343 of file navdata.c.
References AGL_SONAR_ARDRONE2_ID, baro_update_logic(), navdata_t::is_initialized, navdata_t::last_packet_number, navdata_t::lost_imu_frames, mag_freeze_check(), navdata_t::measure, navdata, navdata_init(), NAVDATA_PACKET_SIZE, navdata_publish_imu(), navdata_measure_t::nu_trame, p, navdata_t::packetsRead, navdata_measure_t::pressure, SONAR_OFFSET, SONAR_SCALE, navdata_measure_t::temperature_pressure, and navdata_measure_t::ultrasound.
struct navdata_t navdata |
Definition at line 59 of file navdata.c.
Referenced by ardrone_baro_event(), baro_apply_calibration(), baro_apply_calibration_temp(), baro_update_logic(), mag_freeze_check(), navdata_baro_calib(), navdata_cmd_send(), navdata_init(), navdata_publish_imu(), navdata_read(), navdata_update(), and send_navdata().