.. _program_listing_file_src_ObstacleVisualizer.hpp: Program Listing for File ObstacleVisualizer.hpp =============================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/ObstacleVisualizer.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (C) 2022 Open Source Robotics Foundation * * 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 SRC__NAVGRAPHVISUALIZER_HPP #define SRC__NAVGRAPHVISUALIZER_HPP #include #include #include #include #include #include #include //============================================================================== class ObstacleVisualizer : public rclcpp::Node { public: using ObstaclesMsg = rmf_obstacle_msgs::msg::Obstacles; using ObstacleMsg = rmf_obstacle_msgs::msg::Obstacle; using MarkerMsg = visualization_msgs::msg::Marker; using MarkerArrayMsg = visualization_msgs::msg::MarkerArray; using Color = std_msgs::msg::ColorRGBA; using RvizParamMsg = rmf_visualization_msgs::msg::RvizParam; ObstacleVisualizer( const rclcpp::NodeOptions& options = rclcpp::NodeOptions()); private: void msg_cb(const ObstaclesMsg& msg); Color make_color(float r, float g, float b, float a = 1.0) const; rclcpp::Subscription::SharedPtr _obstacles_sub; rclcpp::Subscription::SharedPtr _param_sub; rclcpp::Publisher::SharedPtr _obstacle_markers_pub; std::string _active_level_name; std::string _global_fixed_frame; }; #endif // SRC__OBSTACLEVISUALZIER_HPP