.. _program_listing_file__tmp_ws_src_turtlebot3_manipulation_turtlebot3_manipulation_hardware_include_turtlebot3_manipulation_hardware_turtlebot3_manipulation_system.hpp: Program Listing for File turtlebot3_manipulation_system.hpp =========================================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/turtlebot3_manipulation/turtlebot3_manipulation_hardware/include/turtlebot3_manipulation_hardware/turtlebot3_manipulation_system.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2022 ROBOTIS CO., LTD. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Author: Darby Lim #ifndef TURTLEBOT3_MANIPULATION_HARDWARE__TURTLEBOT3_MANIPULATION_SYSTEM_HPP_ #define TURTLEBOT3_MANIPULATION_HARDWARE__TURTLEBOT3_MANIPULATION_SYSTEM_HPP_ #include #include #include #include "hardware_interface/handle.hpp" #include "hardware_interface/hardware_info.hpp" #include "hardware_interface/system_interface.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" #include "rclcpp/clock.hpp" #include "rclcpp/duration.hpp" #include "rclcpp/macros.hpp" #include "rclcpp/time.hpp" #include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp" #include "rclcpp_lifecycle/state.hpp" #include "turtlebot3_manipulation_hardware/opencr.hpp" #include "turtlebot3_manipulation_hardware/visibility_control.h" namespace robotis { namespace turtlebot3_manipulation_hardware { class TurtleBot3ManipulationSystemHardware : public hardware_interface::SystemInterface { public: RCLCPP_SHARED_PTR_DEFINITIONS(TurtleBot3ManipulationSystemHardware); TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC hardware_interface::CallbackReturn on_init( const hardware_interface::HardwareInfo & info) override; TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC std::vector export_state_interfaces() override; TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC std::vector export_command_interfaces() override; TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC hardware_interface::CallbackReturn on_activate( const rclcpp_lifecycle::State & previous_state) override; TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC hardware_interface::CallbackReturn on_deactivate( const rclcpp_lifecycle::State & previous_state) override; TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC hardware_interface::return_type read( const rclcpp::Time & time, const rclcpp::Duration & period) override; TURTLEBOT3_MANIPULATION_HARDWARE_PUBLIC hardware_interface::return_type write( const rclcpp::Time & time, const rclcpp::Duration & period) override; private: uint8_t id_; std::string usb_port_; uint32_t baud_rate_; uint8_t heartbeat_; std::array joints_acceleration_; std::array joints_velocity_; int32_t gripper_acceleration_; int32_t gripper_velocity_; std::unique_ptr opencr_; std::vector dxl_wheel_commands_; std::vector dxl_joint_commands_; std::vector dxl_gripper_commands_; std::vector dxl_positions_; std::vector dxl_velocities_; std::vector opencr_sensor_states_; }; } // namespace turtlebot3_manipulation_hardware } // namespace robotis #endif // TURTLEBOT3_MANIPULATION_HARDWARE__TURTLEBOT3_MANIPULATION_SYSTEM_HPP_