Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
at_com.h File Reference

Sending and receiving of AT-commands specified by the ardrone API. More...

+ Include dependency graph for at_com.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _navdata_option_t
 
struct  _navdata_t
 
struct  _navdata_cks_t
 
struct  _navdata_demo_t
 
struct  _navdata_phys_measures_t
 
struct  _navdata_gps_t
 

Macros

#define NAVDATA_HEADER   (0x55667788)
 

Typedefs

typedef struct _navdata_option_t navdata_option_t
 
typedef struct _navdata_t navdata_t
 
typedef struct _navdata_cks_t navdata_cks_t
 
typedef struct _navdata_demo_t navdata_demo_t
 
typedef struct
_navdata_phys_measures_t 
navdata_phys_measures_t
 
typedef double float64_t
 
typedef float float32_t
 
typedef struct _navdata_gps_t navdata_gps_t
 

Enumerations

enum  AT_REFS { REF_TAKEOFF = 1U << 9, REF_EMERGENCY = 1U << 8, REF_DEFAULT = 0x11540000 }
 
enum  CTRL_STATES {
  CTRL_DEFAULT, CTRL_INIT, CTRL_LANDED, CTRL_FLYING,
  CTRL_HOVERING, CTRL_TEST, CTRL_TRANS_TAKEOFF, CTRL_TRANS_GOTOFIX,
  CTRL_TRANS_LANDING, CTRL_TRANS_LOOPING, CTRL_NUM_STATES
}
 
enum  ARDRONE_STATES {
  ARDRONE_FLY_MASK = 1U << 0, ARDRONE_VIDEO_MASK = 1U << 1, ARDRONE_VISION_MASK = 1U << 2, ARDRONE_CONTROL_MASK = 1U << 3,
  ARDRONE_ALTITUDE_MASK = 1U << 4, ARDRONE_USER_FEEDBACK_START = 1U << 5, ARDRONE_COMMAND_MASK = 1U << 6, ARDRONE_CAMERA_MASK = 1U << 7,
  ARDRONE_TRAVELLING_MASK = 1U << 8, ARDRONE_USB_MASK = 1U << 9, ARDRONE_NAVDATA_DEMO_MASK = 1U << 10, ARDRONE_NAVDATA_BOOTSTRAP = 1U << 11,
  ARDRONE_MOTORS_MASK = 1U << 12, ARDRONE_COM_LOST_MASK = 1U << 13, ARDRONE_SOFTWARE_FAULT = 1U << 14, ARDRONE_VBAT_LOW = 1U << 15,
  ARDRONE_USER_EL = 1U << 16, ARDRONE_TIMER_ELAPSED = 1U << 17, ARDRONE_MAGNETO_NEEDS_CALIB = 1U << 18, ARDRONE_ANGLES_OUT_OF_RANGE = 1U << 19,
  ARDRONE_WIND_MASK = 1U << 20, ARDRONE_ULTRASOUND_MASK = 1U << 21, ARDRONE_CUTOUT_MASK = 1U << 22, ARDRONE_PIC_VERSION_MASK = 1U << 23,
  ARDRONE_ATCODEC_THREAD_ON = 1U << 24, ARDRONE_NAVDATA_THREAD_ON = 1U << 25, ARDRONE_VIDEO_THREAD_ON = 1U << 26, ARDRONE_ACQ_THREAD_ON = 1U << 27,
  ARDRONE_CTRL_WATCHDOG_MASK = 1U << 28, ARDRONE_ADC_WATCHDOG_MASK = 1U << 29, ARDRONE_COM_WATCHDOG_MASK = 1U << 30, ARDRONE_EMERGENCY_MASK = 1U << 31
}
 

Functions

void init_at_com (void)
 
int at_com_recieve_navdata (unsigned char *buffer)
 
void at_com_send_config (char *key, char *value)
 
void at_com_send_ftrim (void)
 
void at_com_send_ref (int bits)
 
void at_com_send_pcmd (int mode, float thrust, float roll, float pitch, float yaw)
 
void at_com_send_calib (int device)
 

Detailed Description

Sending and receiving of AT-commands specified by the ardrone API.

Definition in file at_com.h.

Macro Definition Documentation

#define NAVDATA_HEADER   (0x55667788)

Definition at line 32 of file at_com.h.

Referenced by ahrs_propagate().

Typedef Documentation

typedef float float32_t

Definition at line 156 of file at_com.h.

typedef double float64_t

Definition at line 155 of file at_com.h.

typedef struct _navdata_cks_t navdata_cks_t
typedef struct _navdata_gps_t navdata_gps_t
typedef struct _navdata_t navdata_t

Enumeration Type Documentation

Enumerator
ARDRONE_FLY_MASK 

FLY MASK : (0) ardrone is landed, (1) ardrone is flying

ARDRONE_VIDEO_MASK 

VIDEO MASK : (0) video disable, (1) video enable

ARDRONE_VISION_MASK 

VISION MASK : (0) vision disable, (1) vision enable

ARDRONE_CONTROL_MASK 

CONTROL ALGO : (0) euler angles control, (1) angular speed control

ARDRONE_ALTITUDE_MASK 

ALTITUDE CONTROL ALGO : (0) altitude control inactive (1) altitude control active

ARDRONE_USER_FEEDBACK_START 

USER feedback : Start button state

ARDRONE_COMMAND_MASK 

Control command ACK : (0) None, (1) one received

ARDRONE_CAMERA_MASK 

CAMERA MASK : (0) camera not ready, (1) Camera ready

ARDRONE_TRAVELLING_MASK 

Travelling mask : (0) disable, (1) enable

ARDRONE_USB_MASK 

USB key : (0) usb key not ready, (1) usb key ready

ARDRONE_NAVDATA_DEMO_MASK 

Navdata demo : (0) All navdata, (1) only navdata demo

ARDRONE_NAVDATA_BOOTSTRAP 

Navdata bootstrap : (0) options sent in all or demo mode, (1) no navdata options sent

ARDRONE_MOTORS_MASK 

Motors status : (0) Ok, (1) Motors problem

ARDRONE_COM_LOST_MASK 

Communication Lost : (1) com problem, (0) Com is ok

ARDRONE_SOFTWARE_FAULT 

Software fault detected - user should land as quick as possible (1)

ARDRONE_VBAT_LOW 

VBat low : (1) too low, (0) Ok

ARDRONE_USER_EL 

User Emergency Landing : (1) User EL is ON, (0) User EL is OFF

ARDRONE_TIMER_ELAPSED 

Timer elapsed : (1) elapsed, (0) not elapsed

ARDRONE_MAGNETO_NEEDS_CALIB 

Magnetometer calibration state : (0) Ok, no calibration needed, (1) not ok, calibration needed

ARDRONE_ANGLES_OUT_OF_RANGE 

Angles : (0) Ok, (1) out of range

ARDRONE_WIND_MASK 

WIND MASK: (0) ok, (1) Too much wind

ARDRONE_ULTRASOUND_MASK 

Ultrasonic sensor : (0) Ok, (1) deaf

ARDRONE_CUTOUT_MASK 

Cutout system detection : (0) Not detected, (1) detected

ARDRONE_PIC_VERSION_MASK 

PIC Version number OK : (0) a bad version number, (1) version number is OK

ARDRONE_ATCODEC_THREAD_ON 

ATCodec thread ON : (0) thread OFF (1) thread ON

ARDRONE_NAVDATA_THREAD_ON 

Navdata thread ON : (0) thread OFF (1) thread ON

ARDRONE_VIDEO_THREAD_ON 

Video thread ON : (0) thread OFF (1) thread ON

ARDRONE_ACQ_THREAD_ON 

Acquisition thread ON : (0) thread OFF (1) thread ON

ARDRONE_CTRL_WATCHDOG_MASK 

CTRL watchdog : (1) delay in control execution (> 5ms), (0) control is well scheduled

ARDRONE_ADC_WATCHDOG_MASK 

ADC Watchdog : (1) delay in uart2 dsr (> 5ms), (0) uart2 is good

ARDRONE_COM_WATCHDOG_MASK 

Communication Watchdog : (1) com problem, (0) Com is ok

ARDRONE_EMERGENCY_MASK 

Emergency landing : (0) no emergency, (1) emergency

Definition at line 57 of file at_com.h.

enum AT_REFS
Enumerator
REF_TAKEOFF 
REF_EMERGENCY 
REF_DEFAULT 

Definition at line 35 of file at_com.h.

Enumerator
CTRL_DEFAULT 
CTRL_INIT 
CTRL_LANDED 
CTRL_FLYING 
CTRL_HOVERING 
CTRL_TEST 
CTRL_TRANS_TAKEOFF 
CTRL_TRANS_GOTOFIX 
CTRL_TRANS_LANDING 
CTRL_TRANS_LOOPING 
CTRL_NUM_STATES 

Definition at line 42 of file at_com.h.

Function Documentation

int at_com_recieve_navdata ( unsigned char *  buffer)

Definition at line 136 of file at_com.c.

References ARDRONE_NAVDATA_BUFFER_SIZE, from, and navdata_socket.

Referenced by ahrs_propagate().

+ Here is the caller graph for this function:

void at_com_send_calib ( int  device)

Definition at line 194 of file at_com.c.

References at_com_send(), and packet_seq.

Referenced by actuators_set().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void at_com_send_config ( char *  key,
char *  value 
)

Definition at line 153 of file at_com.c.

References at_com_send(), packet_seq, and sessionId.

Referenced by actuators_set(), ahrs_init(), and init_at_config().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void at_com_send_ftrim ( void  )

Definition at line 163 of file at_com.c.

References at_com_send(), and packet_seq.

Referenced by ahrs_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void at_com_send_pcmd ( int  mode,
float  thrust,
float  roll,
float  pitch,
float  yaw 
)

Definition at line 177 of file at_com.c.

References at_com_send(), and packet_seq.

Referenced by actuators_set().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void at_com_send_ref ( int  bits)

Definition at line 170 of file at_com.c.

References at_com_send(), packet_seq, and REF_DEFAULT.

Referenced by actuators_set().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void init_at_com ( void  )

Definition at line 55 of file at_com.c.

References ARDRONE_AT_PORT, ARDRONE_IP, ARDRONE_NAVDATA_PORT, at_com_ready, at_socket, init_at_config(), navdata_socket, and TRUE.

Referenced by actuators_init(), and ahrs_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: