#include <can_bus.h>
|
| 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. More...
|
|
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. More...
|
|
void | write () |
| Write commands to can bus. More...
|
|
void | write (can_frame *frame) |
|
|
void | frameCallback (const can_frame &frame) |
| This function will be called when CAN bus receive message. It push frame which received into a vector: read_buffer_. More...
|
|
Definition at line 86 of file can_bus.h.
◆ 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_name | Bus's name(example: can0). |
data_ptr | Pointer which point to CAN data. |
Definition at line 75 of file can_bus.cpp.
◆ frameCallback()
void rm_hw::CanBus::frameCallback |
( |
const can_frame & |
frame | ) |
|
|
private |
This function will be called when CAN bus receive message. It push frame which received into a vector: read_buffer_.
- Parameters
-
frame | The frame which socketcan receive. |
Definition at line 301 of file can_bus.cpp.
◆ read()
Read active data from read_buffer_ to data_ptr_, such as position, velocity, torque and so on. Clear read_buffer_ after reading.
- Parameters
-
time | ROS time, but it doesn't be used. |
Definition at line 150 of file can_bus.cpp.
◆ write() [1/2]
void rm_hw::CanBus::write |
( |
| ) |
|
Write commands to can bus.
Definition at line 90 of file can_bus.cpp.
◆ write() [2/2]
void rm_hw::CanBus::write |
( |
can_frame * |
frame | ) |
|
◆ bus_name_
const std::string rm_hw::CanBus::bus_name_ |
◆ data_ptr_
◆ mutex_
std::mutex rm_hw::CanBus::mutex_ |
|
mutableprivate |
◆ read_buffer_
◆ rm_frame0_
can_frame rm_hw::CanBus::rm_frame0_ {} |
|
private |
◆ rm_frame1_
can_frame rm_hw::CanBus::rm_frame1_ {} |
|
private |
◆ socket_can_
The documentation for this class was generated from the following files: