Skip to content

Commit 33fc1fe

Browse files
feat: use rviz_2d_overlay_plugins package for OverlayObject class (#29)
* feat: use rviz_2d_overlay_plugins package for OverlayObject class Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp> * style(pre-commit): autofix --------- Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 06a4426 commit 33fc1fe

37 files changed

Lines changed: 43 additions & 1721 deletions

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ endforeach()
2020

2121
set(
2222
display_source_files
23-
src/overlay_utils.cpp
2423
src/mission_details_display.cpp
2524
src/remaining_distance_time_display.cpp
2625
)
@@ -59,6 +58,8 @@ pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
5958
ament_target_dependencies(
6059
${PROJECT_NAME}
6160
PUBLIC
61+
rviz_2d_overlay_plugins
62+
rviz_2d_overlay_msgs
6263
rviz_common
6364
rviz_rendering
6465
autoware_internal_msgs
@@ -67,6 +68,8 @@ ament_target_dependencies(
6768
ament_export_include_directories(include)
6869
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
6970
ament_export_dependencies(
71+
rviz_2d_overlay_plugins
72+
rviz_2d_overlay_msgs
7073
rviz_common
7174
rviz_ogre_vendor
7275
)

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/LICENSE

Lines changed: 0 additions & 12 deletions
This file was deleted.

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ The mission details display is aligned with top right corner of the screen.
2525

2626
Similar to [autoware_overlay_rviz_plugin](../autoware_overlay_rviz_plugin/README.md)
2727

28-
## Credits
29-
30-
Based on the [jsk_visualization](https://github.com/jsk-ros-pkg/jsk_visualization) package.
31-
3228
### Icons
3329

3430
- <https://fonts.google.com/icons?selected=Material+Symbols+Outlined:conversion_path:FILL@1;wght@400;GRAD@200;opsz@20&icon.size=20&icon.color=%23e8eaed&icon.query=path>

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/include/mission_details_display.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
#ifndef MISSION_DETAILS_DISPLAY_HPP_
1616
#define MISSION_DETAILS_DISPLAY_HPP_
1717
#ifndef Q_MOC_RUN
18-
#include "overlay_utils.hpp"
1918
#include "remaining_distance_time_display.hpp"
2019

2120
#include <QImage>
2221
#include <QString>
22+
#include <rviz_2d_overlay_plugins/overlay_utils.hpp>
2323
#include <rviz_common/display.hpp>
2424
#include <rviz_common/properties/color_property.hpp>
2525
#include <rviz_common/properties/float_property.hpp>
@@ -56,7 +56,7 @@ private Q_SLOTS:
5656

5757
private:
5858
std::mutex mutex_;
59-
autoware::mission_details_overlay_rviz_plugin::OverlayObject::SharedPtr overlay_;
59+
rviz_2d_overlay_plugins::OverlayObject::SharedPtr overlay_;
6060
rviz_common::properties::IntProperty * property_width_;
6161
rviz_common::properties::IntProperty * property_height_;
6262
rviz_common::properties::IntProperty * property_right_;

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/include/overlay_utils.hpp

Lines changed: 0 additions & 131 deletions
This file was deleted.

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/include/remaining_distance_time_display.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#ifndef REMAINING_DISTANCE_TIME_DISPLAY_HPP_
1616
#define REMAINING_DISTANCE_TIME_DISPLAY_HPP_
17-
#include "overlay_utils.hpp"
1817

1918
#include <QImage>
2019
#include <QString>

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/package.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
<package format="3">
44
<name>autoware_mission_details_overlay_rviz_plugin</name>
55
<version>0.3.0</version>
6-
<description>
7-
RViz2 plugin for 2D overlays for mission details in the 3D view. Mainly a port of the JSK overlay plugin
8-
(https://github.com/jsk-ros-pkg/jsk_visualization).
9-
</description>
6+
<description>RViz2 plugin for 2D overlays for mission details in the 3D view.</description>
107
<maintainer email="ahmed.ebrahim@leodrive.ai">Ahmed Ebrahim</maintainer>
118

12-
<license>BSD-3-Clause</license>
9+
<license>Apache License 2.0</license>
1310

1411
<depend>autoware_internal_msgs</depend>
1512
<depend>boost</depend>
13+
<depend>rviz_2d_overlay_msgs</depend>
14+
<depend>rviz_2d_overlay_plugins</depend>
1615
<depend>rviz_common</depend>
1716
<depend>rviz_ogre_vendor</depend>
1817
<depend>rviz_rendering</depend>

autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/src/mission_details_display.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
namespace autoware::mission_details_overlay_rviz_plugin
3030
{
31-
3231
MissionDetailsDisplay::MissionDetailsDisplay()
3332
{
3433
property_width_ = new rviz_common::properties::IntProperty(
@@ -59,8 +58,7 @@ void MissionDetailsDisplay::onInitialize()
5958
static int count = 0;
6059
std::stringstream ss;
6160
ss << "MissionDetailsDisplay" << count++;
62-
overlay_ =
63-
std::make_shared<autoware::mission_details_overlay_rviz_plugin::OverlayObject>(ss.str());
61+
overlay_ = std::make_shared<rviz_2d_overlay_plugins::OverlayObject>(ss.str());
6462
overlay_->show();
6563
update_size();
6664

@@ -108,7 +106,7 @@ void MissionDetailsDisplay::update(float wall_dt, float ros_dt)
108106
if (!overlay_) {
109107
return;
110108
}
111-
autoware::mission_details_overlay_rviz_plugin::ScopedPixelBuffer buffer = overlay_->getBuffer();
109+
rviz_2d_overlay_plugins::ScopedPixelBuffer buffer = overlay_->getBuffer();
112110
QImage hud = buffer.getQImage(*overlay_);
113111
hud.fill(Qt::transparent);
114112
draw_widget(hud);
@@ -194,8 +192,9 @@ void MissionDetailsDisplay::update_size()
194192
overlay_->updateTextureSize(property_width_->getInt(), property_height_->getInt());
195193
overlay_->setDimensions(overlay_->getTextureWidth(), overlay_->getTextureHeight());
196194
overlay_->setPosition(
197-
property_right_->getInt(), property_top_->getInt(), HorizontalAlignment::RIGHT,
198-
VerticalAlignment::TOP);
195+
property_right_->getInt(), property_top_->getInt(),
196+
rviz_2d_overlay_plugins::HorizontalAlignment::RIGHT,
197+
rviz_2d_overlay_plugins::VerticalAlignment::TOP);
199198
queueRender();
200199
}
201200

0 commit comments

Comments
 (0)