DUNE: Uniform Navigational Environment
2016.05.0
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onEntityReservation (void) |
void | onResourceAcquisition (void) |
void | onResourceInitialization (void) |
void | onResourceRelease (void) |
void | consume (const IMC::SetThrusterActuation *msg) |
bool | checkSerialPort (void) |
int | setRPM (int motor, int rpm) |
int | checkStateMotor (bool spew_ok) |
void | checkDataMotor (uint8_t id_motor) |
void | stopAllMotor (void) |
void | readParameterAMC (int motor, AmcMessages fname) |
void | dispatchAllData (uint8_t id) |
void | setRpmValues (void) |
void | task (void) |
Public Attributes | |
IMC::Rpm | m_rpm [c_max_motors] |
IMC::Temperature | m_tmp [c_max_motors] |
IMC::Voltage | m_volt [c_max_motors] |
IMC::Current | m_amp [c_max_motors] |
Arguments | m_args |
SerialPort * | m_uart |
Poll | m_poll |
uint8_t | m_buffer [c_max_buffer] |
uint8_t | m_csum [c_max_csum] |
char | m_msg [c_max_buffer] |
Parser * | m_parse |
uint8_t | m_cnt_motor |
double | m_act [c_numb_motor_id] |
uint8_t | m_fail_uart |
Time::Counter< float > | m_cnt_motor_check |
double | m_tstamp |
|
inline |
Constructor.
[in] | name | task name. |
[in] | ctx | context. |
References Actuators::AMC::Arguments::ifactor_orientation, Actuators::AMC::Arguments::ifactor_rpm, m_args, Actuators::AMC::Arguments::motor_elabels, Actuators::AMC::Arguments::motor_state, Actuators::AMC::Arguments::uart_baud, and Actuators::AMC::Arguments::uart_dev.
|
inline |
Request/read all info of motor to AMC board.
References Actuators::AMC::ALL, checkSerialPort(), dispatchAllData(), m_parse, m_poll, m_uart, readParameterAMC(), and Actuators::AMC::Parser::translate().
Referenced by task().
|
inline |
Read data send by AMC board.
References m_buffer, m_parse, m_poll, m_tstamp, m_uart, and Actuators::AMC::Parser::parse().
Referenced by checkDataMotor(), and checkStateMotor().
|
inline |
Check state of motor (Active/Disable)
References checkSerialPort(), m_args, m_fail_uart, Actuators::AMC::Parser::m_motor, m_parse, m_poll, Actuators::AMC::Arguments::motor_state, readParameterAMC(), Actuators::AMC::Parser::AMCMotorState::state, Actuators::AMC::STATE, and Actuators::AMC::Parser::translate().
Referenced by onResourceInitialization(), and task().
|
inline |
Consume message IMC::SetThrusterActuation.
References m_act.
|
inline |
Dispatch rpm value to IMC message.
References Actuators::AMC::Parser::AMCMotorState::current, Actuators::AMC::Arguments::ifactor_orientation, m_amp, m_args, Actuators::AMC::Parser::m_motor, m_parse, m_rpm, m_tmp, m_tstamp, m_volt, Actuators::AMC::Parser::AMCMotorState::rpm, Actuators::AMC::Parser::AMCMotorState::tmp, and Actuators::AMC::Parser::AMCMotorState::volt.
Referenced by checkDataMotor().
|
inline |
Reserve entity identifiers.
References m_amp, m_args, m_rpm, m_tmp, m_volt, Actuators::AMC::Arguments::motor_elabels, and Actuators::AMC::Arguments::motor_state.
|
inline |
Acquire resources.
References m_args, m_uart, Actuators::AMC::Arguments::uart_baud, and Actuators::AMC::Arguments::uart_dev.
|
inline |
Initialize resources.
References checkStateMotor(), m_cnt_motor, m_cnt_motor_check, m_fail_uart, m_parse, m_poll, m_uart, and stopAllMotor().
|
inline |
|
inline |
Requests specific data type.
References Actuators::AMC::ALL, m_csum, m_msg, m_uart, Actuators::AMC::PWR, Actuators::AMC::RPM, Actuators::AMC::STATE, and Actuators::AMC::TEMPERATURE.
Referenced by checkDataMotor(), and checkStateMotor().
|
inline |
Send value of rpm to motor.
References m_csum, m_msg, and m_uart.
Referenced by setRpmValues(), and stopAllMotor().
|
inline |
Set rpm for all motors.
References Actuators::AMC::Arguments::ifactor_orientation, m_act, m_args, Actuators::AMC::Parser::m_motor, m_parse, Actuators::AMC::Arguments::motor_state, setRPM(), and Actuators::AMC::Parser::AMCMotorState::state.
Referenced by task().
|
inline |
Stop all motors.
References m_args, Actuators::AMC::Arguments::motor_state, and setRPM().
Referenced by onResourceInitialization().
|
inline |
double Actuators::AMC::Task::m_act[c_numb_motor_id] |
Values for motors.
Referenced by consume(), and setRpmValues().
IMC::Current Actuators::AMC::Task::m_amp[c_max_motors] |
Current message.
Referenced by dispatchAllData(), and onEntityReservation().
Arguments Actuators::AMC::Task::m_args |
Task arguments.
Referenced by checkStateMotor(), dispatchAllData(), onEntityReservation(), onResourceAcquisition(), setRpmValues(), stopAllMotor(), Task(), and task().
uint8_t Actuators::AMC::Task::m_buffer[c_max_buffer] |
Scratch buffer.
Referenced by checkSerialPort().
uint8_t Actuators::AMC::Task::m_cnt_motor |
Counter stage id motor.
Referenced by onResourceInitialization().
Time::Counter<float> Actuators::AMC::Task::m_cnt_motor_check |
state time to check state of motors
Referenced by onResourceInitialization(), and task().
uint8_t Actuators::AMC::Task::m_csum[c_max_csum] |
CSUM value.
Referenced by readParameterAMC(), and setRPM().
uint8_t Actuators::AMC::Task::m_fail_uart |
count for fail rx uart
Referenced by checkStateMotor(), and onResourceInitialization().
char Actuators::AMC::Task::m_msg[c_max_buffer] |
Buffer for message received.
Referenced by readParameterAMC(), and setRPM().
Parser* Actuators::AMC::Task::m_parse |
Parser for message.
Referenced by checkDataMotor(), checkSerialPort(), checkStateMotor(), dispatchAllData(), onResourceInitialization(), onResourceRelease(), setRpmValues(), and task().
Poll Actuators::AMC::Task::m_poll |
I/O Multiplexer.
Referenced by checkDataMotor(), checkSerialPort(), checkStateMotor(), onResourceInitialization(), and onResourceRelease().
IMC::Rpm Actuators::AMC::Task::m_rpm[c_max_motors] |
Rpm message.
Referenced by dispatchAllData(), and onEntityReservation().
IMC::Temperature Actuators::AMC::Task::m_tmp[c_max_motors] |
Temperature message.
Referenced by dispatchAllData(), and onEntityReservation().
double Actuators::AMC::Task::m_tstamp |
Read timestamp.
Referenced by checkSerialPort(), and dispatchAllData().
SerialPort* Actuators::AMC::Task::m_uart |
Serial port device.
Referenced by checkDataMotor(), checkSerialPort(), onResourceAcquisition(), onResourceInitialization(), onResourceRelease(), readParameterAMC(), and setRPM().
IMC::Voltage Actuators::AMC::Task::m_volt[c_max_motors] |
Voltage message.
Referenced by dispatchAllData(), and onEntityReservation().