Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(perception_rviz_plugin): rviz object covariances #6074

Merged
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "autoware_auto_perception_rviz_plugin/visibility_control.hpp"

#include <Eigen/Core>
#include <Eigen/Eigen>
#include <rclcpp/logging.hpp>
#include <rclcpp/rclcpp.hpp>

Expand Down Expand Up @@ -113,8 +115,14 @@ get_uuid_marker_ptr(
const std_msgs::msg::ColorRGBA & color_rgba);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_pose_with_covariance_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance);
get_pose_covariance_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const double & confidence_interval_coefficient);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_yaw_covariance_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance, const double & length,
const double & confidence_interval_coefficient, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_velocity_text_marker_ptr(
Expand All @@ -131,6 +139,23 @@ get_twist_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_twist_covariance_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance,
const double & confidence_interval_coefficient);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_yaw_rate_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_yaw_rate_covariance_marker_ptr(
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance,
const double & confidence_interval_coefficient, const double & line_width);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_predicted_path_marker_ptr(
const autoware_auto_perception_msgs::msg::Shape & shape,
Expand All @@ -142,10 +167,17 @@ 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 void calc_arc_line_strip(
const double start_angle, const double end_angle, const double radius,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_line_list_from_points(
const double point_list[][3], const int point_pairs[][2], const int & num_pairs,
std::vector<geometry_msgs::msg::Point> & points);

AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC void calc_covariance_eigen_vectors(
const Eigen::Matrix2d & matrix, double & sigma1, double & sigma2, double & yaw);

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,22 @@
// m_display_type_property{"Polygon Type", "3d", "Type of the polygon to display object", this},
m_display_label_property{"Display Label", true, "Enable/disable label visualization", this},
m_display_uuid_property{"Display UUID", true, "Enable/disable uuid visualization", this},
m_display_pose_with_covariance_property{
"Display PoseWithCovariance", true, "Enable/disable pose with covariance visualization",
this},
m_display_velocity_text_property{
"Display Velocity", true, "Enable/disable velocity text visualization", this},
m_display_acceleration_text_property{
"Display Acceleration", true, "Enable/disable acceleration text visualization", this},
m_display_pose_covariance_property{

Check warning on line 71 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L71

Added line #L71 was not covered by tests
"Display Pose Covariance", true, "Enable/disable pose covariance visualization", this},
m_display_yaw_covariance_property{

Check warning on line 73 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L73

Added line #L73 was not covered by tests
"Display Yaw Covariance", false, "Enable/disable yaw covariance visualization", this},
m_display_twist_property{"Display Twist", true, "Enable/disable twist visualization", this},
m_display_twist_covariance_property{

Check warning on line 76 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L76

Added line #L76 was not covered by tests
"Display Twist Covariance", false, "Enable/disable twist covariance visualization", this},
m_display_yaw_rate_property{

Check warning on line 78 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L78

Added line #L78 was not covered by tests
"Display Yaw Rate", false, "Enable/disable yaw rate visualization", this},
m_display_yaw_rate_covariance_property{

Check warning on line 80 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L80

Added line #L80 was not covered by tests
"Display Yaw Rate Covariance", false, "Enable/disable yaw rate covariance visualization",
this},
m_display_predicted_paths_property{
"Display Predicted Paths", true, "Enable/disable predicted paths visualization", this},
m_display_path_confidence_property{
Expand All @@ -96,6 +104,13 @@
"Visualization Type", "Normal", "Simplicity of the polygon to display object.", this);
m_simple_visualize_mode_property->addOption("Normal", 0);
m_simple_visualize_mode_property->addOption("Simple", 1);
// Confidence interval property
m_confidence_interval_property = new rviz_common::properties::EnumProperty(

Check warning on line 108 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L108

Added line #L108 was not covered by tests
"Confidence Interval", "95%", "Confidence interval of state estimations.", this);
m_confidence_interval_property->addOption("70%", 0);
m_confidence_interval_property->addOption("85%", 1);
m_confidence_interval_property->addOption("95%", 2);
m_confidence_interval_property->addOption("99%", 3);

Check warning on line 113 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L110-L113

Added lines #L110 - L113 were not covered by tests

// iterate over default values to create and initialize the properties.
for (const auto & map_property_it : detail::kDefaultObjectPropertyValues) {
Expand Down Expand Up @@ -238,11 +253,23 @@
}
}

std::optional<Marker::SharedPtr> get_pose_with_covariance_marker_ptr(
std::optional<Marker::SharedPtr> get_pose_covariance_marker_ptr(

Check warning on line 256 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L256

Added line #L256 was not covered by tests
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance) const
{
if (m_display_pose_with_covariance_property.getBool()) {
return detail::get_pose_with_covariance_marker_ptr(pose_with_covariance);
if (m_display_pose_covariance_property.getBool()) {
return detail::get_pose_covariance_marker_ptr(pose_with_covariance, get_confidence_region());

Check warning on line 260 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L259-L260

Added lines #L259 - L260 were not covered by tests
} else {
return std::nullopt;

Check warning on line 262 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L262

Added line #L262 was not covered by tests
}
}

std::optional<Marker::SharedPtr> get_yaw_covariance_marker_ptr(

Check warning on line 266 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L266

Added line #L266 was not covered by tests
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance, const double & length,
const double & line_width) const
{
if (m_display_yaw_covariance_property.getBool()) {

Check warning on line 270 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L270

Added line #L270 was not covered by tests
return detail::get_yaw_covariance_marker_ptr(
pose_with_covariance, length, get_confidence_interval(), line_width);

Check warning on line 272 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L272

Added line #L272 was not covered by tests
} else {
return std::nullopt;
}
Expand Down Expand Up @@ -286,6 +313,44 @@
}
}

std::optional<Marker::SharedPtr> get_twist_covariance_marker_ptr(

Check warning on line 316 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L316

Added line #L316 was not covered by tests
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance) const
{
if (m_display_twist_covariance_property.getBool()) {

Check warning on line 320 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L320

Added line #L320 was not covered by tests
return detail::get_twist_covariance_marker_ptr(
pose_with_covariance, twist_with_covariance, get_confidence_region());

Check warning on line 322 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L322

Added line #L322 was not covered by tests
} else {
return std::nullopt;

Check warning on line 324 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L324

Added line #L324 was not covered by tests
}
}

std::optional<Marker::SharedPtr> get_yaw_rate_marker_ptr(

Check warning on line 328 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L328

Added line #L328 was not covered by tests
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance,
const double & line_width) const
{
if (m_display_yaw_rate_property.getBool()) {

Check warning on line 333 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L333

Added line #L333 was not covered by tests
return detail::get_yaw_rate_marker_ptr(
pose_with_covariance, twist_with_covariance, line_width);

Check warning on line 335 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L335

Added line #L335 was not covered by tests
} else {
return std::nullopt;

Check warning on line 337 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L337

Added line #L337 was not covered by tests
}
}

std::optional<Marker::SharedPtr> get_yaw_rate_covariance_marker_ptr(

Check warning on line 341 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L341

Added line #L341 was not covered by tests
const geometry_msgs::msg::PoseWithCovariance & pose_with_covariance,
const geometry_msgs::msg::TwistWithCovariance & twist_with_covariance,
const double & line_width) const
{
if (m_display_yaw_rate_covariance_property.getBool()) {

Check warning on line 346 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L346

Added line #L346 was not covered by tests
return detail::get_yaw_rate_covariance_marker_ptr(
pose_with_covariance, twist_with_covariance, get_confidence_interval(), line_width);

Check warning on line 348 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L348

Added line #L348 was not covered by tests
} else {
return std::nullopt;

Check warning on line 350 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L350

Added line #L350 was not covered by tests
}
}

std::optional<Marker::SharedPtr> get_predicted_path_marker_ptr(
const unique_identifier_msgs::msg::UUID & uuid,
const autoware_auto_perception_msgs::msg::Shape & shape,
Expand Down Expand Up @@ -408,6 +473,46 @@

double get_line_width() { return m_line_width_property.getFloat(); }

double get_confidence_interval() const
{
switch (m_confidence_interval_property->getOptionInt()) {

Check warning on line 478 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L478

Added line #L478 was not covered by tests
case 0:
// 70%
return 1.036;
case 1:
// 85%
return 1.440;
case 2:
// 95%
return 1.960;
case 3:
// 99%
return 2.576;
default:
return 1.960;
}
}

double get_confidence_region() const
{
switch (m_confidence_interval_property->getOptionInt()) {

Check warning on line 498 in common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/include/autoware_auto_perception_rviz_plugin/object_detection/object_polygon_display_base.hpp#L498

Added line #L498 was not covered by tests
case 0:
// 70%
return 1.552;
case 1:
// 85%
return 1.802;
case 2:
// 95%
return 2.448;
case 3:
// 99%
return 3.035;
default:
return 2.448;
}
}

private:
// All rviz plugins should have this. Should be initialized with pointer to this class
MarkerCommon m_marker_common;
Expand All @@ -419,18 +524,28 @@
rviz_common::properties::EnumProperty * m_display_type_property;
// Property to choose simplicity of visualization polygon
rviz_common::properties::EnumProperty * m_simple_visualize_mode_property;
// Property to set confidence interval of state estimations
rviz_common::properties::EnumProperty * m_confidence_interval_property;
// Property to enable/disable label visualization
rviz_common::properties::BoolProperty m_display_label_property;
// Property to enable/disable uuid visualization
rviz_common::properties::BoolProperty m_display_uuid_property;
// Property to enable/disable pose with covariance visualization
rviz_common::properties::BoolProperty m_display_pose_with_covariance_property;
// Property to enable/disable velocity text visualization
rviz_common::properties::BoolProperty m_display_velocity_text_property;
// Property to enable/disable acceleration text visualization
rviz_common::properties::BoolProperty m_display_acceleration_text_property;
// Property to enable/disable pose with covariance visualization
rviz_common::properties::BoolProperty m_display_pose_covariance_property;
// Property to enable/disable yaw covariance visualization
rviz_common::properties::BoolProperty m_display_yaw_covariance_property;
// Property to enable/disable twist visualization
rviz_common::properties::BoolProperty m_display_twist_property;
// Property to enable/disable twist covariance visualization
rviz_common::properties::BoolProperty m_display_twist_covariance_property;
// Property to enable/disable yaw rate visualization
rviz_common::properties::BoolProperty m_display_yaw_rate_property;
// Property to enable/disable yaw rate covariance visualization
rviz_common::properties::BoolProperty m_display_yaw_rate_covariance_property;
// Property to enable/disable predicted paths visualization
rviz_common::properties::BoolProperty m_display_predicted_paths_property;
// Property to enable/disable predicted path confidence visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@
add_marker(label_marker_ptr);
}

// Get marker for pose covariance
auto pose_with_covariance_marker =
get_pose_covariance_marker_ptr(object.kinematics.pose_with_covariance);
if (pose_with_covariance_marker) {

Check warning on line 65 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L64-L65

Added lines #L64 - L65 were not covered by tests
auto marker_ptr = pose_with_covariance_marker.value();
marker_ptr->header = msg->header;
marker_ptr->id = id++;
add_marker(marker_ptr);

Check warning on line 69 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L68-L69

Added lines #L68 - L69 were not covered by tests
}

// Get marker for yaw covariance
auto yaw_covariance_marker = get_yaw_covariance_marker_ptr(
object.kinematics.pose_with_covariance, object.shape.dimensions.x * 0.65,
get_line_width() * 0.5);
if (yaw_covariance_marker) {

Check warning on line 76 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L74-L76

Added lines #L74 - L76 were not covered by tests
auto marker_ptr = yaw_covariance_marker.value();
marker_ptr->header = msg->header;
marker_ptr->id = id++;
add_marker(marker_ptr);

Check warning on line 80 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L79-L80

Added lines #L79 - L80 were not covered by tests
}

// Get marker for existence probability
geometry_msgs::msg::Point existence_probability_position;
existence_probability_position.x = object.kinematics.pose_with_covariance.pose.position.x + 0.5;
Expand Down Expand Up @@ -99,6 +120,38 @@
twist_marker_ptr->id = id++;
add_marker(twist_marker_ptr);
}

// Get marker for twist covariance
auto twist_covariance_marker = get_twist_covariance_marker_ptr(
object.kinematics.pose_with_covariance, object.kinematics.twist_with_covariance);
if (twist_covariance_marker) {

Check warning on line 127 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L126-L127

Added lines #L126 - L127 were not covered by tests
auto marker_ptr = twist_covariance_marker.value();
marker_ptr->header = msg->header;
marker_ptr->id = id++;
add_marker(marker_ptr);

Check warning on line 131 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L130-L131

Added lines #L130 - L131 were not covered by tests
}

// Get marker for yaw rate
auto yaw_rate_marker = get_yaw_rate_marker_ptr(
object.kinematics.pose_with_covariance, object.kinematics.twist_with_covariance,
get_line_width() * 0.4);
if (yaw_rate_marker) {

Check warning on line 138 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L137-L138

Added lines #L137 - L138 were not covered by tests
auto marker_ptr = yaw_rate_marker.value();
marker_ptr->header = msg->header;
marker_ptr->id = id++;
add_marker(marker_ptr);

Check warning on line 142 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L141-L142

Added lines #L141 - L142 were not covered by tests
}

// Get marker for yaw rate covariance
auto yaw_rate_covariance_marker = get_yaw_rate_covariance_marker_ptr(
object.kinematics.pose_with_covariance, object.kinematics.twist_with_covariance,
get_line_width() * 0.3);
if (yaw_rate_covariance_marker) {

Check warning on line 149 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L148-L149

Added lines #L148 - L149 were not covered by tests
auto marker_ptr = yaw_rate_covariance_marker.value();
marker_ptr->header = msg->header;
marker_ptr->id = id++;
add_marker(marker_ptr);

Check warning on line 153 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp#L152-L153

Added lines #L152 - L153 were not covered by tests
}

Check warning on line 154 in common/autoware_auto_perception_rviz_plugin/src/object_detection/detected_objects_display.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Complex Method

DetectedObjectsDisplay::processMessage has a cyclomatic complexity of 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}
}

Expand Down
Loading
Loading