DUNE: Uniform Navigational Environment  2020.01.0
Actuators::AMC::Task Struct Reference

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]
 
Parserm_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
 

Constructor & Destructor Documentation

Actuators::AMC::Task::Task ( const std::string &  name,
Tasks::Context &  ctx 
)
inline

Member Function Documentation

void Actuators::AMC::Task::checkDataMotor ( uint8_t  id_motor)
inline

Request/read all info of motor to AMC board.

References Actuators::AMC::ALL, and Actuators::AMC::Parser::translate().

bool Actuators::AMC::Task::checkSerialPort ( void  )
inline

Read data send by AMC board.

References Actuators::AMC::Parser::parse().

int Actuators::AMC::Task::checkStateMotor ( bool  spew_ok)
inline
void Actuators::AMC::Task::consume ( const IMC::SetThrusterActuation *  msg)
inline

Consume message IMC::SetThrusterActuation.

void Actuators::AMC::Task::onEntityReservation ( void  )
inline
void Actuators::AMC::Task::onResourceAcquisition ( void  )
inline
void Actuators::AMC::Task::onResourceInitialization ( void  )
inline

Initialize resources.

void Actuators::AMC::Task::onResourceRelease ( void  )
inline

Release resources.

void Actuators::AMC::Task::readParameterAMC ( int  motor,
AmcMessages  fname 
)
inline
int Actuators::AMC::Task::setRPM ( int  motor,
int  rpm 
)
inline

Send value of rpm to motor.

void Actuators::AMC::Task::setRpmValues ( void  )
inline
void Actuators::AMC::Task::stopAllMotor ( void  )
inline

Stop all motors.

References Actuators::AMC::Arguments::motor_state.

void Actuators::AMC::Task::task ( void  )
inline

Member Data Documentation

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.

Arguments Actuators::AMC::Task::m_args

Task arguments.

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.

Parser* Actuators::AMC::Task::m_parse

Parser for message.

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.

Collaboration diagram for Actuators::AMC::Task:
Collaboration graph