dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Camera Stabilization Module

Files

file  camerastab.c
 Stabilize camera against the roll pitch and yaw of aircraft.
 
file  camerastab.h
 Stabilize camera against the roll pitch and yaw of aircraft.
 

Data Structures

struct  CameraStab_data
 

Macros

#define SAMPLE_PERIOD_MS   10
 
#define LOAD_DELAY   7000
 

Enumerations

enum  { ROLL, PITCH, YAW, MAX_AXES }
 

Functions

static void attitudeUpdated (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 
static void settings_updated_cb (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 
static void applyFF (uint8_t index, float dT_ms, float *attitude, CameraStabSettingsData *cameraStab)
 
static void gimbal_can_message ()
 
int32_t CameraStabInitialize (void)
 
int32_t CameraStabStart (void)
 

Variables

static struct CameraStab_datacsd
 

Detailed Description

Macro Definition Documentation

#define LOAD_DELAY   7000

Definition at line 66 of file camerastab.c.

#define SAMPLE_PERIOD_MS   10

Output object: CameraDesired

This module will periodically calculate the output values for stabilizing the camera. It supports controlling the camera an angle specified by the sticks (provided by ManualControlCommand) or at a rate specified by the sticks. Alternatively it can just try and hold the camera at a fixed angle. This module is designed to be used when the flight control is on the airframe of the aircraft. If the controller is placed on the gimbal using the standard stabilization code will work.

Definition at line 65 of file camerastab.c.

Enumeration Type Documentation

anonymous enum
Enumerator
ROLL 
PITCH 
YAW 
MAX_AXES 

Definition at line 69 of file camerastab.c.

Function Documentation

static void applyFF ( uint8_t  index,
float  dT_ms,
float *  attitude,
CameraStabSettingsData *  cameraStab 
)
static

Apply feedforward compensation to the outputs to get a faster response from the servos. This code is separate from the code in the mixer to allow different time constants to be used, although for cameras a time constant of 0 is common. The code tracks the difference in the attitude between calls and adds a scaling of the difference to the accumulated "boost".

Definition at line 333 of file camerastab.c.

static void attitudeUpdated ( const UAVObjEvent ev,
void *  ctx,
void *  obj,
int  len 
)
static

Periodic callback that processes changes in the attitude and recalculates the desied gimbal angle.

Definition at line 183 of file camerastab.c.

int32_t CameraStabInitialize ( void  )

Initialise the module, called on startup

Returns
0 on success or -1 if initialisation failed

Definition at line 104 of file camerastab.c.

int32_t CameraStabStart ( void  )

Definition at line 160 of file camerastab.c.

static void gimbal_can_message ( )
static

Relay control messages to an external gimbal

Definition at line 438 of file camerastab.c.

static void settings_updated_cb ( const UAVObjEvent ev,
void *  ctx,
void *  obj,
int  len 
)
static

Called when the settings are updated to store a local copy

Parameters
[in]evThe update event

Definition at line 365 of file camerastab.c.

Variable Documentation

struct CameraStab_data * csd
static