Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators.h File Reference

Actuator driver for ardrone2-raw version. More...

#include <stdint.h>
+ Include dependency graph for actuators.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACTUATORS_ARDRONE_NB   4
 
#define SERVOS_TICS_OF_USEC(_v)   (_v)
 
#define ActuatorArdroneSet(_i, _v)   { actuators_pwm_values[_i] = _v; }
 
#define ActuatorsArdroneCommit()   actuators_ardrone_commit();
 
#define ActuatorsArdroneInit()   actuators_ardrone_init();
 
#define MOT_LEDOFF   0
 
#define MOT_LEDRED   1
 
#define MOT_LEDGREEN   2
 
#define MOT_LEDORANGE   3
 

Functions

void actuators_ardrone_commit (void)
 
void actuators_ardrone_init (void)
 
int actuators_ardrone_cmd (uint8_t cmd, uint8_t *reply, int replylen)
 
void actuators_ardrone_set_pwm (uint16_t pwm0, uint16_t pwm1, uint16_t pwm2, uint16_t pwm3)
 Write motor speed command cmd = 001aaaaa aaaabbbb bbbbbccc ccccccdd ddddddd0. More...
 
void actuators_ardrone_set_leds (uint8_t led0, uint8_t led1, uint8_t led2, uint8_t led3)
 Write LED command cmd = 011rrrr0 000gggg0 (this is ardrone1 format, we need ardrone2 format) More...
 
void actuators_ardrone_close (void)
 

Variables

uint16_t actuators_pwm_values [ACTUATORS_ARDRONE_NB]
 

Detailed Description

Actuator driver for ardrone2-raw version.

Definition in file actuators.h.

Macro Definition Documentation

◆ ActuatorArdroneSet

#define ActuatorArdroneSet (   _i,
  _v 
)    { actuators_pwm_values[_i] = _v; }

Definition at line 42 of file actuators.h.

◆ ACTUATORS_ARDRONE_NB

#define ACTUATORS_ARDRONE_NB   4

Definition at line 37 of file actuators.h.

◆ ActuatorsArdroneCommit

#define ActuatorsArdroneCommit ( )    actuators_ardrone_commit();

Definition at line 43 of file actuators.h.

◆ ActuatorsArdroneInit

#define ActuatorsArdroneInit ( )    actuators_ardrone_init();

Definition at line 44 of file actuators.h.

◆ MOT_LEDGREEN

#define MOT_LEDGREEN   2

Definition at line 48 of file actuators.h.

◆ MOT_LEDOFF

#define MOT_LEDOFF   0

Definition at line 46 of file actuators.h.

◆ MOT_LEDORANGE

#define MOT_LEDORANGE   3

Definition at line 49 of file actuators.h.

◆ MOT_LEDRED

#define MOT_LEDRED   1

Definition at line 47 of file actuators.h.

◆ SERVOS_TICS_OF_USEC

#define SERVOS_TICS_OF_USEC (   _v)    (_v)

Definition at line 40 of file actuators.h.

Function Documentation

◆ actuators_ardrone_close()

void actuators_ardrone_close ( void  )

Definition at line 272 of file actuators.c.

References actuator_ardrone2_fd.

◆ actuators_ardrone_cmd()

int actuators_ardrone_cmd ( uint8_t  cmd,
uint8_t reply,
int  replylen 
)

Definition at line 159 of file actuators.c.

References actuator_ardrone2_fd, full_read(), and full_write().

Referenced by actuators_ardrone_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ actuators_ardrone_commit()

void actuators_ardrone_commit ( void  )

Definition at line 221 of file actuators.c.

References actuators_ardrone_motor_status(), actuators_ardrone_set_pwm(), and actuators_pwm_values.

+ Here is the call graph for this function:

◆ actuators_ardrone_init()

◆ actuators_ardrone_set_leds()

void actuators_ardrone_set_leds ( uint8_t  led0,
uint8_t  led1,
uint8_t  led2,
uint8_t  led3 
)

Write LED command cmd = 011rrrr0 000gggg0 (this is ardrone1 format, we need ardrone2 format)

led0 = RearLeft led1 = RearRight led2 = FrontRight led3 = FrontLeft

Definition at line 255 of file actuators.c.

References actuator_ardrone2_fd, and full_write().

Referenced by actuators_ardrone_init(), and actuators_ardrone_led_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ actuators_ardrone_set_pwm()

void actuators_ardrone_set_pwm ( uint16_t  pwm0,
uint16_t  pwm1,
uint16_t  pwm2,
uint16_t  pwm3 
)

Write motor speed command cmd = 001aaaaa aaaabbbb bbbbbccc ccccccdd ddddddd0.

Definition at line 232 of file actuators.c.

References actuator_ardrone2_fd, actuators_ardrone_led_run(), and full_write().

Referenced by actuators_ardrone_commit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ actuators_pwm_values

uint16_t actuators_pwm_values[ACTUATORS_ARDRONE_NB]
extern

Definition at line 92 of file actuators_pwm_arch.c.

Referenced by actuators_ardrone_commit(), and actuators_pwm_commit().