.. _program_listing_file_include_ros2_ouster_ouster_driver.hpp: Program Listing for File ouster_driver.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/ros2_ouster/ouster_driver.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2020, Steve Macenski // 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. #ifndef ROS2_OUSTER__OUSTER_DRIVER_HPP_ #define ROS2_OUSTER__OUSTER_DRIVER_HPP_ #include #include #include #include "ros2_ouster/conversions.hpp" #include "ros2_ouster/interfaces/lifecycle_interface.hpp" #include "sensor_msgs/msg/image.hpp" #include "sensor_msgs/msg/point_cloud2.hpp" #include "sensor_msgs/msg/imu.hpp" #include "std_srvs/srv/empty.hpp" #include "ouster_msgs/srv/get_metadata.hpp" #include "tf2_ros/static_transform_broadcaster.h" #include "ros2_ouster/interfaces/configuration.hpp" #include "ros2_ouster/interfaces/data_processor_interface.hpp" namespace ros2_ouster { class SensorInterface; class OusterDriver : public lifecycle_interface::LifecycleInterface { public: using DataProcessorMap = std::multimap; using DataProcessorMapIt = DataProcessorMap::iterator; OusterDriver( std::unique_ptr sensor, const rclcpp::NodeOptions & options); ~OusterDriver(); void onConfigure() override; void onActivate() override; void onDeactivate() override; void onError() override; void onShutdown() override; void onCleanup() override; private: void processData(); void broadcastStaticTransforms(const ros2_ouster::Metadata & mdata); void resetService( const std::shared_ptr/*request_header*/, const std::shared_ptr request, std::shared_ptr response); void getMetadata( const std::shared_ptr/*request_header*/, const std::shared_ptr request, std::shared_ptr response); rclcpp::Service::SharedPtr _reset_srv; rclcpp::Service::SharedPtr _metadata_srv; std::unique_ptr _sensor; std::multimap _data_processors; rclcpp::TimerBase::SharedPtr _process_timer; std::string _laser_sensor_frame, _laser_data_frame, _imu_data_frame; std::unique_ptr _tf_b; bool _use_system_default_qos; bool _use_ros_time; std::uint32_t _os1_proc_mask; }; } // namespace ros2_ouster #endif // ROS2_OUSTER__OUSTER_DRIVER_HPP_