MAV'RIC
|
Base class for cascade style controller hierarchy. More...
#include <flight_controller_stack.hpp>
Public Types | |
typedef Controller < position_command_t, velocity_command_t > | pos_ctrl_t |
Alias for required type of position controller. | |
typedef Controller_1_to_2 < velocity_command_t, attitude_command_t, thrust_command_t > | vel_ctrl_t |
Alias for required type of velocity controller. | |
typedef Controller < attitude_command_t, rate_command_t > | att_ctrl_t |
Alias for required type of attitude controller. | |
typedef Controller < rate_command_t, torque_command_t > | rate_ctrl_t |
Alias for required type of rate controller. | |
typedef Servos_mix | mix_ctrl_t |
Alias for required type of servo mixing controller. | |
Public Member Functions | |
Flight_controller_stack (pos_ctrl_t &pos_ctrl, vel_ctrl_t &vel_ctrl, att_ctrl_t &att_ctrl, rate_ctrl_t &rate_ctrl, mix_ctrl_t &mix_ctrl) | |
Constructor. | |
virtual bool | update (void) |
Main update function. | |
bool | failsafe (void) |
Sets actuators in safety mode. | |
bool | set_command (const position_command_t &position) |
Set of command setters. | |
bool | set_command (const velocity_command_t &velocity) |
Sets the input command. | |
bool | set_command (const attitude_command_t &attitude) |
Sets the input command. | |
bool | set_command (const rate_command_t &rate) |
Sets the input command. | |
bool | set_command (const torque_command_t &torque) |
Sets the input command. | |
bool | set_command (const thrust_command_t &thrust) |
Sets the input command. | |
bool | get_command (position_command_t &position) const |
Set of command getters. | |
bool | get_command (velocity_command_t &velocity) const |
Returns the input command. | |
bool | get_command (attitude_command_t &attitude) const |
Returns the input command. | |
bool | get_command (rate_command_t &rate) const |
Returns the input command. | |
bool | get_command (torque_command_t &torque) const |
Returns the input command. | |
bool | get_command (thrust_command_t &thrust) const |
Returns the input command. | |
bool | get_output (empty_command_t &command) const |
Returns the output command. | |
Protected Member Functions | |
bool | update_in_thrust_and_torque_mode (void) |
Main update function when in thrust + torque mode. | |
bool | update_in_thrust_and_rate_mode (void) |
Main update function when in thrust + rate mode. | |
bool | update_in_thrust_and_attitude_mode (void) |
Main update function when in thrust + attitude mode. | |
bool | update_in_velocity_mode (void) |
Main update function when in velocity mode. | |
bool | update_in_position_mode (void) |
Main update function when in position mode. | |
Protected Attributes | |
command_t | command_ |
Flight commands. |
Base class for cascade style controller hierarchy.
Flight_controller_stack::Flight_controller_stack | ( | pos_ctrl_t & | pos_ctrl, |
vel_ctrl_t & | vel_ctrl, | ||
att_ctrl_t & | att_ctrl, | ||
rate_ctrl_t & | rate_ctrl, | ||
mix_ctrl_t & | mix_ctrl | ||
) |
Constructor.
pos_ctrl | Reference to the position controller |
vel_ctrl | Reference to the velocity controller |
att_ctrl | Reference to the attitude controller |
rate_ctrl | Reference to the rate controller |
mix_ctrl | Reference to the mixing controller |
bool Flight_controller_stack::get_command | ( | velocity_command_t & | command | ) | const [virtual] |
Returns the input command.
command | Input command |
Implements Controller< velocity_command_t >.
bool Flight_controller_stack::get_command | ( | attitude_command_t & | command | ) | const [virtual] |
Returns the input command.
command | Input command |
Implements Controller< attitude_command_t >.
bool Flight_controller_stack::get_command | ( | rate_command_t & | command | ) | const [virtual] |
Returns the input command.
command | Input command |
Implements Controller< rate_command_t >.
bool Flight_controller_stack::get_command | ( | torque_command_t & | command | ) | const [virtual] |
Returns the input command.
command | Input command |
Implements Controller< torque_command_t >.
bool Flight_controller_stack::get_command | ( | thrust_command_t & | command | ) | const [virtual] |
Returns the input command.
command | Input command |
Implements Controller< thrust_command_t >.
bool Flight_controller_stack::get_output | ( | empty_command_t & | command | ) | const [virtual] |
Returns the output command.
command | output command |
Implements Controller< torque_command_t >.
bool Flight_controller_stack::set_command | ( | const position_command_t & | position | ) | [virtual] |
Set of command setters.
Based on the type of the provided command, the control mode will be changed and used in following calls to update
Implements Flight_controller.
bool Flight_controller_stack::set_command | ( | const velocity_command_t & | command | ) | [virtual] |
Sets the input command.
command | Input command |
Implements Flight_controller.
bool Flight_controller_stack::set_command | ( | const attitude_command_t & | command | ) | [virtual] |
Sets the input command.
command | Input command |
Implements Flight_controller.
bool Flight_controller_stack::set_command | ( | const rate_command_t & | command | ) | [virtual] |
Sets the input command.
command | Input command |
Implements Flight_controller.
bool Flight_controller_stack::set_command | ( | const torque_command_t & | command | ) | [virtual] |
Sets the input command.
command | Input command |
Implements Flight_controller.
bool Flight_controller_stack::set_command | ( | const thrust_command_t & | command | ) | [virtual] |
Sets the input command.
command | Input command |
Implements Flight_controller.
bool Flight_controller_stack::update | ( | void | ) | [virtual] |
Main update function.
Updates recursively the layers of control. The highest active layer is determined by the type of the last command
Implements Flight_controller.