MAV'RIC
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
Manual_control Class Reference

The manual control structure. More...

#include <manual_control.hpp>

Collaboration diagram for Manual_control:
Collaboration graph
[legend]

List of all members.

Classes

struct  conf_t
 Configuration for manual control. More...

Public Types

enum  mode_source_t { MODE_SOURCE_REMOTE = 0, MODE_SOURCE_GND_STATION = 1, MODE_SOURCE_JOYSTICK = 2 }
 The source mode enum.
enum  control_source_t { CONTROL_SOURCE_REMOTE = 0, CONTROL_SOURCE_NONE = 1, CONTROL_SOURCE_JOYSTICK = 2 }
 Control source.

Public Member Functions

 Manual_control (Satellite *sat, conf_t config, remote_conf_t remote_config)
 Constructor.
float throttle () const
 Selects the source input and returns the throttle.
float roll () const
 Selects the source input and returns the roll.
float pitch () const
 Selects the source input and returns the pitch.
float yaw () const
 Selects the source input and returns the yaw.
void get_torque_command (torque_command_t &command, float scale_roll=1.0f, float scale_pitch=1.0f, float scale_yaw=1.0f) const
 Compute torque command from the manual input.
void get_rate_command (rate_command_t &command, float scale_roll=1.0f, float scale_pitch=1.0f, float scale_yaw=1.0f) const
 Compute rate command from the manual input.
void get_thrust_command_copter (thrust_command_t &command, float scale=1.0f) const
 Compute thrust command from the manual input.
void get_thrust_command_wing (thrust_command_t &command, float scale=1.0f) const
 Compute thrust command from the manual input.
void get_attitude_command_absolute_yaw (attitude_command_t &command, float scale_roll=1.0f, float scale_pitch=1.0f, float scale_yaw=1.0f) const
 Compute attitude command from the manual input (absolute angles)
void get_attitude_command (attitude_command_t &command, const quat_t &current_attitude, float scale_roll=1.0f, float scale_pitch=1.0f, float scale_yaw=0.5f) const
 Compute attitude command from manual control source (absolute roll and pitch, relative yaw)
void get_attitude_command_vtol (attitude_command_t &command, const quat_t &current_attitude, float reference_pitch, float scale_roll=1.0f, float scale_pitch=1.0f, float scale_yaw=0.25f) const
 Compute attitude command from the manual input (absolute roll and pitch, integrated yaw)
void get_velocity_command_copter (velocity_command_t &command, const quat_t &current_attitude, const velocity_command_t &current_velocity_command, float scale_x=10.0f, float scale_y=10.0f, float scale_z=1.5f, float scale_heading=0.25f) const
 Compute velocity command from the manual input.
Mav_mode get_mode_from_source (Mav_mode mode_current)
 Returns the value of the mode from the desired source input.
void set_mode_of_source (Mav_mode mode_current)
 Sets the internal state of the joystick.
signal_quality_t get_signal_strength ()
 Returns the quality of the strength of the remote receiver.
void set_mode_source (mode_source_t mode_source)
 Set the mode source (which control source can change the mode (remote, joystick, groundstation))
mode_source_t mode_source () const
 Return the mode source (which control source can change the mode (remote, joystick, groundstation))
void set_control_source (control_source_t control_source)
 Set the control source (which control source has control (remote, joystick, none))
control_source_t control_source () const
 Return the control source (which control source has control (remote, joystick, none))

Static Public Member Functions

static conf_t default_config ()

Public Attributes

remote_t remote
 The pointer to the remote structure.
Joystick joystick
 The pointer to the joystick structure.
mode_source_t mode_source_
 The source mode.
control_source_t control_source_
 Flag to tell whether the remote is active or not.

Detailed Description

The manual control structure.


Constructor & Destructor Documentation

Manual_control::Manual_control ( Satellite sat,
conf_t  config,
remote_conf_t  remote_config 
)

Constructor.

Parameters:
configThe pointer to the configuration structure of the module
remote_configThe pointer to the remote structure

Member Function Documentation

Return the control source (which control source has control (remote, joystick, none))

Returns:
control_source which control source has control (remote, joystick, none)

Here is the caller graph for this function:

void Manual_control::get_attitude_command ( attitude_command_t command,
const quat_t current_attitude,
float  scale_roll = 1.0f,
float  scale_pitch = 1.0f,
float  scale_yaw = 0.5f 
) const

Compute attitude command from manual control source (absolute roll and pitch, relative yaw)

Yaw is relative to current yaw (command.yaw = current.yaw + 0.5 * input.yaw)

Parameters:
commandAttitude command (output)
current_attitudeCurrent attitude of the vehicle
scale_rollScale (maximum output / max remote input)
scale_pitchScale (maximum output / max remote input)
scale_yawScale (maximum output / max remote input)
Returns:
command

Here is the call graph for this function:

Here is the caller graph for this function:

void Manual_control::get_attitude_command_absolute_yaw ( attitude_command_t command,
float  scale_roll = 1.0f,
float  scale_pitch = 1.0f,
float  scale_yaw = 1.0f 
) const

Compute attitude command from the manual input (absolute angles)

Parameters:
commandAttitude command (output)
scale_rollScale (maximum output / max remote input)
scale_pitchScale (maximum output / max remote input)
scale_yawScale (maximum output / max remote input)

Here is the call graph for this function:

void Manual_control::get_attitude_command_vtol ( attitude_command_t command,
const quat_t current_attitude,
float  reference_pitch,
float  scale_roll = 1.0f,
float  scale_pitch = 1.0f,
float  scale_yaw = 0.25f 
) const

Compute attitude command from the manual input (absolute roll and pitch, integrated yaw)

Parameters:
commandAttitude command (output)
current_attitudeCurrent attitude of the vehicle
reference_pitchTransition factor (0: forward flight, PI/2:hover)
scale_rollScale (maximum output / max remote input)
scale_pitchScale (maximum output / max remote input)
scale_yawScale (maximum output / max remote input)

Here is the call graph for this function:

Returns the value of the mode from the desired source input.

Parameters:
mode_currentThe current mode of the MAV
Returns:
The value of the mode

Here is the call graph for this function:

Here is the caller graph for this function:

void Manual_control::get_rate_command ( rate_command_t command,
float  scale_roll = 1.0f,
float  scale_pitch = 1.0f,
float  scale_yaw = 1.0f 
) const

Compute rate command from the manual input.

Parameters:
commandRate command (output)
scale_rollScale (maximum output / max remote input)
scale_pitchScale (maximum output / max remote input)
scale_yawScale (maximum output / max remote input)

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the quality of the strength of the remote receiver.

Returns:
The current status of the remote controller

Here is the caller graph for this function:

void Manual_control::get_thrust_command_copter ( thrust_command_t command,
float  scale = 1.0f 
) const

Compute thrust command from the manual input.

Parameters:
commandThrust command (output)
scaleScale

Here is the call graph for this function:

Here is the caller graph for this function:

void Manual_control::get_thrust_command_wing ( thrust_command_t command,
float  scale = 1.0f 
) const

Compute thrust command from the manual input.

Parameters:
commandThrust command (output)
scaleScale

Here is the call graph for this function:

void Manual_control::get_torque_command ( torque_command_t command,
float  scale_roll = 1.0f,
float  scale_pitch = 1.0f,
float  scale_yaw = 1.0f 
) const

Compute torque command from the manual input.

Parameters:
commandTorque command (output)
scale_rollScale (maximum output / max remote input)
scale_pitchScale (maximum output / max remote input)
scale_yawScale (maximum output / max remote input)

Here is the call graph for this function:

void Manual_control::get_velocity_command_copter ( velocity_command_t command,
const quat_t current_attitude,
const velocity_command_t current_velocity_command,
float  scale_x = 10.0f,
float  scale_y = 10.0f,
float  scale_z = 1.5f,
float  scale_heading = 0.25f 
) const

Compute velocity command from the manual input.

Parameters:
commandVelocity command (output)
current_attitudeCurrent attitude of the vehicle
current_velocity_commandCurrent velocity command
scale_xScale (maximum output / max remote input)
scale_yScale (maximum output / max remote input)
scale_zScale (maximum output / max remote input)

Here is the call graph for this function:

Here is the caller graph for this function:

Return the mode source (which control source can change the mode (remote, joystick, groundstation))

Returns:
mode_source which control source can change the mode (remote, joystick, groundstation)

Here is the caller graph for this function:

float Manual_control::pitch ( ) const

Selects the source input and returns the pitch.

Returns:
The value of the thrust depending on the source input

Here is the call graph for this function:

Here is the caller graph for this function:

float Manual_control::roll ( ) const

Selects the source input and returns the roll.

Returns:
The value of the thrust depending on the source input

Here is the call graph for this function:

Here is the caller graph for this function:

void Manual_control::set_control_source ( control_source_t  control_source) [inline]

Set the control source (which control source has control (remote, joystick, none))

Parameters:
control_sourcewhich control source has control (remote, joystick, none)

Here is the call graph for this function:

Sets the internal state of the joystick.

only mode of joystick is overwritten, remote keeps its interal state

Parameters:
mode_currentThe current mode of the MAV

Here is the caller graph for this function:

void Manual_control::set_mode_source ( mode_source_t  mode_source) [inline]

Set the mode source (which control source can change the mode (remote, joystick, groundstation))

Parameters:
mode_sourcewhich control source can change the mode (remote, joystick, groundstation)

Here is the call graph for this function:

float Manual_control::throttle ( ) const

Selects the source input and returns the throttle.

Returns:
The value of the thrust depending on the source input

Here is the call graph for this function:

Here is the caller graph for this function:

float Manual_control::yaw ( ) const

Selects the source input and returns the yaw.

Returns:
The value of the thrust depending on the source input

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines