Skip to content

Commit

Permalink
Merge pull request #5675 from autowarefoundation/feat/remove-autoware…
Browse files Browse the repository at this point in the history
…-auto-perception-msgs

Replace autoware_auto_perception_msgs with autoware_perception_msgs
  • Loading branch information
shulanbushangshu authored Dec 1, 2023
2 parents 6137908 + 3105242 commit 4d5d52d
Show file tree
Hide file tree
Showing 153 changed files with 1,075 additions and 506 deletions.
6 changes: 3 additions & 3 deletions common/autoware_auto_perception_rviz_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Overwrite tracking results with detection results.

#### Input Types

| Name | Type | Description |
| ---- | ------------------------------------------------------ | ----------------------- |
| | `autoware_auto_perception_msgs::msg::PredictedObjects` | prediction result array |
| Name | Type | Description |
| ---- | ------------------------------------------------- | ----------------------- |
| | `autoware_perception_msgs::msg::PredictedObjects` | prediction result array |

#### Visualization Result

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <autoware_auto_perception_msgs/msg/object_classification.hpp>
#include <autoware_auto_perception_msgs/msg/predicted_path.hpp>
#include <autoware_auto_perception_msgs/msg/shape.hpp>
#include <autoware_perception_msgs/msg/object_classification.hpp>
#include <autoware_perception_msgs/msg/predicted_path.hpp>
#include <autoware_perception_msgs/msg/shape.hpp>
#include <geometry_msgs/msg/accel.hpp>
#include <geometry_msgs/msg/pose_with_covariance.hpp>
#include <geometry_msgs/msg/twist.hpp>
Expand Down Expand Up @@ -84,12 +87,24 @@ get_shape_marker_ptr(
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std_msgs::msg::ColorRGBA & color_rgba, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_shape_marker_ptr(
const autoware_perception_msgs::msg::Shape & shape_msg,
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std_msgs::msg::ColorRGBA & color_rgba, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_2d_shape_marker_ptr(
const autoware_auto_perception_msgs::msg::Shape & shape_msg,
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std_msgs::msg::ColorRGBA & color_rgba, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_2d_shape_marker_ptr(
const autoware_perception_msgs::msg::Shape & shape_msg,
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std_msgs::msg::ColorRGBA & color_rgba, const double & line_width);

/// \brief Convert the given polygon into a marker representing the shape in 3d
/// \param centroid Centroid position of the shape in Object.header.frame_id frame
/// \return Marker ptr. Id and header will have to be set by the caller
Expand Down Expand Up @@ -127,27 +142,48 @@ get_predicted_path_marker_ptr(
const autoware_auto_perception_msgs::msg::Shape & shape,
const autoware_auto_perception_msgs::msg::PredictedPath & predicted_path,
const std_msgs::msg::ColorRGBA & predicted_path_color, const bool is_simple = false);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_predicted_path_marker_ptr(
const autoware_perception_msgs::msg::Shape & shape,
const autoware_perception_msgs::msg::PredictedPath & predicted_path,
const std_msgs::msg::ColorRGBA & predicted_path_color, const bool is_simple = false);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_path_confidence_marker_ptr(
const autoware_auto_perception_msgs::msg::PredictedPath & predicted_path,
const std_msgs::msg::ColorRGBA & path_confidence_color);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_path_confidence_marker_ptr(
const autoware_perception_msgs::msg::PredictedPath & predicted_path,
const std_msgs::msg::ColorRGBA & path_confidence_color);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_bounding_box_line_list(
const autoware_auto_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_bounding_box_line_list(
const autoware_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_2d_bounding_box_bottom_line_list(
const autoware_auto_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_2d_bounding_box_bottom_line_list(
const autoware_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_cylinder_line_list(
const autoware_auto_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_cylinder_line_list(
const autoware_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_2d_cylinder_bottom_line_list(
const autoware_auto_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_2d_cylinder_bottom_line_list(
const autoware_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_circle_line_list(
const geometry_msgs::msg::Point center, const double radius,
Expand All @@ -156,14 +192,23 @@ AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_circle_line_list(
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_polygon_line_list(
const autoware_auto_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_polygon_line_list(
const autoware_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_2d_polygon_bottom_line_list(
const autoware_auto_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_2d_polygon_bottom_line_list(
const autoware_perception_msgs::msg::Shape & shape,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_path_line_list(
const autoware_auto_perception_msgs::msg::PredictedPath & paths,
std::vector<geometry_msgs::msg::Point> & points, const bool is_simple = false);
AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_path_line_list(
const autoware_perception_msgs::msg::PredictedPath & paths,
std::vector<geometry_msgs::msg::Point> & points, const bool is_simple = false);

/// \brief Convert Point32 to Point
/// \param val Point32 to be converted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC ObjectPolygonDisplayBase
}
}

template <typename ClassificationContainerT>
std::optional<Marker::SharedPtr> get_shape_marker_ptr(
const autoware_perception_msgs::msg::Shape & shape_msg,
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const ClassificationContainerT & labels, const double & line_width) const
{
const std_msgs::msg::ColorRGBA color_rgba = get_color_rgba(labels);
if (m_display_type_property->getOptionInt() == 0) {
return detail::get_shape_marker_ptr(shape_msg, centroid, orientation, color_rgba, line_width);
} else if (m_display_type_property->getOptionInt() == 1) {
return detail::get_2d_shape_marker_ptr(
shape_msg, centroid, orientation, color_rgba, line_width);
} else {
return std::nullopt;
}
}

template <typename ClassificationContainerT>
visualization_msgs::msg::Marker::SharedPtr get_2d_shape_marker_ptr(
const autoware_auto_perception_msgs::msg::Shape & shape_msg,
Expand Down Expand Up @@ -278,6 +295,21 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC ObjectPolygonDisplayBase
return std::nullopt;
}
}
std::optional<Marker::SharedPtr> get_predicted_path_marker_ptr(
const unique_identifier_msgs::msg::UUID & uuid,
const autoware_perception_msgs::msg::Shape & shape,
const autoware_perception_msgs::msg::PredictedPath & predicted_path) const
{
if (m_display_predicted_paths_property.getBool()) {
const std::string uuid_str = uuid_to_string(uuid);
const std_msgs::msg::ColorRGBA predicted_path_color = get_color_from_uuid(uuid_str);
return detail::get_predicted_path_marker_ptr(
shape, predicted_path, predicted_path_color,
m_simple_visualize_mode_property->getOptionInt() == 1);
} else {
return std::nullopt;
}
}

std::optional<Marker::SharedPtr> get_path_confidence_marker_ptr(
const unique_identifier_msgs::msg::UUID & uuid,
Expand All @@ -292,6 +324,19 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC ObjectPolygonDisplayBase
}
}

std::optional<Marker::SharedPtr> get_path_confidence_marker_ptr(
const unique_identifier_msgs::msg::UUID & uuid,
const autoware_perception_msgs::msg::PredictedPath & predicted_path) const
{
if (m_display_path_confidence_property.getBool()) {
const std::string uuid_str = uuid_to_string(uuid);
const std_msgs::msg::ColorRGBA path_confidence_color = get_color_from_uuid(uuid_str);
return detail::get_path_confidence_marker_ptr(predicted_path, path_confidence_color);
} else {
return std::nullopt;
}
}

/// \brief Get color and alpha values based on the given list of classification values
/// \tparam ClassificationContainerT Container of ObjectClassification
/// \param labels list of classifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <object_detection/object_polygon_display_base.hpp>

#include <autoware_auto_perception_msgs/msg/predicted_objects.hpp>
#include <autoware_perception_msgs/msg/predicted_objects.hpp>

#include <boost/functional/hash.hpp>
#include <boost/uuid/uuid.hpp>
Expand All @@ -39,12 +39,12 @@ namespace object_detection
{
/// \brief Class defining rviz plugin to visualize PredictedObjects
class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC PredictedObjectsDisplay
: public ObjectPolygonDisplayBase<autoware_auto_perception_msgs::msg::PredictedObjects>
: public ObjectPolygonDisplayBase<autoware_perception_msgs::msg::PredictedObjects>
{
Q_OBJECT

public:
using PredictedObjects = autoware_auto_perception_msgs::msg::PredictedObjects;
using PredictedObjects = autoware_perception_msgs::msg::PredictedObjects;

PredictedObjectsDisplay();
~PredictedObjectsDisplay()
Expand Down
1 change: 1 addition & 0 deletions common/autoware_auto_perception_rviz_plugin/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<build_depend>qtbase5-dev</build_depend>

<depend>autoware_auto_perception_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>rviz_common</depend>
<depend>rviz_default_plugins</depend>

Expand Down
Loading

0 comments on commit 4d5d52d

Please sign in to comment.