ros2_canopen
master
C++ ROS CANopen Library
|
#include <node_canopen_base_driver.hpp>
Public Member Functions | |
NodeCanopenBaseDriver (NODETYPE *node) | |
virtual | ~NodeCanopenBaseDriver () |
virtual void | init (bool called_from_base) |
Initialises the driver. More... | |
virtual void | configure (bool called_from_base) |
Configure the driver. More... | |
virtual void | activate (bool called_from_base) |
Activates the driver. More... | |
virtual void | deactivate (bool called_from_base) |
Deactivates the driver. More... | |
virtual void | cleanup (bool called_from_base) |
Cleanup the driver. More... | |
virtual void | shutdown (bool called_from_base) |
Shuts down the driver. More... | |
virtual void | add_to_master () |
Add the driver to master. More... | |
virtual void | remove_from_master () |
Remove the driver from master. More... | |
void | register_nmt_state_cb (std::function< void(canopen::NmtState, uint8_t)> nmt_state_cb) |
Register a callback for NMT state change. More... | |
void | register_rpdo_cb (std::function< void(COData, uint8_t)> rpdo_cb) |
Register a callback for RPDO. More... | |
void | register_emcy_cb (std::function< void(COEmcy, uint8_t)> emcy_cb) |
Register a callback for EMCY. More... | |
![]() | |
NodeCanopenDriver (NODETYPE *node) | |
virtual void | set_master (std::shared_ptr< lely::ev::Executor > exec, std::shared_ptr< lely::canopen::AsyncMaster > master) |
Set Master. More... | |
void | init () |
Initialise the driver. More... | |
void | configure () |
Configure the driver. More... | |
void | activate () |
Activate the driver. More... | |
void | deactivate () |
Deactivate the driver. More... | |
void | cleanup () |
Cleanup the driver. More... | |
void | shutdown () |
Shutdown the driver. More... | |
virtual void | demand_set_master () |
Demand set Master. More... | |
![]() | |
NodeCanopenDriverInterface () | |
Protected Member Functions | |
virtual void | poll_timer_callback () |
void | nmt_listener () |
virtual void | on_nmt (canopen::NmtState nmt_state) |
void | rdpo_listener () |
virtual void | on_rpdo (COData data) |
void | emcy_listener () |
virtual void | on_emcy (COEmcy emcy) |
virtual void | diagnostic_callback (diagnostic_updater::DiagnosticStatusWrapper &stat) |
Protected Attributes | |
std::thread | nmt_state_publisher_thread_ |
std::thread | rpdo_publisher_thread_ |
std::thread | emcy_publisher_thread_ |
std::mutex | driver_mutex_ |
std::shared_ptr< ros2_canopen::LelyDriverBridge > | lely_driver_ |
uint32_t | period_ms_ |
int | sdo_timeout_ms_ |
bool | polling_ |
std::function< void(canopen::NmtState, uint8_t)> | nmt_state_cb_ |
std::function< void(COData, uint8_t)> | rpdo_cb_ |
std::function< void(COEmcy, uint8_t)> | emcy_cb_ |
std::shared_ptr< ros2_canopen::SafeQueue< ros2_canopen::COEmcy > > | emcy_queue_ |
std::shared_ptr< ros2_canopen::SafeQueue< ros2_canopen::COData > > | rpdo_queue_ |
rclcpp::TimerBase::SharedPtr | poll_timer_ |
std::atomic< bool > | diagnostic_enabled_ |
uint32_t | diagnostic_period_ms_ |
std::shared_ptr< diagnostic_updater::Updater > | diagnostic_updater_ |
std::shared_ptr< DiagnosticsCollector > | diagnostic_collector_ |
![]() | |
NODETYPE * | node_ |
std::shared_ptr< lely::ev::Executor > | exec_ |
std::shared_ptr< lely::canopen::AsyncMaster > | master_ |
std::shared_ptr< lely::canopen::BasicDriver > | driver_ |
std::chrono::milliseconds | non_transmit_timeout_ |
YAML::Node | config_ |
uint8_t | node_id_ |
std::string | container_name_ |
std::string | eds_ |
std::string | bin_ |
rclcpp::CallbackGroup::SharedPtr | client_cbg_ |
rclcpp::CallbackGroup::SharedPtr | timer_cbg_ |
std::atomic< bool > | master_set_ |
std::atomic< bool > | initialised_ |
std::atomic< bool > | configured_ |
std::atomic< bool > | activated_ |
NodeCanopenBaseDriver::NodeCanopenBaseDriver | ( | NODETYPE * | node | ) |
|
inlinevirtual |
|
protectedvirtual |
Reimplemented in ros2_canopen::node_interfaces::NodeCanopen402Driver< NODETYPE >.
|
protected |
|
protectedvirtual |
Reimplemented in ros2_canopen::node_interfaces::NodeCanopenProxyDriver< NODETYPE >.
|
protected |
|
protectedvirtual |
Reimplemented in ros2_canopen::node_interfaces::NodeCanopenProxyDriver< NODETYPE >.
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Initialises the driver.
This does not do anything, it is an empty function. it should be overridden by derived classes.
called_from_base |
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
Reimplemented in ros2_canopen::node_interfaces::NodeCanopenProxyDriver< NODETYPE >, and ros2_canopen::node_interfaces::NodeCanopen402Driver< NODETYPE >.
|
virtual |
Configure the driver.
This function should be overridden by derived classes.
called_from_base |
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
Reimplemented in ros2_canopen::node_interfaces::NodeCanopen402Driver< NODETYPE >.
|
virtual |
Activates the driver.
This function should be overridden by derived classes.
called_from_base |
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
Reimplemented in ros2_canopen::node_interfaces::NodeCanopen402Driver< NODETYPE >.
|
virtual |
Deactivates the driver.
This function should be overridden by derived classes.
called_from_base |
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
Reimplemented in ros2_canopen::node_interfaces::NodeCanopen402Driver< NODETYPE >.
|
virtual |
Cleanup the driver.
This function should be overridden by derived classes.
called_from_base |
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
|
virtual |
Shuts down the driver.
This function should be overridden by derived classes.
called_from_base |
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
|
virtual |
Add the driver to master.
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
Reimplemented in ros2_canopen::node_interfaces::NodeCanopen402Driver< NODETYPE >.
|
virtual |
Remove the driver from master.
Reimplemented from ros2_canopen::node_interfaces::NodeCanopenDriver< NODETYPE >.
|
inline |
Register a callback for NMT state change.
nmt_state_cb |
|
inline |
Register a callback for RPDO.
rpdo_cb |
|
inline |
Register a callback for EMCY.
emcy_cb |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |