Skip to content
Open
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
2 changes: 1 addition & 1 deletion maps_managers/easynav_navmap_maps_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ All parameters are declared under the plugin namespace, i.e.
|---|---|---:|---|
| `<plugin>.package` | `string` | `""` | Package name to resolve relative paths via `ament_index`. |
| `<plugin>.freq` | `double` | `10.0` | Update frequency (Hz) for map publishing and filter execution. |
| `<plugin>.navmap_path_file` | `string` | `""` | Relative path (inside the package) to a `.navmap` file to load at startup. |
| `<plugin>.navmap_path_file` | `string` | `""` | The `.navmap` file to load at startup: relative to the share directory of `<plugin>.package`, or as it is (e.g. absolute) without a package. |
| `<plugin>.occmap_path_file` | `string` | `""` | Relative path (inside the package) to a ROS YAML OccupancyGrid to import as NavMap. |
| `<plugin>.pcd_path_file` | `string` | `""` | Relative path (inside the package) to a point cloud (PCD/PLY) used to build a NavMap surface. |
| `<plugin>.filters` | `list<string>` | `[]` | Ordered list of filter plugin names to be applied after map loading (e.g. `["obstacles", "inflation"]`). |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,16 @@ NavMapMapsManager::on_initialize()
navmap_pub_->publish(navmap_msg_);
}

if (!package_name.empty() && !navmap_path_file.empty()) {
try {
const std::string pkgpath = easynav::get_package_share_path(package_name);
map_path_ = pkgpath + std::string("/") + navmap_path_file;
} catch (ament_index_cpp::PackageNotFoundError & ex) {
throw std::runtime_error("Package " + package_name + " not found. Error: " + ex.what());
if (!navmap_path_file.empty()) {
// relative to the package's share directory, or as it is without a package (e.g. absolute)
map_path_ = navmap_path_file;
if (!package_name.empty()) {
try {
const std::string pkgpath = easynav::get_package_share_path(package_name);
map_path_ = pkgpath + std::string("/") + navmap_path_file;
} catch (ament_index_cpp::PackageNotFoundError & ex) {
throw std::runtime_error("Package " + package_name + " not found. Error: " + ex.what());
}
}

if (navmap_ros::io::load_from_file(map_path_, navmap_)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ void ObstacleFilter::update(::easynav::NavState & nav_state)
std::vector<::navmap::NavCelId> marked;

// Only the points around the robot and below its height (robot frame), downsampled first
// (indices only) so that fewer points are transformed.
// (indices only) so that fewer points are transformed. Each perception with the robot's pose
// when it was taken (TF at its stamp, exact_time): with the latest pose, a cloud taken while the
// robot turns lands rotated, and walls seen a fraction of a second ago fall on free ground as
// obstacles (out of the sensor's range they are never cleared).
const auto & points = PointPerceptionsOpsView(perceptions)
.downsample(downsample_resolution_)
.fuse(tf_info.robot_frame)
.fuse(tf_info.robot_frame, true)
.filter({-max_range_, -max_range_, NAN}, {max_range_, max_range_, max_height_}, false)
.fuse(map_frame)
.fuse(map_frame, true)
.as_points();

// The robot's position, for min_height_per_meter and for the clearing rays
Expand Down