Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
cam_gimbal.h File Reference

Pan/Tilt camera gimbal control. More...

#include "std.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_geodetic_float.h"
+ Include dependency graph for cam_gimbal.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CamGimbal
 

Macros

#define CAM_GIMBAL_MODE_OFF   0
 
#define CAM_GIMBAL_MODE_JOYSTICK   1
 
#define CAM_GIMBAL_MODE_ANGLES   2
 
#define CAM_GIMBAL_MODE_NADIR   3
 
#define CAM_GIMBAL_MODE_TARGET   4
 
#define CAM_GIMBAL_MODE_WAYPOINT   5
 
#define CAM_GIMBAL_MODE_AC_TARGET   6
 
#define CAM_GIMBAL_MODE_NB   7
 
#define cam_gimbal_SetMode(x)   cam_gimbal_set_mode(&cam_gimbal,x)
 
#define cam_gimbal_SetLock(x)   cam_gimbal_set_lock(&cam_gimbal, x)
 
#define cam_gimbal_SetPanCommand(x)   cam_gimbal_set_pan_command(&cam_gimbal, x)
 
#define cam_gimbal_SetTiltCommand(x)   cam_gimbal_set_pan_command(&cam_gimbal, x)
 

Typedefs

typedef void(* cam_angles_from_dir) (struct FloatVect3 dir, float *pan, float *tilt)
 Function pointer to return cam angle from a specified direction.
 

Functions

void cam_gimbal_init (void)
 Init module.
 
void cam_gimbal_periodic (void)
 Periodic call (run control)
 
void cam_gimbal_setup_angles (struct CamGimbal *cam, float pan_max, float pan_min, float tilt_max, float tilt_min)
 
void cam_gimbal_setup_mounting (struct CamGimbal *cam, struct FloatEulers gimbal_to_body, struct FloatVect3 gimbal_pos)
 
void cam_gimbal_set_angles_callback (struct CamGimbal *cam, cam_angles_from_dir compute_angles)
 
void cam_gimbal_run (struct CamGimbal *cam)
 Run camera control.
 
void cam_gimbal_set_mode (struct CamGimbal *cam, uint8_t mode)
 
void cam_gimbal_set_lock (struct CamGimbal *cam, bool lock)
 
void cam_gimbal_set_pan_command (struct CamGimbal *cam, int16_t pan)
 
void cam_gimbal_set_tilt_command (struct CamGimbal *cam, int16_t tilt)
 
void cam_gimbal_set_angles_rad (struct CamGimbal *cam, float pan, float tilt)
 
void cam_gimbal_set_angles_deg (struct CamGimbal *cam, float pan, float tilt)
 
void cam_gimbal_set_target_pos (struct CamGimbal *cam, struct EnuCoor_f target)
 
void cam_gimbal_set_wp_id (struct CamGimbal *cam, uint8_t wp_id)
 
void cam_gimbal_set_ac_id (struct CamGimbal *cam, uint8_t ac_id)
 

Variables

struct CamGimbal cam_gimbal
 

Detailed Description

Pan/Tilt camera gimbal control.

Definition in file cam_gimbal.h.


Data Structure Documentation

◆ CamGimbal

struct CamGimbal

Definition at line 55 of file cam_gimbal.h.

+ Collaboration diagram for CamGimbal:
Data Fields
cam_angles_from_dir compute_angles cam angles from looking direction callback
struct FloatVect3 gimbal_pos position of the gimbal in body NED frame [m]
struct FloatRMat gimbal_to_body rotation matrix from gimbal to body frame
bool lock lock current command
uint8_t mode gimbal control mode
float pan_angle pan angle [rad]
int16_t pan_cmd pan command [pprz]
int16_t pan_joystick pan command from joystick
float pan_max pan angle at maximum command
float pan_min pan angle at minimum command
uint8_t target_ac_id aircraft ID to track
struct EnuCoor_f target_pos target point in ENU world frame [m]
uint8_t target_wp_id waypoint ID to track
float tilt_angle tilt angle [rad]
int16_t tilt_cmd tilt command [pprz]
int16_t tilt_joystick tilt command from joystick
float tilt_max tilt angle at maximum command
float tilt_min tilt angle at minimum command

Macro Definition Documentation

◆ CAM_GIMBAL_MODE_AC_TARGET

#define CAM_GIMBAL_MODE_AC_TARGET   6

Definition at line 41 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_ANGLES

#define CAM_GIMBAL_MODE_ANGLES   2

Definition at line 37 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_JOYSTICK

#define CAM_GIMBAL_MODE_JOYSTICK   1

Definition at line 36 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_NADIR

#define CAM_GIMBAL_MODE_NADIR   3

Definition at line 38 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_NB

#define CAM_GIMBAL_MODE_NB   7

Definition at line 42 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_OFF

#define CAM_GIMBAL_MODE_OFF   0

Definition at line 35 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_TARGET

#define CAM_GIMBAL_MODE_TARGET   4

Definition at line 39 of file cam_gimbal.h.

◆ CAM_GIMBAL_MODE_WAYPOINT

#define CAM_GIMBAL_MODE_WAYPOINT   5

Definition at line 40 of file cam_gimbal.h.

◆ cam_gimbal_SetLock

#define cam_gimbal_SetLock (   x)    cam_gimbal_set_lock(&cam_gimbal, x)

Definition at line 106 of file cam_gimbal.h.

◆ cam_gimbal_SetMode

#define cam_gimbal_SetMode (   x)    cam_gimbal_set_mode(&cam_gimbal,x)

Definition at line 105 of file cam_gimbal.h.

◆ cam_gimbal_SetPanCommand

#define cam_gimbal_SetPanCommand (   x)    cam_gimbal_set_pan_command(&cam_gimbal, x)

Definition at line 107 of file cam_gimbal.h.

◆ cam_gimbal_SetTiltCommand

#define cam_gimbal_SetTiltCommand (   x)    cam_gimbal_set_pan_command(&cam_gimbal, x)

Definition at line 108 of file cam_gimbal.h.

Typedef Documentation

◆ cam_angles_from_dir

typedef void(* cam_angles_from_dir) (struct FloatVect3 dir, float *pan, float *tilt)

Function pointer to return cam angle from a specified direction.

The direction is the unit vector from the camera position to the target expressed in the gimbal frame. The resulting angles depends on the type of gimbal that is used, in particular the number and order of rotations. This function is provided by the user as it is specific to each mounting. It returns the pan and tilt angles.

Definition at line 53 of file cam_gimbal.h.

Function Documentation

◆ cam_gimbal_init()

◆ cam_gimbal_periodic()

void cam_gimbal_periodic ( void  )
extern

Periodic call (run control)

Definition at line 355 of file cam_gimbal.c.

References cam_gimbal, cam_gimbal_run(), foo, CamGimbal::pan_cmd, and CamGimbal::tilt_cmd.

+ Here is the call graph for this function:

◆ cam_gimbal_run()

◆ cam_gimbal_set_ac_id()

void cam_gimbal_set_ac_id ( struct CamGimbal cam,
uint8_t  ac_id 
)
extern

Definition at line 286 of file cam_gimbal.c.

References foo.

◆ cam_gimbal_set_angles_callback()

void cam_gimbal_set_angles_callback ( struct CamGimbal cam,
cam_angles_from_dir  compute_angles 
)
extern

Definition at line 229 of file cam_gimbal.c.

References foo.

Referenced by cam_gimbal_init(), and gimbal_caddx_gm3_init().

+ Here is the caller graph for this function:

◆ cam_gimbal_set_angles_deg()

void cam_gimbal_set_angles_deg ( struct CamGimbal cam,
float  pan,
float  tilt 
)
extern

Definition at line 266 of file cam_gimbal.c.

References foo.

◆ cam_gimbal_set_angles_rad()

void cam_gimbal_set_angles_rad ( struct CamGimbal cam,
float  pan,
float  tilt 
)
extern

Definition at line 258 of file cam_gimbal.c.

References foo.

◆ cam_gimbal_set_lock()

void cam_gimbal_set_lock ( struct CamGimbal cam,
bool  lock 
)
extern

Definition at line 243 of file cam_gimbal.c.

References foo.

◆ cam_gimbal_set_mode()

void cam_gimbal_set_mode ( struct CamGimbal cam,
uint8_t  mode 
)
extern

Definition at line 234 of file cam_gimbal.c.

References CAM_GIMBAL_MODE_NB, CAM_GIMBAL_MODE_OFF, foo, and mode.

◆ cam_gimbal_set_pan_command()

void cam_gimbal_set_pan_command ( struct CamGimbal cam,
int16_t  pan 
)
extern

Definition at line 248 of file cam_gimbal.c.

References foo, and TRIM_PPRZ.

Referenced by cam_gimbal_joystick(), and cam_gimbal_run().

+ Here is the caller graph for this function:

◆ cam_gimbal_set_target_pos()

void cam_gimbal_set_target_pos ( struct CamGimbal cam,
struct EnuCoor_f  target 
)
extern

Definition at line 274 of file cam_gimbal.c.

References foo, and target.

Referenced by cam_gimbal_nadir(), and cam_gimbal_waypoint_target().

+ Here is the caller graph for this function:

◆ cam_gimbal_set_tilt_command()

void cam_gimbal_set_tilt_command ( struct CamGimbal cam,
int16_t  tilt 
)
extern

Definition at line 253 of file cam_gimbal.c.

References foo, and TRIM_PPRZ.

Referenced by cam_gimbal_joystick().

+ Here is the caller graph for this function:

◆ cam_gimbal_set_wp_id()

void cam_gimbal_set_wp_id ( struct CamGimbal cam,
uint8_t  wp_id 
)
extern

Definition at line 279 of file cam_gimbal.c.

References foo, and nb_waypoint.

◆ cam_gimbal_setup_angles()

void cam_gimbal_setup_angles ( struct CamGimbal cam,
float  pan_max,
float  pan_min,
float  tilt_max,
float  tilt_min 
)
extern

Definition at line 211 of file cam_gimbal.c.

References foo.

Referenced by cam_gimbal_init(), and gimbal_caddx_gm3_init().

+ Here is the caller graph for this function:

◆ cam_gimbal_setup_mounting()

void cam_gimbal_setup_mounting ( struct CamGimbal cam,
struct FloatEulers  gimbal_to_body,
struct FloatVect3  gimbal_pos 
)
extern

Definition at line 221 of file cam_gimbal.c.

References float_rmat_of_eulers, and foo.

Referenced by cam_gimbal_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ cam_gimbal

struct CamGimbal cam_gimbal
extern