mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
static_edges_visualization.h
1#ifndef STATIC_EDGES_VISUALIZATION_H
2#define STATIC_EDGES_VISUALIZATION_H
3
4#include "prism.h"
5#include <mrs_lib/safety_zone.h>
6
7#include <visualization_msgs/msg/marker.hpp>
8#include <visualization_msgs/msg/marker_array.hpp>
9#include <geometry_msgs/msg/point.hpp>
10#include <geometry_msgs/msg/transform_stamped.hpp>
12#include <string>
13#include <rclcpp/rclcpp.hpp>
14#include <atomic>
15
16namespace mrs_lib
17{
19
20public:
21 // Represents the prism
22 StaticEdgesVisualization(safety_zone::Prism prism, const std::string &uav_name, const std::string &frame_id, const rclcpp::Node::SharedPtr node,
23 const double &markers_update_rate);
24
25 // Represents corresponding obstacle in the safety_zone.
26 StaticEdgesVisualization(safety_zone::SafetyZone *safety_zone, const int &obstacle_id, const std::string &uav_name, const std::string &frame_id,
27 const rclcpp::Node::SharedPtr node, const double &markers_update_rate);
28
29 // Represents border of the safety_zone.
30 StaticEdgesVisualization(safety_zone::SafetyZone *safety_zone, const std::string &uav_name, const std::string &frame_id, const rclcpp::Node::SharedPtr node,
31 const double &markers_update_rate);
32
34
35 void update() override;
36 void cleanup() override;
37
38private:
39 void init();
40 void sendMarker();
41
42 // It is required for generating static marker names,
43 // because their id's must be unique on topic
44 const int id_;
45 static std::atomic<int> id_generator_;
46
47 safety_zone::Prism prism_;
48 std::string uav_name_;
49 std::string frame_id_;
50 rclcpp::Node::SharedPtr node_;
51
52 // Static markers
55 rclcpp::TimerBase::SharedPtr timer_;
56 static visualization_msgs::msg::MarkerArray last_markers_;
57 visualization_msgs::msg::MarkerArray last_coordinates_;
58
59}; // class StaticEdgesVisualization
60} // namespace mrs_lib
61
62
63#endif
user wrapper of the publisher handler implementation
Definition publisher_handler.h:127
Definition static_edges_visualization.h:18
Definition prism.h:31
Definition safety_zone.h:16
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition attitude_converter.h:24
Defines PublisherHandler and related convenience classes for upgrading the ROS publisher.