Skip to content

Commit 25b03fa

Browse files
authored
Merge branch 'main' into feat/mot-bicycle-model-revision
2 parents 154e6e4 + 0db40ae commit 25b03fa

File tree

112 files changed

+6013
-1066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+6013
-1066
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(awf_2d_overlay_vehicle)
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+
ament_auto_find_build_dependencies()
11+
12+
find_package(rviz_2d_overlay_msgs REQUIRED)
13+
14+
find_package(rviz_common REQUIRED)
15+
find_package(rviz_rendering REQUIRED)
16+
find_package(rviz_ogre_vendor REQUIRED)
17+
find_package(std_msgs REQUIRED)
18+
19+
set(
20+
headers_to_moc
21+
include/overlay_text_display.hpp
22+
include/signal_display.hpp
23+
24+
)
25+
26+
set(
27+
headers_to_not_moc
28+
include/steering_wheel_display.hpp
29+
include/gear_display.hpp
30+
include/speed_display.hpp
31+
include/turn_signals_display.hpp
32+
include/traffic_display.hpp
33+
include/speed_limit_display.hpp
34+
)
35+
36+
37+
38+
foreach(header "${headers_to_moc}")
39+
qt5_wrap_cpp(display_moc_files "${header}")
40+
endforeach()
41+
42+
set(
43+
display_source_files
44+
src/overlay_text_display.cpp
45+
src/overlay_utils.cpp
46+
src/signal_display.cpp
47+
src/steering_wheel_display.cpp
48+
src/gear_display.cpp
49+
src/speed_display.cpp
50+
src/turn_signals_display.cpp
51+
src/traffic_display.cpp
52+
src/speed_limit_display.cpp
53+
54+
)
55+
56+
add_library(
57+
${PROJECT_NAME} SHARED
58+
${display_moc_files}
59+
${headers_to_not_moc}
60+
${display_source_files}
61+
)
62+
63+
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
64+
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
65+
66+
target_include_directories(
67+
${PROJECT_NAME} PUBLIC
68+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
69+
$<INSTALL_INTERFACE:include>
70+
${Qt5Widgets_INCLUDE_DIRS}
71+
${OpenCV_INCLUDE_DIRS}
72+
)
73+
74+
target_link_libraries(
75+
${PROJECT_NAME} PUBLIC
76+
rviz_ogre_vendor::OgreMain
77+
rviz_ogre_vendor::OgreOverlay
78+
)
79+
80+
81+
target_compile_definitions(${PROJECT_NAME} PRIVATE "${PROJECT_NAME}_BUILDING_LIBRARY")
82+
83+
# prevent pluginlib from using boost
84+
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
85+
86+
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
87+
88+
ament_target_dependencies(
89+
${PROJECT_NAME}
90+
PUBLIC
91+
rviz_common
92+
rviz_rendering
93+
rviz_2d_overlay_msgs
94+
autoware_auto_vehicle_msgs
95+
tier4_planning_msgs
96+
autoware_perception_msgs
97+
)
98+
99+
ament_export_include_directories(include)
100+
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
101+
ament_export_dependencies(
102+
rviz_common
103+
rviz_ogre_vendor
104+
)
105+
106+
if(BUILD_TESTING)
107+
find_package(ament_lint_auto REQUIRED)
108+
ament_lint_auto_find_test_dependencies()
109+
endif()
110+
111+
install(
112+
TARGETS ${PROJECT_NAME}
113+
EXPORT ${PROJECT_NAME}
114+
ARCHIVE DESTINATION lib
115+
LIBRARY DESTINATION lib
116+
RUNTIME DESTINATION bin
117+
INCLUDES DESTINATION include
118+
)
119+
120+
install(
121+
DIRECTORY include/
122+
DESTINATION include
123+
)
124+
125+
install(
126+
TARGETS
127+
DESTINATION lib/${PROJECT_NAME}
128+
)
129+
130+
# Copy the assets directory to the installation directory
131+
install(
132+
DIRECTORY assets/
133+
DESTINATION share/${PROJECT_NAME}/assets
134+
)
135+
136+
add_definitions(-DQT_NO_KEYWORDS)
137+
138+
ament_package(
139+
CONFIG_EXTRAS "awf_2d_overlay_vehicle-extras.cmake"
140+
)
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+
# awf_2d_overlay_vehicle
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 twist |
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+
24+
## Parameter
25+
26+
### Core Parameters
27+
28+
#### SignalDisplay
29+
30+
| Name | Type | Default Value | Description |
31+
| ------------------------ | ------ | -------------------- | --------------------------------- |
32+
| `property_width_` | int | 128 | Width of the plotter window [px] |
33+
| `property_height_` | int | 128 | Height of the plotter window [px] |
34+
| `property_left_` | int | 128 | Left of the plotter window [px] |
35+
| `property_top_` | int | 128 | Top of the plotter window [px] |
36+
| `property_signal_color_` | QColor | QColor(25, 255, 240) | Turn Signal color |
37+
38+
## Assumptions / Known limits
39+
40+
TBD.
41+
42+
## Usage
43+
44+
1. Start rviz and select Add under the Displays panel.
45+
46+
![select_add](./assets/images/select_add.png)
47+
48+
2. Select any one of the tier4_vehicle_rviz_plugin and press OK.
49+
50+
![select_vehicle_plugin](./assets/images/select_vehicle_plugin.png)
51+
52+
3. Enter the name of the topic where you want to view the status.
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.
Loading
Loading
Loading
Loading
Loading
Loading
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)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2024 The Autoware Contributors
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+
#ifndef GEAR_DISPLAY_HPP_
16+
#define GEAR_DISPLAY_HPP_
17+
#include "overlay_utils.hpp"
18+
19+
#include <QImage>
20+
#include <QString>
21+
#include <rviz_common/properties/color_property.hpp>
22+
#include <rviz_common/properties/float_property.hpp>
23+
#include <rviz_common/properties/int_property.hpp>
24+
#include <rviz_common/ros_topic_display.hpp>
25+
26+
#include "autoware_auto_vehicle_msgs/msg/gear_report.hpp"
27+
28+
#include <OgreColourValue.h>
29+
#include <OgreMaterial.h>
30+
#include <OgreTexture.h>
31+
32+
namespace awf_2d_overlay_vehicle
33+
{
34+
35+
class GearDisplay
36+
{
37+
public:
38+
GearDisplay();
39+
void drawGearIndicator(QPainter & painter, const QRectF & backgroundRect);
40+
void updateGearData(const autoware_auto_vehicle_msgs::msg::GearReport::ConstSharedPtr & msg);
41+
42+
private:
43+
int current_gear_; // Internal variable to store current gear
44+
QColor gray = QColor(194, 194, 194);
45+
};
46+
47+
} // namespace awf_2d_overlay_vehicle
48+
49+
#endif // GEAR_DISPLAY_HPP_

0 commit comments

Comments
 (0)