Skip to content

Commit 06a4426

Browse files
authored
fix(perception object): fix orientation of position covariance (#28)
* fix(autoware_perception_rviz_plugin): refine marker pose and format existence probability text Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * fix(autoware_perception_rviz_plugin): update marker pose handling to correctly set position Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * fix(autoware_perception_rviz_plugin): increase precision of existence probability text in marker Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> --------- Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent bac3843 commit 06a4426

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

autoware_perception_rviz_plugin/src/object_detection/object_polygon_detail.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ visualization_msgs::msg::Marker::SharedPtr get_pose_covariance_marker_ptr(
374374
marker_ptr->type = visualization_msgs::msg::Marker::CYLINDER;
375375
marker_ptr->ns = std::string("position covariance");
376376
marker_ptr->action = visualization_msgs::msg::Marker::MODIFY;
377-
marker_ptr->pose = pose_with_covariance.pose;
377+
marker_ptr->pose.position = pose_with_covariance.pose.position;
378+
// orientation is for the given frame_id
378379

379380
// position covariance
380381
// extract eigen values and eigen vectors
@@ -492,7 +493,9 @@ visualization_msgs::msg::Marker::SharedPtr get_existence_probability_marker_ptr(
492493
marker_ptr->ns = std::string("existence probability");
493494
marker_ptr->scale.x = 0.5;
494495
marker_ptr->scale.z = 0.5;
495-
marker_ptr->text = std::to_string(existence_probability);
496+
std::ostringstream oss;
497+
oss << std::fixed << std::setprecision(3) << existence_probability;
498+
marker_ptr->text = oss.str();
496499
marker_ptr->action = visualization_msgs::msg::Marker::MODIFY;
497500
marker_ptr->pose = marker_ptr->pose = to_pose(centroid, orientation);
498501
marker_ptr->lifetime = rclcpp::Duration::from_seconds(0.15);

0 commit comments

Comments
 (0)