Skip to content

Commit a058960

Browse files
Ahmed Ebrahimahmeddesokyebrahim
Ahmed Ebrahim
authored andcommitted
feat(remaining_dist_eta): add visualization overlay for mission details display, remaining distance, and remaining time.
Signed-off-by: Ahmed Ebrahim <ahmed.ebrahim@leodrive.ai>
1 parent 6d14a22 commit a058960

25 files changed

+2042
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(autoware_mission_details_overlay_rviz_plugin)
3+
4+
# find dependencies
5+
find_package(ament_cmake_auto REQUIRED)
6+
find_package(ament_cmake REQUIRED)
7+
find_package(autoware_auto_vehicle_msgs REQUIRED)
8+
find_package(tier4_planning_msgs REQUIRED)
9+
find_package(autoware_perception_msgs REQUIRED)
10+
find_package(autoware_planning_msgs REQUIRED)
11+
ament_auto_find_build_dependencies()
12+
13+
find_package(autoware_overlay_msgs REQUIRED)
14+
15+
find_package(rviz_common REQUIRED)
16+
find_package(rviz_rendering REQUIRED)
17+
find_package(rviz_ogre_vendor REQUIRED)
18+
find_package(std_msgs REQUIRED)
19+
20+
set(
21+
headers_to_moc
22+
include/overlay_text_display.hpp
23+
include/mission_details_display.hpp
24+
25+
)
26+
27+
set(
28+
headers_to_not_moc
29+
include/remaining_distance_time_display.hpp
30+
)
31+
32+
33+
34+
foreach(header "${headers_to_moc}")
35+
qt5_wrap_cpp(display_moc_files "${header}")
36+
endforeach()
37+
38+
set(
39+
display_source_files
40+
src/overlay_text_display.cpp
41+
src/overlay_utils.cpp
42+
src/mission_details_display.cpp
43+
src/remaining_distance_time_display.cpp
44+
45+
)
46+
47+
add_library(
48+
${PROJECT_NAME} SHARED
49+
${display_moc_files}
50+
${headers_to_not_moc}
51+
${display_source_files}
52+
)
53+
54+
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
55+
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
56+
57+
target_include_directories(
58+
${PROJECT_NAME} PUBLIC
59+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
60+
$<INSTALL_INTERFACE:include>
61+
${Qt5Widgets_INCLUDE_DIRS}
62+
${OpenCV_INCLUDE_DIRS}
63+
)
64+
65+
target_link_libraries(
66+
${PROJECT_NAME} PUBLIC
67+
rviz_ogre_vendor::OgreMain
68+
rviz_ogre_vendor::OgreOverlay
69+
)
70+
71+
72+
target_compile_definitions(${PROJECT_NAME} PRIVATE "${PROJECT_NAME}_BUILDING_LIBRARY")
73+
74+
# prevent pluginlib from using boost
75+
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
76+
77+
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
78+
79+
ament_target_dependencies(
80+
${PROJECT_NAME}
81+
PUBLIC
82+
rviz_common
83+
rviz_rendering
84+
autoware_overlay_msgs
85+
autoware_auto_vehicle_msgs
86+
tier4_planning_msgs
87+
autoware_perception_msgs
88+
)
89+
90+
ament_export_include_directories(include)
91+
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
92+
ament_export_dependencies(
93+
rviz_common
94+
rviz_ogre_vendor
95+
)
96+
97+
if(BUILD_TESTING)
98+
find_package(ament_lint_auto REQUIRED)
99+
ament_lint_auto_find_test_dependencies()
100+
endif()
101+
102+
install(
103+
TARGETS ${PROJECT_NAME}
104+
EXPORT ${PROJECT_NAME}
105+
ARCHIVE DESTINATION lib
106+
LIBRARY DESTINATION lib
107+
RUNTIME DESTINATION bin
108+
INCLUDES DESTINATION include
109+
)
110+
111+
install(
112+
DIRECTORY include/
113+
DESTINATION include
114+
)
115+
116+
install(
117+
TARGETS
118+
DESTINATION lib/${PROJECT_NAME}
119+
)
120+
121+
# Copy the assets directory to the installation directory
122+
install(
123+
DIRECTORY assets/
124+
DESTINATION share/${PROJECT_NAME}/assets
125+
)
126+
127+
add_definitions(-DQT_NO_KEYWORDS)
128+
129+
ament_package(
130+
CONFIG_EXTRAS "autoware_mission_details_overlay_rviz_plugin-extras.cmake"
131+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2022, Team Spatzenhirn
2+
Copyright (c) 2014, JSK Lab
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# autoware_overlay_rviz_plugin
2+
3+
Plugin for displaying 2D overlays over the RViz2 3D scene.
4+
5+
Based on the [jsk_visualization](https://github.com/jsk-ros-pkg/jsk_visualization)
6+
package, under the 3-Clause BSD license.
7+
8+
## Purpose
9+
10+
This plugin provides a visual and easy-to-understand display of vehicle speed, turn signal, steering status and gears.
11+
12+
## Inputs / Outputs
13+
14+
### Input
15+
16+
| Name | Type | Description |
17+
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------ |
18+
| `/vehicle/status/velocity_status` | `autoware_auto_vehicle_msgs::msg::VelocityReport` | The topic is vehicle velocity |
19+
| `/vehicle/status/turn_indicators_status` | `autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport` | The topic is status of turn signal |
20+
| `/vehicle/status/hazard_status` | `autoware_auto_vehicle_msgs::msg::HazardReport` | The topic is status of hazard |
21+
| `/vehicle/status/steering_status` | `autoware_auto_vehicle_msgs::msg::SteeringReport` | The topic is status of steering |
22+
| `/vehicle/status/gear_status` | `autoware_auto_vehicle_msgs::msg::GearReport` | The topic is status of gear |
23+
| `/planning/scenario_planning/current_max_velocity` | `tier4_planning_msgs::msg::VelocityLimit` | The topic is velocity limit |
24+
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficSignalArray` | The topic is status of traffic light |
25+
26+
## Parameter
27+
28+
### Core Parameters
29+
30+
#### SignalDisplay
31+
32+
| Name | Type | Default Value | Description |
33+
| ------------------------ | ------ | -------------------- | --------------------------------- |
34+
| `property_width_` | int | 128 | Width of the plotter window [px] |
35+
| `property_height_` | int | 128 | Height of the plotter window [px] |
36+
| `property_left_` | int | 128 | Left of the plotter window [px] |
37+
| `property_top_` | int | 128 | Top of the plotter window [px] |
38+
| `property_signal_color_` | QColor | QColor(25, 255, 240) | Turn Signal color |
39+
40+
## Assumptions / Known limits
41+
42+
TBD.
43+
44+
## Usage
45+
46+
1. Start `rviz2` and click `Add` button under the `Displays` panel.
47+
48+
![select_add](./assets/images/select_add.png)
49+
50+
2. Under `By display type` tab, select `autoware_overlay_rviz_plugin/SignalDisplay` and press OK.
51+
52+
3. Enter the names of the topics if necessary.
53+
54+
![select_topic_name](./assets/images/select_topic_name.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2011 The Quicksand Project Authors (https://github.com/andrew-paglinawan/QuicksandFamily), with Reserved Font Name “Quicksand”.
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2021, Open Source Robotics Foundation, Inc. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions are met:
5+
#
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
#
9+
# * Redistributions in binary form must reproduce the above copyright
10+
# notice, this list of conditions and the following disclaimer in the
11+
# documentation and/or other materials provided with the distribution.
12+
#
13+
# * Neither the name of the copyright holder nor the names of its
14+
# contributors may be used to endorse or promote products derived from
15+
# this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
# POSSIBILITY OF SUCH DAMAGE.
28+
29+
# find package Qt5 because otherwise using the rviz_default_plugins::rviz_default_plugins
30+
# exported target will complain that the Qt5::Widgets target does not exist
31+
find_package(Qt5 REQUIRED QUIET COMPONENTS Widgets)

0 commit comments

Comments
 (0)