Skip to content

Commit b3d15d9

Browse files
authored
fix(autoware_multi_object_tracker): unknown object orientation (#10286)
* fix(unknown_tracker): update object pose orientation and streamline uncertainty modeling in input manager Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * fix(object_model): correct bounding box calculation by initializing limits and including min_z Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> --------- Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent 3dd5f05 commit b3d15d9

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <tf2/utils.h>
2727

2828
#include <algorithm>
29+
#include <limits>
2930
#include <string>
3031
#include <vector>
3132

@@ -92,17 +93,20 @@ bool convertConvexHullToBoundingBox(
9293
}
9394

9495
// look for bounding box boundary
95-
float max_x = 0;
96-
float max_y = 0;
97-
float min_x = 0;
98-
float min_y = 0;
99-
float max_z = 0;
96+
float max_x = -std::numeric_limits<float>::infinity();
97+
float max_y = -std::numeric_limits<float>::infinity();
98+
float min_x = std::numeric_limits<float>::infinity();
99+
float min_y = std::numeric_limits<float>::infinity();
100+
float max_z = -std::numeric_limits<float>::infinity();
101+
float min_z = std::numeric_limits<float>::infinity();
102+
100103
for (const auto & point : input_object.shape.footprint.points) {
101104
max_x = std::max(max_x, point.x);
102105
max_y = std::max(max_y, point.y);
103106
min_x = std::min(min_x, point.x);
104107
min_y = std::min(min_y, point.y);
105108
max_z = std::max(max_z, point.z);
109+
min_z = std::min(min_z, point.z);
106110
}
107111

108112
// calc new center
@@ -120,7 +124,7 @@ bool convertConvexHullToBoundingBox(
120124
output_object.shape.type = autoware_perception_msgs::msg::Shape::BOUNDING_BOX;
121125
output_object.shape.dimensions.x = max_x - min_x;
122126
output_object.shape.dimensions.y = max_y - min_y;
123-
output_object.shape.dimensions.z = max_z;
127+
output_object.shape.dimensions.z = max_z - min_z;
124128

125129
return true;
126130
}

perception/autoware_multi_object_tracker/lib/tracker/model/unknown_tracker.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ bool UnknownTracker::measure(const types::DynamicObject & object, const rclcpp::
144144
{
145145
// update object shape
146146
object_.shape = object.shape;
147+
object_.pose.orientation = object.pose.orientation;
147148

148149
// check time gap
149150
const double dt = motion_model_.getDeltaTime(time);

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ void InputStream::onMessage(
5656

5757
types::DynamicObjectList dynamic_objects = types::toDynamicObjectList(objects, channel_.index);
5858

59+
// Model the object uncertainty only if it is not available
60+
types::DynamicObjectList objects_with_uncertainty =
61+
uncertainty::modelUncertainty(dynamic_objects);
62+
63+
// Transform the objects to the world frame
64+
auto transformed_objects = odometry_->transformObjects(objects_with_uncertainty);
65+
if (!transformed_objects) {
66+
RCLCPP_WARN(
67+
node_.get_logger(), "InputManager::onMessage %s: Failed to transform objects.",
68+
channel_.long_name.c_str());
69+
return;
70+
}
71+
dynamic_objects = transformed_objects.value();
72+
5973
// object shape processing
6074
for (auto & object : dynamic_objects.objects) {
6175
const auto label =
@@ -91,20 +105,6 @@ void InputStream::onMessage(
91105
// if object extension is not reliable, enlarge covariance of position and extend shape
92106
}
93107

94-
// Model the object uncertainty only if it is not available
95-
types::DynamicObjectList objects_with_uncertainty =
96-
uncertainty::modelUncertainty(dynamic_objects);
97-
98-
// Transform the objects to the world frame
99-
auto transformed_objects = odometry_->transformObjects(objects_with_uncertainty);
100-
if (!transformed_objects) {
101-
RCLCPP_WARN(
102-
node_.get_logger(), "InputManager::onMessage %s: Failed to transform objects.",
103-
channel_.long_name.c_str());
104-
return;
105-
}
106-
dynamic_objects = transformed_objects.value();
107-
108108
// Normalize the object uncertainty
109109
uncertainty::normalizeUncertainty(dynamic_objects);
110110

0 commit comments

Comments
 (0)