rm_control
Loading...
Searching...
No Matches
rm_referee::Base Class Reference

#include <data.h>

Classes

struct  SerialPortState
 

Public Member Functions

void initSerial (ros::NodeHandle &nh)
 
bool ensurePortOpen (size_t index, const ros::Time &now)
 
void handlePortIoFailure (size_t index, const ros::Time &now, const std::string &action, const std::exception &e)
 
bool isPortFresh (size_t index, const ros::Time &now, const ros::Duration &freshness) const
 
bool isActivePortFresh (const ros::Time &now, const ros::Duration &freshness) const
 
bool shouldProcessPort (size_t index, const ros::Time &now, const ros::Duration &freshness) const
 
void activatePort (size_t index)
 
void markValidFrame (size_t index, const ros::Time &stamp, const ros::Duration &freshness)
 
void refreshOnlineState (const ros::Time &now, const ros::Duration &freshness)
 
bool writeActive (const uint8_t *data, size_t data_len)
 
uint8_t getCRC8CheckSum (unsigned char *pch_message, unsigned int dw_length, unsigned char uc_crc_8)
 
uint32_t verifyCRC8CheckSum (unsigned char *pch_message, unsigned int dw_length)
 
void appendCRC8CheckSum (unsigned char *pch_message, unsigned int dw_length)
 
uint16_t getCRC16CheckSum (uint8_t *pch_message, uint32_t dw_length, uint16_t w_crc)
 
uint32_t verifyCRC16CheckSum (uint8_t *pch_message, uint32_t dw_length)
 
void appendCRC16CheckSum (uint8_t *pch_message, uint32_t dw_length)
 

Public Attributes

std::array< SerialPortState, kMaxSerialPortsserial_ports_ {}
 
size_t serial_port_count_ = 0
 
int active_port_index_ = -1
 
ros::Duration reopen_interval_ { 1.0 }
 
int client_id_ = 0
 
int robot_id_ = 0
 
int capacity_recent_mode_
 
int capacity_expect_mode_
 
std::string robot_color_
 
bool referee_data_is_online_ = false
 

Static Public Attributes

static constexpr size_t kMaxSerialPorts = 2
 

Member Function Documentation

◆ activatePort()

void rm_referee::Base::activatePort ( size_t index)
inline

◆ appendCRC16CheckSum()

void rm_referee::Base::appendCRC16CheckSum ( uint8_t * pch_message,
uint32_t dw_length )
inline

◆ appendCRC8CheckSum()

void rm_referee::Base::appendCRC8CheckSum ( unsigned char * pch_message,
unsigned int dw_length )
inline

◆ ensurePortOpen()

bool rm_referee::Base::ensurePortOpen ( size_t index,
const ros::Time & now )
inline

◆ getCRC16CheckSum()

uint16_t rm_referee::Base::getCRC16CheckSum ( uint8_t * pch_message,
uint32_t dw_length,
uint16_t w_crc )
inline

◆ getCRC8CheckSum()

uint8_t rm_referee::Base::getCRC8CheckSum ( unsigned char * pch_message,
unsigned int dw_length,
unsigned char uc_crc_8 )
inline

◆ handlePortIoFailure()

void rm_referee::Base::handlePortIoFailure ( size_t index,
const ros::Time & now,
const std::string & action,
const std::exception & e )
inline

◆ initSerial()

void rm_referee::Base::initSerial ( ros::NodeHandle & nh)
inline

◆ isActivePortFresh()

bool rm_referee::Base::isActivePortFresh ( const ros::Time & now,
const ros::Duration & freshness ) const
inline

◆ isPortFresh()

bool rm_referee::Base::isPortFresh ( size_t index,
const ros::Time & now,
const ros::Duration & freshness ) const
inline

◆ markValidFrame()

void rm_referee::Base::markValidFrame ( size_t index,
const ros::Time & stamp,
const ros::Duration & freshness )
inline

◆ refreshOnlineState()

void rm_referee::Base::refreshOnlineState ( const ros::Time & now,
const ros::Duration & freshness )
inline

◆ shouldProcessPort()

bool rm_referee::Base::shouldProcessPort ( size_t index,
const ros::Time & now,
const ros::Duration & freshness ) const
inline

◆ verifyCRC16CheckSum()

uint32_t rm_referee::Base::verifyCRC16CheckSum ( uint8_t * pch_message,
uint32_t dw_length )
inline

◆ verifyCRC8CheckSum()

uint32_t rm_referee::Base::verifyCRC8CheckSum ( unsigned char * pch_message,
unsigned int dw_length )
inline

◆ writeActive()

bool rm_referee::Base::writeActive ( const uint8_t * data,
size_t data_len )
inline

Member Data Documentation

◆ active_port_index_

int rm_referee::Base::active_port_index_ = -1

◆ capacity_expect_mode_

int rm_referee::Base::capacity_expect_mode_

◆ capacity_recent_mode_

int rm_referee::Base::capacity_recent_mode_

◆ client_id_

int rm_referee::Base::client_id_ = 0

◆ kMaxSerialPorts

size_t rm_referee::Base::kMaxSerialPorts = 2
staticconstexpr

◆ referee_data_is_online_

bool rm_referee::Base::referee_data_is_online_ = false

◆ reopen_interval_

ros::Duration rm_referee::Base::reopen_interval_ { 1.0 }

◆ robot_color_

std::string rm_referee::Base::robot_color_

◆ robot_id_

int rm_referee::Base::robot_id_ = 0

◆ serial_port_count_

size_t rm_referee::Base::serial_port_count_ = 0

◆ serial_ports_

std::array<SerialPortState, kMaxSerialPorts> rm_referee::Base::serial_ports_ {}

The documentation for this class was generated from the following file: