ros2_canopen  master
C++ ROS CANopen Library
base_driver.hpp
Go to the documentation of this file.
1 // Copyright 2022 Christoph Hellmann Santos
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef CANOPEN_BASE_DRIVER__CANOPEN_BASE_DRIVER_HPP_
15 #define CANOPEN_BASE_DRIVER__CANOPEN_BASE_DRIVER_HPP_
16 
19 
20 namespace ros2_canopen
21 {
29 {
30  std::shared_ptr<node_interfaces::NodeCanopenBaseDriver<rclcpp::Node>> node_canopen_base_driver_;
31 
32 public:
33  BaseDriver(rclcpp::NodeOptions node_options = rclcpp::NodeOptions());
34 
35  void register_nmt_state_cb(std::function<void(canopen::NmtState, uint8_t)> nmt_state_cb)
36  {
37  node_canopen_base_driver_->register_nmt_state_cb(nmt_state_cb);
38  }
39 
40  void register_rpdo_cb(std::function<void(COData, uint8_t)> rpdo_cb)
41  {
42  node_canopen_base_driver_->register_rpdo_cb(rpdo_cb);
43  }
44 };
45 } // namespace ros2_canopen
46 
47 #endif // CANOPEN_BASE_DRIVER__CANOPEN_BASE_DRIVER_HPP_
Abstract Class for a CANopen Device Node.
Definition: base_driver.hpp:29
BaseDriver(rclcpp::NodeOptions node_options=rclcpp::NodeOptions())
void register_rpdo_cb(std::function< void(COData, uint8_t)> rpdo_cb)
Definition: base_driver.hpp:40
void register_nmt_state_cb(std::function< void(canopen::NmtState, uint8_t)> nmt_state_cb)
Definition: base_driver.hpp:35
Canopen Driver.
Definition: driver_node.hpp:105
Definition: configuration_manager.hpp:28
Definition: exchange.hpp:26