APM:Libraries
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AP_Mount_Servo Class Reference

#include <AP_Mount_Servo.h>

Inheritance diagram for AP_Mount_Servo:
[legend]
Collaboration diagram for AP_Mount_Servo:
[legend]

Public Member Functions

 AP_Mount_Servo (AP_Mount &frontend, AP_Mount::mount_state &state, uint8_t instance)
 
virtual void init (const AP_SerialManager &serial_manager)
 
virtual void update ()
 
virtual bool has_pan_control () const
 
virtual void set_mode (enum MAV_MOUNT_MODE mode)
 
virtual void status_msg (mavlink_channel_t chan)
 
- Public Member Functions inherited from AP_Mount_Backend
 AP_Mount_Backend (AP_Mount &frontend, AP_Mount::mount_state &state, uint8_t instance)
 
virtual ~AP_Mount_Backend (void)
 
virtual void update_fast ()
 
virtual void set_angle_targets (float roll, float tilt, float pan)
 
virtual void set_roi_target (const struct Location &target_loc)
 
virtual void control (int32_t pitch_or_lat, int32_t roll_or_lon, int32_t yaw_or_alt, MAV_MOUNT_MODE mount_mode)
 
virtual void configure_msg (mavlink_message_t *msg)
 
virtual void control_msg (mavlink_message_t *msg)
 
virtual void handle_gimbal_report (mavlink_channel_t chan, mavlink_message_t *msg)
 
virtual void handle_param_value (mavlink_message_t *msg)
 
virtual void send_gimbal_report (mavlink_channel_t chan)
 

Private Member Functions

void check_servo_map ()
 
void stabilize ()
 
int16_t closest_limit (int16_t angle, int16_t angle_min, int16_t angle_max)
 
void move_servo (uint8_t rc, int16_t angle, int16_t angle_min, int16_t angle_max)
 move_servo - moves servo with the given id to the specified angle. all angles are in degrees * 10 More...
 

Private Attributes

struct {
   bool   roll_control:1
 
   bool   tilt_control:1
 
   bool   pan_control:1
 
_flags
 
SRV_Channel::Aux_servo_function_t _roll_idx
 
SRV_Channel::Aux_servo_function_t _tilt_idx
 
SRV_Channel::Aux_servo_function_t _pan_idx
 
SRV_Channel::Aux_servo_function_t _open_idx
 
Vector3f _angle_bf_output_deg
 
uint32_t _last_check_servo_map_ms
 

Additional Inherited Members

- Protected Member Functions inherited from AP_Mount_Backend
void update_targets_from_rc ()
 
int32_t angle_input (RC_Channel *rc, int16_t angle_min, int16_t angle_max)
 
float angle_input_rad (RC_Channel *rc, int16_t angle_min, int16_t angle_max)
 
void calc_angle_to_location (const struct Location &target, Vector3f &angles_to_target_rad, bool calc_tilt, bool calc_pan, bool relative_pan=true)
 
MAV_MOUNT_MODE get_mode (void) const
 
- Protected Attributes inherited from AP_Mount_Backend
AP_Mount_frontend
 
AP_Mount::mount_state_state
 
uint8_t _instance
 
Vector3f _angle_ef_target_rad
 

Detailed Description

Definition at line 14 of file AP_Mount_Servo.h.

Constructor & Destructor Documentation

◆ AP_Mount_Servo()

AP_Mount_Servo::AP_Mount_Servo ( AP_Mount frontend,
AP_Mount::mount_state state,
uint8_t  instance 
)
inline

Definition at line 18 of file AP_Mount_Servo.h.

Here is the call graph for this function:

Member Function Documentation

◆ check_servo_map()

void AP_Mount_Servo::check_servo_map ( )
private

Definition at line 108 of file AP_Mount_Servo.cpp.

Referenced by init(), and update().

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

◆ closest_limit()

int16_t AP_Mount_Servo::closest_limit ( int16_t  angle,
int16_t  angle_min,
int16_t  angle_max 
)
private

Definition at line 170 of file AP_Mount_Servo.cpp.

Referenced by move_servo().

Here is the caller graph for this function:

◆ has_pan_control()

virtual bool AP_Mount_Servo::has_pan_control ( ) const
inlinevirtual

Implements AP_Mount_Backend.

Definition at line 39 of file AP_Mount_Servo.h.

Here is the call graph for this function:

◆ init()

void AP_Mount_Servo::init ( const AP_SerialManager serial_manager)
virtual

Implements AP_Mount_Backend.

Definition at line 6 of file AP_Mount_Servo.cpp.

Referenced by AP_Mount_Servo().

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

◆ move_servo()

void AP_Mount_Servo::move_servo ( uint8_t  rc,
int16_t  angle,
int16_t  angle_min,
int16_t  angle_max 
)
private

move_servo - moves servo with the given id to the specified angle. all angles are in degrees * 10

Definition at line 196 of file AP_Mount_Servo.cpp.

Referenced by update().

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

◆ set_mode()

void AP_Mount_Servo::set_mode ( enum MAV_MOUNT_MODE  mode)
virtual

Implements AP_Mount_Backend.

Definition at line 98 of file AP_Mount_Servo.cpp.

Referenced by has_pan_control().

Here is the caller graph for this function:

◆ stabilize()

void AP_Mount_Servo::stabilize ( )
private

< holds 3 x 3 matrix, var is used as temp in calcs

< Rotation matrix earth to camera. Desired camera from input.

< Rotation matrix from plane to camera. Then Euler angles to the servos.

Definition at line 124 of file AP_Mount_Servo.cpp.

Referenced by update().

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

◆ status_msg()

void AP_Mount_Servo::status_msg ( mavlink_channel_t  chan)
virtual

Reimplemented from AP_Mount_Backend.

Definition at line 116 of file AP_Mount_Servo.cpp.

Referenced by has_pan_control().

Here is the caller graph for this function:

◆ update()

void AP_Mount_Servo::update ( void  )
virtual

Implements AP_Mount_Backend.

Definition at line 26 of file AP_Mount_Servo.cpp.

Referenced by AP_Mount_Servo().

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

Member Data Documentation

◆ _angle_bf_output_deg

Vector3f AP_Mount_Servo::_angle_bf_output_deg
private

Definition at line 75 of file AP_Mount_Servo.h.

Referenced by stabilize(), status_msg(), and update().

◆ _flags

struct { ... } AP_Mount_Servo::_flags

◆ _last_check_servo_map_ms

uint32_t AP_Mount_Servo::_last_check_servo_map_ms
private

Definition at line 77 of file AP_Mount_Servo.h.

Referenced by update().

◆ _open_idx

SRV_Channel::Aux_servo_function_t AP_Mount_Servo::_open_idx
private

Definition at line 73 of file AP_Mount_Servo.h.

Referenced by init(), and update().

◆ _pan_idx

SRV_Channel::Aux_servo_function_t AP_Mount_Servo::_pan_idx
private

Definition at line 72 of file AP_Mount_Servo.h.

Referenced by check_servo_map(), init(), and update().

◆ _roll_idx

SRV_Channel::Aux_servo_function_t AP_Mount_Servo::_roll_idx
private

Definition at line 70 of file AP_Mount_Servo.h.

Referenced by check_servo_map(), init(), and update().

◆ _tilt_idx

SRV_Channel::Aux_servo_function_t AP_Mount_Servo::_tilt_idx
private

Definition at line 71 of file AP_Mount_Servo.h.

Referenced by check_servo_map(), init(), and update().

◆ pan_control

bool AP_Mount_Servo::pan_control

Definition at line 53 of file AP_Mount_Servo.h.

◆ roll_control

bool AP_Mount_Servo::roll_control

Definition at line 51 of file AP_Mount_Servo.h.

◆ tilt_control

bool AP_Mount_Servo::tilt_control

Definition at line 52 of file AP_Mount_Servo.h.


The documentation for this class was generated from the following files: