ros2_canopen  master
C++ ROS CANopen Library
lifecycle_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_lifecycle::LifecycleNode>>
31  node_canopen_base_driver_;
32 
33 public:
34  LifecycleBaseDriver(rclcpp::NodeOptions node_options = rclcpp::NodeOptions());
35 
36  void register_nmt_state_cb(std::function<void(canopen::NmtState, uint8_t)> nmt_state_cb)
37  {
38  node_canopen_base_driver_->register_nmt_state_cb(nmt_state_cb);
39  }
40 
41  void register_rpdo_cb(std::function<void(COData, uint8_t)> rpdo_cb)
42  {
43  node_canopen_base_driver_->register_rpdo_cb(rpdo_cb);
44  }
45 };
46 } // namespace ros2_canopen
47 
48 #endif // CANOPEN_BASE_DRIVER__CANOPEN_BASE_DRIVER_HPP_
Lifecycle Base Driver.
Definition: lifecycle_base_driver.hpp:29
LifecycleBaseDriver(rclcpp::NodeOptions node_options=rclcpp::NodeOptions())
void register_rpdo_cb(std::function< void(COData, uint8_t)> rpdo_cb)
Definition: lifecycle_base_driver.hpp:41
void register_nmt_state_cb(std::function< void(canopen::NmtState, uint8_t)> nmt_state_cb)
Definition: lifecycle_base_driver.hpp:36
Lifecycle Canopen Driver.
Definition: driver_node.hpp:190
Definition: configuration_manager.hpp:28
Definition: exchange.hpp:26