DUNE: Uniform Navigational Environment
2019.02.1
|
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, 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, and Actuators::AMC::Parser::translate().
|
inline |
Read data send by AMC board.
References Actuators::AMC::Parser::parse().
|
inline |
Check state of motor (Active/Disable)
References Actuators::AMC::Parser::m_motor, Actuators::AMC::Arguments::motor_state, Actuators::AMC::Parser::AMCMotorState::state, Actuators::AMC::STATE, and Actuators::AMC::Parser::translate().
|
inline |
Consume message IMC::SetThrusterActuation.
|
inline |
Dispatch rpm value to IMC message.
References Actuators::AMC::Parser::AMCMotorState::current, Actuators::AMC::Arguments::ifactor_orientation, Actuators::AMC::Parser::m_motor, Actuators::AMC::Parser::AMCMotorState::rpm, Actuators::AMC::Parser::AMCMotorState::tmp, and Actuators::AMC::Parser::AMCMotorState::volt.
|
inline |
Reserve entity identifiers.
References Actuators::AMC::Arguments::motor_elabels, and Actuators::AMC::Arguments::motor_state.
|
inline |
Acquire resources.
References Actuators::AMC::Arguments::uart_baud, and Actuators::AMC::Arguments::uart_dev.
|
inline |
Initialize resources.
|
inline |
Release resources.
|
inline |
Requests specific data type.
References Actuators::AMC::ALL, Actuators::AMC::PWR, Actuators::AMC::RPM, Actuators::AMC::STATE, and Actuators::AMC::TEMPERATURE.
|
inline |
Send value of rpm to motor.
|
inline |
Set rpm for all motors.
References Actuators::AMC::Arguments::ifactor_orientation, Actuators::AMC::Parser::m_motor, Actuators::AMC::Arguments::motor_state, and Actuators::AMC::Parser::AMCMotorState::state.
|
inline |
Stop all motors.
References Actuators::AMC::Arguments::motor_state.
|
inline |
Main loop.
References Actuators::AMC::Parser::m_motor, Actuators::AMC::Arguments::motor_state, and Actuators::AMC::Parser::AMCMotorState::state.
double Actuators::AMC::Task::m_act[c_numb_motor_id] |
Values for motors.
IMC::Current Actuators::AMC::Task::m_amp[c_max_motors] |
Current message.
uint8_t Actuators::AMC::Task::m_buffer[c_max_buffer] |
Scratch buffer.
uint8_t Actuators::AMC::Task::m_cnt_motor |
Counter stage id motor.
Time::Counter<float> Actuators::AMC::Task::m_cnt_motor_check |
state time to check state of motors
uint8_t Actuators::AMC::Task::m_csum[c_max_csum] |
CSUM value.
uint8_t Actuators::AMC::Task::m_fail_uart |
count for fail rx uart
char Actuators::AMC::Task::m_msg[c_max_buffer] |
Buffer for message received.
Poll Actuators::AMC::Task::m_poll |
I/O Multiplexer.
IMC::Rpm Actuators::AMC::Task::m_rpm[c_max_motors] |
Rpm message.
IMC::Temperature Actuators::AMC::Task::m_tmp[c_max_motors] |
Temperature message.
double Actuators::AMC::Task::m_tstamp |
Read timestamp.
SerialPort* Actuators::AMC::Task::m_uart |
Serial port device.
IMC::Voltage Actuators::AMC::Task::m_volt[c_max_motors] |
Voltage message.