rm_control
Loading...
Searching...
No Matches
rm_hw::CanBus Class Reference

#include <can_bus.h>

Public Member Functions

 CanBus (const std::string &bus_name, CanDataPtr data_ptr, int thread_priority)
 Initialize device at can_device, retry if fail. Set up header of CAN frame.
 
void read (ros::Time time)
 Read active data from read_buffer_ to data_ptr_, such as position, velocity, torque and so on. Clear read_buffer_ after reading.
 
void write ()
 Write commands to can bus.
 
void write (can_frame *frame)
 

Public Attributes

const std::string bus_name_
 

Constructor & Destructor Documentation

◆ CanBus()

rm_hw::CanBus::CanBus ( const std::string & bus_name,
CanDataPtr data_ptr,
int thread_priority )

Initialize device at can_device, retry if fail. Set up header of CAN frame.

Parameters
bus_nameBus's name(example: can0).
data_ptrPointer which point to CAN data.

Member Function Documentation

◆ read()

void rm_hw::CanBus::read ( ros::Time time)

Read active data from read_buffer_ to data_ptr_, such as position, velocity, torque and so on. Clear read_buffer_ after reading.

Parameters
timeROS time, but it doesn't be used.

◆ write() [1/2]

void rm_hw::CanBus::write ( )

Write commands to can bus.

◆ write() [2/2]

void rm_hw::CanBus::write ( can_frame * frame)

Member Data Documentation

◆ bus_name_

const std::string rm_hw::CanBus::bus_name_

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