-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(interest_objects_marker_interface): fix interface
Signed-off-by: Fumiya Watanabe <[email protected]>
- Loading branch information
Showing
7 changed files
with
181 additions
and
56 deletions.
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
31 changes: 31 additions & 0 deletions
31
.../interest_objects_marker_interface/include/interest_objects_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 INTEREST_OBJECTS_MARKER_INTERFACE__COLORING_HPP_ | ||
#define INTEREST_OBJECTS_MARKER_INTERFACE__COLORING_HPP_ | ||
#include "interest_objects_marker_interface/marker_data.hpp" | ||
|
||
#include <tier4_autoware_utils/ros/marker_helper.hpp> | ||
|
||
#include <std_msgs/msg/color_rgba.hpp> | ||
|
||
namespace interest_objects_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 getWhite(const float alpha); | ||
} // namespace interest_objects_marker_interface::coloring | ||
|
||
#endif // INTEREST_OBJECTS_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
34 changes: 34 additions & 0 deletions
34
...terest_objects_marker_interface/include/interest_objects_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 INTEREST_OBJECTS_MARKER_INTERFACE__MARKER_DATA_HPP_ | ||
#define INTEREST_OBJECTS_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 interest_objects_marker_interface | ||
{ | ||
struct ObjectMarkerData | ||
{ | ||
geometry_msgs::msg::Pose pose{}; | ||
autoware_auto_perception_msgs::msg::Shape shape{}; | ||
std_msgs::msg::ColorRGBA color; | ||
}; | ||
|
||
enum class ColorName { GREEN, AMBER, RED, WHITE }; | ||
} // namespace interest_objects_marker_interface | ||
|
||
#endif // INTEREST_OBJECTS_MARKER_INTERFACE__MARKER_DATA_HPP_ |
50 changes: 50 additions & 0 deletions
50
planning/interest_objects_marker_interface/src/coloring.cpp
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,50 @@ | ||
// 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. | ||
|
||
#include "interest_objects_marker_interface/coloring.hpp" | ||
|
||
namespace interest_objects_marker_interface::coloring | ||
{ | ||
std_msgs::msg::ColorRGBA getGreen(const float alpha) | ||
{ | ||
const float r = 0.0f; | ||
const float g = 211.0 / 255.0; | ||
const float b = 141.0 / 255.0; | ||
return tier4_autoware_utils::createMarkerColor(r, g, b, alpha); | ||
} | ||
|
||
std_msgs::msg::ColorRGBA getAmber(const float alpha) | ||
{ | ||
const float r = 0.0f; | ||
const float g = 211.0 / 255.0; | ||
const float b = 141.0 / 255.0; | ||
return tier4_autoware_utils::createMarkerColor(r, g, b, alpha); | ||
} | ||
|
||
std_msgs::msg::ColorRGBA getRed(const float alpha) | ||
{ | ||
const float r = 214.0 / 255.0; | ||
const float g = 0.0f; | ||
const float b = 77.0 / 255.0; | ||
return tier4_autoware_utils::createMarkerColor(r, g, b, alpha); | ||
} | ||
|
||
std_msgs::msg::ColorRGBA getWhite(const float alpha) | ||
{ | ||
const float r = 1.0f; | ||
const float g = 1.0f; | ||
const float b = 1.0f; | ||
return tier4_autoware_utils::createMarkerColor(r, g, b, alpha); | ||
} | ||
} // namespace interest_objects_marker_interface::coloring |
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