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(costmap_generator): use vehicle frame for lidar height thresholds #9311

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions planning/autoware_costmap_generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ None
| `grid_length_y` | int | size of gridmap for y direction |
| `grid_position_x` | int | offset from coordinate in x direction |
| `grid_position_y` | int | offset from coordinate in y direction |
| `maximum_lidar_height_thres` | double | maximum height threshold for pointcloud data |
| `minimum_lidar_height_thres` | double | minimum height threshold for pointcloud data |
| `maximum_lidar_height_thres` | double | maximum height threshold for pointcloud data (relative to the vehicle_frame) |
| `minimum_lidar_height_thres` | double | minimum height threshold for pointcloud data (relative to the vehicle_frame) |
| `expand_rectangle_size` | double | expand object's rectangle with this value |
| `size_of_expansion_kernel` | int | kernel size for blurring effect on object's costmap |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
grid_length_y: 70.0
grid_position_x: 0.0
grid_position_y: 0.0
maximum_lidar_height_thres: 0.3
minimum_lidar_height_thres: -2.2
maximum_lidar_height_thres: 2.5 # [m] when use_points is true, ignore points with a z value above this (in the vehicle_frame)
minimum_lidar_height_thres: 0.0 # [m] when use_points is true, ignore points with a z value bellow this (in the vehicle_frame)
use_wayarea: true
use_parkinglot: true
use_objects: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ class CostmapGenerator : public rclcpp::Node

/// \brief calculate cost from pointcloud data
/// \param[in] in_points: subscribed pointcloud data
/// \param[in] vehicle_to_map_z: z value of the ego vehicle in the costmap frame
grid_map::Matrix generatePointsCostmap(
const sensor_msgs::msg::PointCloud2::ConstSharedPtr & in_points);
const sensor_msgs::msg::PointCloud2::ConstSharedPtr & in_points, const double vehicle_to_map_z);

/// \brief calculate cost from DynamicObjectArray
/// \param[in] in_objects: subscribed DynamicObjectArray
Expand Down
10 changes: 6 additions & 4 deletions planning/autoware_costmap_generator/src/costmap_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@

if (param_->use_points && points_) {
autoware::universe_utils::ScopedTimeTrack st("generatePointsCostmap()", *time_keeper_);
costmap_[LayerName::points] = generatePointsCostmap(points_);
costmap_[LayerName::points] = generatePointsCostmap(points_, tf.transform.translation.z);
}

{
Expand Down Expand Up @@ -346,7 +346,7 @@
}

grid_map::Matrix CostmapGenerator::generatePointsCostmap(
const sensor_msgs::msg::PointCloud2::ConstSharedPtr & in_points)
const sensor_msgs::msg::PointCloud2::ConstSharedPtr & in_points, const double vehicle_to_map_z)
{
geometry_msgs::msg::TransformStamped points2costmap;
try {
Expand All @@ -358,9 +358,11 @@

const auto transformed_points = getTransformedPointCloud(*in_points, points2costmap.transform);

const auto maximum_height_thres = param_->maximum_lidar_height_thres + vehicle_to_map_z;
const auto minimum_height_thres = param_->minimum_lidar_height_thres + vehicle_to_map_z;

Check warning on line 362 in planning/autoware_costmap_generator/src/costmap_generator.cpp

View check run for this annotation

Codecov / codecov/patch

planning/autoware_costmap_generator/src/costmap_generator.cpp#L361-L362

Added lines #L361 - L362 were not covered by tests
grid_map::Matrix points_costmap = points2costmap_.makeCostmapFromPoints(
param_->maximum_lidar_height_thres, param_->minimum_lidar_height_thres, param_->grid_min_value,
param_->grid_max_value, costmap_, LayerName::points, transformed_points);
maximum_height_thres, minimum_height_thres, param_->grid_min_value, param_->grid_max_value,
costmap_, LayerName::points, transformed_points);

return points_costmap;
}
Expand Down
Loading