Skip to content

Commit c352fff

Browse files
authored
Merge branch 'main' into style/trafficlight-roi-styling
2 parents 4f1836b + 7da5afd commit c352fff

File tree

278 files changed

+87413
-3368
lines changed

Some content is hidden

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

278 files changed

+87413
-3368
lines changed

.github/CODEOWNERS

+22-16
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(autoware_mission_details_overlay_rviz_plugin)
3+
4+
find_package(ament_cmake_auto REQUIRED)
5+
ament_auto_find_build_dependencies()
6+
7+
set(
8+
headers_to_moc
9+
include/mission_details_display.hpp
10+
)
11+
12+
set(
13+
headers_to_not_moc
14+
include/remaining_distance_time_display.hpp
15+
)
16+
17+
foreach(header "${headers_to_moc}")
18+
qt5_wrap_cpp(display_moc_files "${header}")
19+
endforeach()
20+
21+
set(
22+
display_source_files
23+
src/overlay_utils.cpp
24+
src/mission_details_display.cpp
25+
src/remaining_distance_time_display.cpp
26+
)
27+
28+
add_library(
29+
${PROJECT_NAME} SHARED
30+
${display_moc_files}
31+
${headers_to_not_moc}
32+
${display_source_files}
33+
)
34+
35+
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
36+
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
37+
38+
target_include_directories(
39+
${PROJECT_NAME} PUBLIC
40+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
41+
$<INSTALL_INTERFACE:include>
42+
${Qt5Widgets_INCLUDE_DIRS}
43+
${OpenCV_INCLUDE_DIRS}
44+
)
45+
46+
target_link_libraries(
47+
${PROJECT_NAME} PUBLIC
48+
rviz_ogre_vendor::OgreMain
49+
rviz_ogre_vendor::OgreOverlay
50+
)
51+
52+
target_compile_definitions(${PROJECT_NAME} PRIVATE "${PROJECT_NAME}_BUILDING_LIBRARY")
53+
54+
# prevent pluginlib from using boost
55+
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
56+
57+
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
58+
59+
ament_target_dependencies(
60+
${PROJECT_NAME}
61+
PUBLIC
62+
rviz_common
63+
rviz_rendering
64+
autoware_internal_msgs
65+
)
66+
67+
ament_export_include_directories(include)
68+
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
69+
ament_export_dependencies(
70+
rviz_common
71+
rviz_ogre_vendor
72+
)
73+
74+
if(BUILD_TESTING)
75+
find_package(ament_lint_auto REQUIRED)
76+
ament_lint_auto_find_test_dependencies()
77+
endif()
78+
79+
install(
80+
TARGETS ${PROJECT_NAME}
81+
EXPORT ${PROJECT_NAME}
82+
ARCHIVE DESTINATION lib
83+
LIBRARY DESTINATION lib
84+
RUNTIME DESTINATION bin
85+
INCLUDES DESTINATION include
86+
)
87+
88+
install(
89+
DIRECTORY include/
90+
DESTINATION include
91+
)
92+
93+
install(
94+
TARGETS
95+
DESTINATION lib/${PROJECT_NAME}
96+
)
97+
98+
# Copy the assets directory to the installation directory
99+
install(
100+
DIRECTORY assets/
101+
DESTINATION share/${PROJECT_NAME}/assets
102+
)
103+
104+
add_definitions(-DQT_NO_KEYWORDS)
105+
106+
ament_package(
107+
CONFIG_EXTRAS "autoware_mission_details_overlay_rviz_plugin-extras.cmake"
108+
)
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,35 @@
1+
# autoware_mission_details_overlay_rviz_plugin
2+
3+
This RViz plugin displays the remaining distance and time for the current mission.
4+
5+
## Inputs / Outputs
6+
7+
### Input
8+
9+
| Name | Type | Description |
10+
| ------------------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------- |
11+
| `/planning/mission_remaining_distance_time` | `autoware_planning_msgs::msg::MissionRemainingDistanceTime` | The topic is for mission remaining distance and time |
12+
13+
## Overlay Parameters
14+
15+
| Name | Type | Default Value | Description |
16+
| -------- | ---- | ------------- | --------------------------------- |
17+
| `Width` | int | 170 | Width of the overlay [px] |
18+
| `Height` | int | 100 | Height of the overlay [px] |
19+
| `Right` | int | 10 | Margin from the right border [px] |
20+
| `Top` | int | 10 | Margin from the top border [px] |
21+
22+
The mission details display is aligned with top right corner of the screen.
23+
24+
## Usage
25+
26+
Similar to [autoware_overlay_rviz_plugin](../autoware_overlay_rviz_plugin/README.md)
27+
28+
## Credits
29+
30+
Based on the [jsk_visualization](https://github.com/jsk-ros-pkg/jsk_visualization) package.
31+
32+
### Icons
33+
34+
- <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>
35+
- <https://fonts.google.com/icons?selected=Material+Symbols+Outlined:av_timer:FILL@1;wght@400;GRAD@200;opsz@20&icon.size=20&icon.color=%23e8eaed&icon.query=av+timer>
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)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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 MISSION_DETAILS_DISPLAY_HPP_
16+
#define MISSION_DETAILS_DISPLAY_HPP_
17+
#ifndef Q_MOC_RUN
18+
#include "overlay_utils.hpp"
19+
#include "remaining_distance_time_display.hpp"
20+
21+
#include <QImage>
22+
#include <QString>
23+
#include <rviz_common/display.hpp>
24+
#include <rviz_common/properties/color_property.hpp>
25+
#include <rviz_common/properties/float_property.hpp>
26+
#include <rviz_common/properties/int_property.hpp>
27+
#include <rviz_common/properties/ros_topic_property.hpp>
28+
29+
#include <OgreColourValue.h>
30+
#include <OgreMaterial.h>
31+
#include <OgreTexture.h>
32+
33+
#include <memory>
34+
#include <mutex>
35+
#endif
36+
37+
namespace autoware::mission_details_overlay_rviz_plugin
38+
{
39+
class MissionDetailsDisplay : public rviz_common::Display
40+
{
41+
Q_OBJECT
42+
public:
43+
MissionDetailsDisplay();
44+
~MissionDetailsDisplay() override;
45+
46+
protected:
47+
void onInitialize() override;
48+
void update(float wall_dt, float ros_dt) override;
49+
void reset() override;
50+
void onEnable() override;
51+
void onDisable() override;
52+
53+
private Q_SLOTS:
54+
void update_size();
55+
void topic_updated_remaining_distance_time();
56+
57+
private:
58+
std::mutex mutex_;
59+
autoware::mission_details_overlay_rviz_plugin::OverlayObject::SharedPtr overlay_;
60+
rviz_common::properties::IntProperty * property_width_;
61+
rviz_common::properties::IntProperty * property_height_;
62+
rviz_common::properties::IntProperty * property_right_;
63+
rviz_common::properties::IntProperty * property_top_;
64+
std::unique_ptr<rviz_common::properties::RosTopicProperty>
65+
remaining_distance_time_topic_property_;
66+
67+
void draw_rounded_rect(QPainter & painter, const QRectF & backgroundRect);
68+
void setupRosSubscriptions();
69+
70+
std::unique_ptr<RemainingDistanceTimeDisplay> remaining_distance_time_display_;
71+
72+
rclcpp::Subscription<autoware_internal_msgs::msg::MissionRemainingDistanceTime>::SharedPtr
73+
remaining_distance_time_sub_;
74+
75+
std::mutex property_mutex_;
76+
77+
void cb_remaining_distance_time(
78+
const autoware_internal_msgs::msg::MissionRemainingDistanceTime::ConstSharedPtr & msg);
79+
void draw_widget(QImage & hud);
80+
};
81+
} // namespace autoware::mission_details_overlay_rviz_plugin
82+
83+
#endif // MISSION_DETAILS_DISPLAY_HPP_

0 commit comments

Comments
 (0)