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

fix(autoware_multi_object_tracker): unknown object orientation #10286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <tf2/utils.h>

#include <algorithm>
#include <limits>
#include <string>
#include <vector>

Expand Down Expand Up @@ -92,17 +93,20 @@
}

// look for bounding box boundary
float max_x = 0;
float max_y = 0;
float min_x = 0;
float min_y = 0;
float max_z = 0;
float max_x = -std::numeric_limits<float>::infinity();
float max_y = -std::numeric_limits<float>::infinity();
float min_x = std::numeric_limits<float>::infinity();
float min_y = std::numeric_limits<float>::infinity();
float max_z = -std::numeric_limits<float>::infinity();
float min_z = std::numeric_limits<float>::infinity();

Check warning on line 101 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp#L96-L101

Added lines #L96 - L101 were not covered by tests

for (const auto & point : input_object.shape.footprint.points) {
max_x = std::max(max_x, point.x);
max_y = std::max(max_y, point.y);
min_x = std::min(min_x, point.x);
min_y = std::min(min_y, point.y);
max_z = std::max(max_z, point.z);
min_z = std::min(min_z, point.z);

Check warning on line 109 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp#L109

Added line #L109 was not covered by tests
}

// calc new center
Expand All @@ -120,7 +124,7 @@
output_object.shape.type = autoware_perception_msgs::msg::Shape::BOUNDING_BOX;
output_object.shape.dimensions.x = max_x - min_x;
output_object.shape.dimensions.y = max_y - min_y;
output_object.shape.dimensions.z = max_z;
output_object.shape.dimensions.z = max_z - min_z;

Check warning on line 127 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp#L127

Added line #L127 was not covered by tests

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
{
// update object shape
object_.shape = object.shape;
object_.pose.orientation = object.pose.orientation;

Check warning on line 147 in perception/autoware_multi_object_tracker/lib/tracker/model/unknown_tracker.cpp

View check run for this annotation

Codecov / codecov/patch

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

Added line #L147 was not covered by tests

// check time gap
const double dt = motion_model_.getDeltaTime(time);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@

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

// Model the object uncertainty only if it is not available
types::DynamicObjectList objects_with_uncertainty =
uncertainty::modelUncertainty(dynamic_objects);

Check warning on line 61 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp#L61

Added line #L61 was not covered by tests

// Transform the objects to the world frame
auto transformed_objects = odometry_->transformObjects(objects_with_uncertainty);

Check warning on line 64 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp#L64

Added line #L64 was not covered by tests
if (!transformed_objects) {
RCLCPP_WARN(

Check warning on line 66 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp#L66

Added line #L66 was not covered by tests
node_.get_logger(), "InputManager::onMessage %s: Failed to transform objects.",
channel_.long_name.c_str());
return;

Check warning on line 69 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp#L69

Added line #L69 was not covered by tests
}
dynamic_objects = transformed_objects.value();

Check warning on line 71 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp#L71

Added line #L71 was not covered by tests

// object shape processing
for (auto & object : dynamic_objects.objects) {
const auto label =
Expand Down Expand Up @@ -91,20 +105,6 @@
// if object extension is not reliable, enlarge covariance of position and extend shape
}

// Model the object uncertainty only if it is not available
types::DynamicObjectList objects_with_uncertainty =
uncertainty::modelUncertainty(dynamic_objects);

// Transform the objects to the world frame
auto transformed_objects = odometry_->transformObjects(objects_with_uncertainty);
if (!transformed_objects) {
RCLCPP_WARN(
node_.get_logger(), "InputManager::onMessage %s: Failed to transform objects.",
channel_.long_name.c_str());
return;
}
dynamic_objects = transformed_objects.value();

// Normalize the object uncertainty
uncertainty::normalizeUncertainty(dynamic_objects);

Expand Down
Loading