Conversation
|
This PR is just a draft for now, I wanted to move it out of the lidar and autonomy changes to seperate them. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a costmap seeding package that downloads 1-meter resolution elevation data from CanElevation, generates PNG traversability files, and loads them into the costmap to provide terrain insights for rover navigation. The implementation includes downloading DTM files, calculating traversability costs based on slope and roughness metrics, and real-time map loading based on GPS position.
Key changes include:
- Core elevation data downloading and processing functionality
- Real-time costmap loading based on GPS coordinates with covariance filtering
- Traversability cost calculation using slope and roughness analysis
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/costmap_seeding/costmap_seeding/download_can_elevation_maps.py | Main downloader node with DTM processing and traversability cost calculation |
| src/costmap_seeding/costmap_seeding/load_can_elevation_maps.py | Map loader node for real-time costmap publishing based on GPS location |
| src/costmap_seeding/costmap_seeding/fake_gps_publisher.py | Test utility for publishing fake GPS data |
| src/costmap_seeding/setup.py | Package setup and entry point configuration |
| src/costmap_seeding/package.xml | ROS package metadata and dependencies |
| src/costmap_seeding/config/can_elevation_downloader_params.yaml | Configuration parameters for the downloader node |
| src/costmap_seeding/launch/download_can_elevation.launch.py | Launch file for the elevation downloader |
| setup/install_nav_deps.sh | Setup script updated to create required directories |
Comments suppressed due to low confidence (2)
src/costmap_seeding/costmap_seeding/download_can_elevation_maps.py:2
- Multiple imports should be on separate lines according to PEP 8 style guidelines.
from rclpy.node import Node
src/costmap_seeding/costmap_seeding/download_can_elevation_maps.py:726
- Converting the scaling factor to int may cause precision loss. Consider using round() instead of int() to ensure proper rounding behavior.
0,
| <package format="3"> | ||
| <name>costmap_seeding</name> | ||
| <version>0.0.0</version> | ||
| <description>TODO: Package description</description> |
There was a problem hiding this comment.
The package description is still a TODO placeholder. It should provide a meaningful description of the costmap seeding functionality.
| <description>TODO: Package description</description> | |
| <description>Provides functionality for initializing and modifying costmaps used in robotic navigation systems.</description> |
| <version>0.0.0</version> | ||
| <description>TODO: Package description</description> | ||
| <maintainer email="erikcaell@gmail.com">erik</maintainer> | ||
| <license>TODO: License declaration</license> |
There was a problem hiding this comment.
The license field contains a TODO placeholder and should specify the actual license for the package.
| <license>TODO: License declaration</license> | |
| <license>Apache-2.0</license> |
| maintainer="erik", | ||
| maintainer_email="erikcaell@gmail.com", | ||
| description="Seed the nav2 costmap with elevation data from a online elevation datasets", | ||
| license="TODO: License declaration", |
There was a problem hiding this comment.
The license field contains a TODO placeholder and should specify the actual license for the package.
| license="TODO: License declaration", | |
| license="MIT", |
| zip_safe=True, | ||
| maintainer="erik", | ||
| maintainer_email="erikcaell@gmail.com", | ||
| description="Seed the nav2 costmap with elevation data from a online elevation datasets", |
There was a problem hiding this comment.
Grammar error: 'a online' should be 'an online'.
| description="Seed the nav2 costmap with elevation data from a online elevation datasets", | |
| description="Seed the nav2 costmap with elevation data from an online elevation datasets", |
| self.map_publisher = self.create_publisher( | ||
| OccupancyGrid, "/blank_map", qos_profile_transient | ||
| ) | ||
| self.get_logger().info("OccupancyGrid publisher created on /map_can_elevation.") |
There was a problem hiding this comment.
The log message states the publisher is on '/map_can_elevation' but the actual topic is '/blank_map' (line 100). This inconsistency could confuse debugging.
| self.get_logger().info("OccupancyGrid publisher created on /map_can_elevation.") | |
| self.get_logger().info("OccupancyGrid publisher created on /blank_map.") |
| Altitude covariance is ignored as per user request. | ||
| """ | ||
| # Check if covariance type is known or approximated and variances are low | ||
| # msg.position_covariance_type = NavSatFix.COVARIANCE_TYPE_KNOWN # This line forces it, remove if not intended |
There was a problem hiding this comment.
Commented-out code should be removed rather than left in the codebase. If this is for debugging purposes, consider using a parameter or removing it entirely.
| # msg.position_covariance_type = NavSatFix.COVARIANCE_TYPE_KNOWN # This line forces it, remove if not intended |
| msg.position_covariance_type = 3 | ||
|
|
||
| self.publisher_.publish(msg) | ||
| # self.get_logger().info(f'Publishing GPS Fix at {msg.header.stamp.sec}.{msg.header.stamp.nanosec}') |
There was a problem hiding this comment.
Commented-out code should be removed rather than left in the codebase.
| # self.get_logger().info(f'Publishing GPS Fix at {msg.header.stamp.sec}.{msg.header.stamp.nanosec}') |
This PR introduces a costmap seeding package which downloads 1 meter resolution elevation data from CanElevation, generates PNG traversability files, then can load the traversability PNGs into the costmap live to give the rover insight into the terrain ahead.
Bug as of July 23, 2025: It is off by around 50 meters. My current best guess on why is because the CanElevation data is downloaded and stored in lat lon values in a world UTM standard, but when this is loaded into the global map using /fromLL and /toLL of the navsat transform node, it uses something else, like a dynamic datum and a different standard. Need to investigate that and correct for it.