-
Notifications
You must be signed in to change notification settings - Fork 192
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
Relative Variants of Voxel and Passthrough Filters and Footprint Projection for Slope Navigation #304
base: ros2
Are you sure you want to change the base?
Conversation
It seems to me that you're filtering out the data below a minimum height when the robot is non-flat. Why not use then the |
I encountered the issues I described while using the This happens because the For robots navigating uneven surfaces, it would be beneficial to temporarily switch to the robot's local frame to classify obstacles accurately, regardless of changes in elevation. This intermediate step would ensure the system remains robust, whether the robot is operating on slopes, or multiple flat surfaces, without relying solely on the global frame's Z-boundaries. Another issue is clearing the robot's footprint. Default footprint transformation from |
I spent some time to philosophically think about this. How I've thought about non-flat terrain was to segment out the ground via height, terrain estimation, AI, or other methods and then once the ground is roughly removed, to feed the remaining data into things like STVL or VL. The idea being that 'what is ground' and how to accurately remove it is very application dependent and its better to push that into a pre-stage than bake every one of I don't think after reviewing this that this would effectively deal with remoing the ground for sloped navigation. I don't doubt that it makes it less-bad because you're working with the immediate base frame which removes the Z- related issues, but there can still be alot of local variation around the robot's base roll/pitch orientation (ex: you're on the side of a hill not pointed upward or downward of it, but sideways) that would mark ground that's navigable as obstacles I'm not against including this change however, but food for thought. I'm going to make some semi-pedantic code changes so we remove unnecessary TF lookups for when they're not required (and make the code more easily understandable for the fast observer). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the new parameters / feature to the readme docs
spatio_temporal_voxel_layer/include/spatio_temporal_voxel_layer/spatio_temporal_voxel_layer.hpp
Outdated
Show resolved
Hide resolved
spatio_temporal_voxel_layer/src/spatio_temporal_voxel_layer.cpp
Outdated
Show resolved
Hide resolved
spatio_temporal_voxel_layer/src/spatio_temporal_voxel_layer.cpp
Outdated
Show resolved
Hide resolved
spatio_temporal_voxel_layer/src/spatio_temporal_voxel_layer.cpp
Outdated
Show resolved
Hide resolved
spatio_temporal_voxel_layer/src/spatio_temporal_voxel_layer.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise generally looks good now. I would like you to lint the file though, the formatting is inconsistent in places and its a bit distracting. Use ament_cpplint
and ament_uncrustify
and I can merge these in.
Please just verify to me that you tested all 4 modes and they continue to work as expected
@@ -113,7 +113,9 @@ rgbd_obstacle_layer: | |||
observation_persistence: 0.0 #seconds | |||
max_obstacle_height: 2.0 #meters | |||
mark_threshold: 0 #voxel height | |||
update_footprint_enabled: true | |||
update_footprint_enabled: true | |||
footprint_projection_enabled: true #default off, recommended when using 3d IMU data. Uses tf2 to transform the footprint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set to false
here, most people copy/paste this for use so it should be kept as a good default-centric baseline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think somewhere in the readme, we need to have some explanation of your relative filters + how to set it up, so that its clear for later users how to use it and why its useful
declareParameter("footprint_projection_enabled", rclcpp::ParameterValue(false)); | ||
node->get_parameter(name_ + ".footprint_projection_enabled", _footprint_projection_enabled); | ||
// robot base frame ( necessary for 3d footprint projection ) | ||
declareParameter("robot_base_frame", rclcpp::ParameterValue(std::string(""))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it base_link or something reasonable please
update to use changes in main repo
[Feature] Added Relative Variants of Voxel and Passthrough Filters and Footprint Projection for Slope Navigation
Summary
This PR introduces new "relative" variants of the voxel and passthrough filters, which allow for more accurate obstacle detection on non-horizontal surfaces. By making the obstacle detection bounds relative to a customizable
z_reference_frame
(rather than the world frame), robots can now navigate uneven terrain without encountering the previous issues observed in Gazebo with the robot_localization and Nav2 stacks. The feature for clearing the robot footprint was also updated to provide an option to use 3D IMU orientation to project the footprint on the costmap.These updates ensure improved behavior when broadcasting the robot's state with both 3D IMU orientation and
z
position on slopes, without causing unexpected navigation issues. The changes are implemented to ensure full backward compatibility with projects running the current version of SVTL.Problem Description
z
position: Since obstacle bounds are relative to the world frame, any change in the robot'sz
position altered the effective obstacle heights for the robot.z
coordinates in the world frame were not registered correctly since their globalz
coordinate was smaller than their height relative to the surface. On uphill slopes, the terrain itself could be mistakenly registered as an obstacle.Solution
The newly introduced "relative" filter variants enable the robot’s obstacle detection to account for slopes by using the
z_reference_frame
parameter from the observation source, rather than relying on the world frame. This achieves:z
position: This ensures consistent behavior regardless of altitude relative to the world frame.This issue was solved by introducing a footprint projection feature, which, if enabled, processes clearing the robot's footprint by transforming it using
tf2
instead of theCostmap2D
footprint transformation. This provides an accurate projection of the footprint on the XY plane.Known Limitations
Usage
To use the new features, the configuration file needs to be modified:
"voxel_relative"
and"passthrough_relative"
values for the filter attribute of the observation source.z_reference_frame
parameter, added to the observation source, sets the frame used to evaluate thez
of each point of observation to determine if it is an obstacle. It defaults to the world frame of the layered costmap.footprint_projection_enabled
activates projecting the footprint usingtf2
and is strongly recommended if using 3D localization. It defaults tofalse
.footprint_frame
sets the frame from which the footprint is transformed to the global frame. It is necessary to set this when using footprint projection. The recommended setting is the robot's base frame (manual setting is necessary because the parameter is inaccessible through the layered costmap).