forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request autowarefoundation#1048 from tier4/feat/objects_of…
…_interest_marker feat(objects_of_interest_marker_interface): add objects of interest marker interface
- Loading branch information
Showing
16 changed files
with
617 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
planning/objects_of_interest_marker_interface/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(objects_of_interest_marker_interface) | ||
|
||
### Compile options | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic -Werror) | ||
endif() | ||
|
||
find_package(ament_cmake_auto REQUIRED) | ||
ament_auto_find_build_dependencies() | ||
|
||
ament_auto_add_library(objects_of_interest_marker_interface SHARED | ||
src/coloring.cpp | ||
src/objects_of_interest_marker_interface.cpp | ||
src/marker_utils.cpp | ||
) | ||
|
||
# Test | ||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
ament_auto_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Objects Of Interest Marker Interface | ||
|
||
!!! warning | ||
|
||
Under Construction | ||
|
||
## Purpose | ||
|
||
## Inner-workings / Algorithms | ||
|
||
## Inputs / Outputs | ||
|
||
## Assumptions / Known limits | ||
|
||
## Future extensions / Unimplemented parts |
31 changes: 31 additions & 0 deletions
31
...ts_of_interest_marker_interface/include/objects_of_interest_marker_interface/coloring.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2023 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef OBJECTS_OF_INTEREST_MARKER_INTERFACE__COLORING_HPP_ | ||
#define OBJECTS_OF_INTEREST_MARKER_INTERFACE__COLORING_HPP_ | ||
#include "objects_of_interest_marker_interface/marker_data.hpp" | ||
|
||
#include <tier4_autoware_utils/ros/marker_helper.hpp> | ||
|
||
#include <std_msgs/msg/color_rgba.hpp> | ||
|
||
namespace objects_of_interest_marker_interface::coloring | ||
{ | ||
std_msgs::msg::ColorRGBA getGreen(const float alpha); | ||
std_msgs::msg::ColorRGBA getAmber(const float alpha); | ||
std_msgs::msg::ColorRGBA getRed(const float alpha); | ||
std_msgs::msg::ColorRGBA getGray(const float alpha); | ||
} // namespace objects_of_interest_marker_interface::coloring | ||
|
||
#endif // OBJECTS_OF_INTEREST_MARKER_INTERFACE__COLORING_HPP_ |
34 changes: 34 additions & 0 deletions
34
...of_interest_marker_interface/include/objects_of_interest_marker_interface/marker_data.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef OBJECTS_OF_INTEREST_MARKER_INTERFACE__MARKER_DATA_HPP_ | ||
#define OBJECTS_OF_INTEREST_MARKER_INTERFACE__MARKER_DATA_HPP_ | ||
|
||
#include <autoware_auto_perception_msgs/msg/predicted_object.hpp> | ||
#include <geometry_msgs/msg/pose.hpp> | ||
#include <std_msgs/msg/color_rgba.hpp> | ||
|
||
namespace objects_of_interest_marker_interface | ||
{ | ||
struct ObjectMarkerData | ||
{ | ||
geometry_msgs::msg::Pose pose{}; | ||
autoware_auto_perception_msgs::msg::Shape shape{}; | ||
std_msgs::msg::ColorRGBA color; | ||
}; | ||
|
||
enum class ColorName { GRAY, GREEN, AMBER, RED }; | ||
} // namespace objects_of_interest_marker_interface | ||
|
||
#endif // OBJECTS_OF_INTEREST_MARKER_INTERFACE__MARKER_DATA_HPP_ |
86 changes: 86 additions & 0 deletions
86
...f_interest_marker_interface/include/objects_of_interest_marker_interface/marker_utils.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright 2023 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef OBJECTS_OF_INTEREST_MARKER_INTERFACE__MARKER_UTILS_HPP_ | ||
#define OBJECTS_OF_INTEREST_MARKER_INTERFACE__MARKER_UTILS_HPP_ | ||
#include "objects_of_interest_marker_interface/coloring.hpp" | ||
#include "objects_of_interest_marker_interface/marker_data.hpp" | ||
|
||
#include <tier4_autoware_utils/geometry/boost_polygon_utils.hpp> | ||
#include <tier4_autoware_utils/geometry/geometry.hpp> | ||
#include <tier4_autoware_utils/math/constants.hpp> | ||
#include <tier4_autoware_utils/math/trigonometry.hpp> | ||
#include <tier4_autoware_utils/ros/marker_helper.hpp> | ||
|
||
#include <autoware_auto_perception_msgs/msg/predicted_object.hpp> | ||
#include <geometry_msgs/msg/pose.hpp> | ||
#include <std_msgs/msg/color_rgba.hpp> | ||
#include <visualization_msgs/msg/marker_array.hpp> | ||
|
||
#include <string> | ||
|
||
namespace objects_of_interest_marker_interface::marker_utils | ||
{ | ||
/** | ||
* @brief Create arrow marker from object marker data | ||
* @param id Marker id | ||
* @param data Object marker data | ||
* @param name Module name | ||
* @param height_offset Height offset of arrow marker | ||
* @param arrow_length Length of arrow marker | ||
*/ | ||
visualization_msgs::msg::Marker createArrowMarker( | ||
const size_t id, const ObjectMarkerData & data, const std::string & name, | ||
const double height_offset, const double arrow_length = 1.0); | ||
|
||
/** | ||
* @brief Create circle marker from object marker data | ||
* @param id Marker id | ||
* @param data Object marker data | ||
* @param name Module name | ||
* @param radius Radius of circle marker | ||
* @param height_offset Height offset of circle marker | ||
* @param line_width Line width of circle marker | ||
*/ | ||
visualization_msgs::msg::Marker createCircleMarker( | ||
const size_t id, const ObjectMarkerData & data, const std::string & name, const double radius, | ||
const double height_offset, const double line_width = 0.1); | ||
|
||
/** | ||
* @brief Create text marker visualizing module name | ||
* @param id Marker id | ||
* @param data Object marker data | ||
* @param name Module name | ||
* @param height_offset Height offset of target marker | ||
* @param text_size Text size | ||
*/ | ||
visualization_msgs::msg::Marker createNameTextMarker( | ||
const size_t id, const ObjectMarkerData & data, const std::string & name, | ||
const double height_offset, const double text_size = 0.5); | ||
|
||
/** | ||
* @brief Create target marker from object marker data | ||
* @param id Marker id | ||
* @param data Object marker data | ||
* @param name Module name | ||
* @param height_offset Height offset of target marker | ||
* @param arrow_length Length of arrow marker | ||
* @param line_width Line width of circle marker | ||
*/ | ||
visualization_msgs::msg::MarkerArray createTargetMarker( | ||
const size_t id, const ObjectMarkerData & data, const std::string & name, | ||
const double height_offset, const double arrow_length = 1.0, const double line_width = 0.1); | ||
} // namespace objects_of_interest_marker_interface::marker_utils | ||
|
||
#endif // OBJECTS_OF_INTEREST_MARKER_INTERFACE__MARKER_UTILS_HPP_ |
Oops, something went wrong.