Autoware.Auto
bounding_box_array_display.hpp
Go to the documentation of this file.
1 // Copyright 2019 the Autoware Foundation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
16 
17 #ifndef OBJECT_DETECTION__BOUNDING_BOX_ARRAY_DISPLAY_HPP_
18 #define OBJECT_DETECTION__BOUNDING_BOX_ARRAY_DISPLAY_HPP_
19 
20 #include <rviz_common/display.hpp>
21 #include <rviz_default_plugins/displays/marker/marker_common.hpp>
22 #include <rviz_default_plugins/displays/marker_array/marker_array_display.hpp>
23 #include <autoware_auto_msgs/msg/bounding_box_array.hpp>
24 #include <visibility_control.hpp>
25 #include <common/types.hpp>
26 #include <memory>
27 
29 
30 namespace autoware
31 {
32 namespace rviz_plugins
33 {
34 
35 class AUTOWARE_RVIZ_PLUGINS_PUBLIC BoundingBoxArrayDisplay
36  : public rviz_common::RosTopicDisplay<autoware_auto_msgs::msg::BoundingBoxArray>
37 {
38 public:
39  using MarkerCommon = rviz_default_plugins::displays::MarkerCommon;
40  using Marker = visualization_msgs::msg::Marker;
43 
45  void onInitialize() override;
46  void load(const rviz_common::Config & config) override;
47  void update(float32_t wall_dt, float32_t ros_dt) override;
48  void reset() override;
49 
50 private:
51  // Convert boxes into markers, push them to the display queue
52  void processMessage(BoundingBoxArray::ConstSharedPtr array) override;
53  // Convert box message to a marker message
54  Marker::SharedPtr get_marker(const BoundingBox & box) const;
55 
56  std::unique_ptr<MarkerCommon> m_marker_common;
57 };
58 } // namespace rviz_plugins
59 } // namespace autoware
60 
61 #endif // OBJECT_DETECTION__BOUNDING_BOX_ARRAY_DISPLAY_HPP_
autoware::rviz_plugins::BoundingBoxArrayDisplay::Marker
visualization_msgs::msg::Marker Marker
Definition: bounding_box_array_display.hpp:40
types.hpp
This file includes common type definition.
autoware::rviz_plugins::BoundingBoxArrayDisplay::BoundingBoxArray
autoware_auto_msgs::msg::BoundingBoxArray BoundingBoxArray
Definition: bounding_box_array_display.hpp:42
BoundingBoxArray
autoware_auto_msgs::msg::BoundingBoxArray BoundingBoxArray
Definition: tf2_autoware_auto_msgs.hpp:35
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::rviz_plugins::BoundingBoxArrayDisplay::MarkerCommon
rviz_default_plugins::displays::MarkerCommon MarkerCommon
Definition: bounding_box_array_display.hpp:39
autoware::rviz_plugins::BoundingBoxArrayDisplay::BoundingBox
autoware_auto_msgs::msg::BoundingBox BoundingBox
Definition: bounding_box_array_display.hpp:41
autoware::common::types::float32_t
float float32_t
Definition: types.hpp:36
BoundingBox
autoware_auto_msgs::msg::BoundingBox BoundingBox
Definition: tf2_autoware_auto_msgs.hpp:36
autoware::rviz_plugins::BoundingBoxArrayDisplay
Definition: bounding_box_array_display.hpp:35