16#ifndef GZ_ROS2_CONTROL__GZ_SYSTEM_HPP_
17#define GZ_ROS2_CONTROL__GZ_SYSTEM_HPP_
24#include "gz_ros2_control/gz_system_interface.hpp"
25#include "rclcpp/duration.hpp"
26#include "rclcpp/node.hpp"
27#include "rclcpp/time.hpp"
28#include "rclcpp_lifecycle/state.hpp"
29#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
31namespace gz_ros2_control
33using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
36class GazeboSimSystemPrivate;
52 CallbackReturn on_configure(
const rclcpp_lifecycle::State & previous_state)
override;
55 std::vector<hardware_interface::StateInterface::ConstSharedPtr>
59 std::vector<hardware_interface::CommandInterface::SharedPtr>
63 CallbackReturn on_activate(
const rclcpp_lifecycle::State & previous_state)
override;
66 CallbackReturn on_deactivate(
const rclcpp_lifecycle::State & previous_state)
override;
70 const std::vector<std::string> & start_interfaces,
71 const std::vector<std::string> & stop_interfaces)
override;
74 hardware_interface::return_type
read(
75 const rclcpp::Time & time,
76 const rclcpp::Duration & period)
override;
79 hardware_interface::return_type
write(
80 const rclcpp::Time & time,
81 const rclcpp::Duration & period)
override;
85 rclcpp::Node::SharedPtr & model_nh,
86 std::map<std::string, sim::Entity> & joints,
88 sim::EntityComponentManager & _ecm,
89 unsigned int update_rate)
override;
99 std::unique_ptr<GazeboSimSystemPrivate> dataPtr;
Definition gz_system_interface.hpp:86
Definition gz_system.hpp:42
std::vector< hardware_interface::StateInterface::ConstSharedPtr > on_export_state_interfaces() override
Definition gz_system.cpp:669
CallbackReturn on_init(const hardware_interface::HardwareComponentInterfaceParams ¶ms) override
Initialization of the hardware interface from data parsed from the robot's URDF.
Definition gz_system.cpp:649
hardware_interface::return_type read(const rclcpp::Time &time, const rclcpp::Duration &period) override
Read the current state values from the hardware.
Definition gz_system.cpp:695
hardware_interface::return_type write(const rclcpp::Time &time, const rclcpp::Duration &period) override
Write the current command values to the hardware.
Definition gz_system.cpp:828
std::vector< hardware_interface::CommandInterface::SharedPtr > on_export_command_interfaces() override
Definition gz_system.cpp:680
hardware_interface::return_type perform_command_mode_switch(const std::vector< std::string > &start_interfaces, const std::vector< std::string > &stop_interfaces) override
Definition gz_system.cpp:791
bool initSim(rclcpp::Node::SharedPtr &model_nh, std::map< std::string, sim::Entity > &joints, const hardware_interface::HardwareInfo &hardware_info, sim::EntityComponentManager &_ecm, unsigned int update_rate) override
Initialize the system interface param[in] model_nh Pointer to the ros2 node param[in] joints Map with...
Definition gz_system.cpp:279
Parameters required for the initialization of a specific hardware component plugin....
Definition hardware_component_interface_params.hpp:32
This structure stores information about hardware defined in a robot's URDF.
Definition hardware_info.hpp:375