Skip to content

Conversation

@ErikCald
Copy link
Contributor

@ErikCald ErikCald commented Feb 3, 2026

Made a few changes to improve nav2 for the better chassis.

Some notable things:

  • fixed bug in cprt_costmap_plugins::GridmapLayer that was clamping our 200 lethal cost threshold to 100
  • Replaced costmap footprint with a tiny robot_radius since the planner and controller should be driving like an infinitely small point because its handled by elevation mapping inflation filter.
  • Set global costmap robot_radius to 0.2 meters more than local costmap so the planner goes farther away than the collision checking to avoid getting stuck
  • Increased update frequency of costmaps so its more update to date when its used
  • Rotation shim controller
  • Tighter turning radius
  • New recovery in bt: backup 0.3 meters then spin 180 degrees

This commit is easier to read the changes since I moved the order of some configs in nav2.yaml first: c02fbd2

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements navigation stack improvements for a swerve drive chassis upgrade, transitioning from a skid-steer platform to a 4-wheel independent swerve drive system. The changes focus on optimizing Nav2 configuration for the new chassis capabilities, fixing critical bugs in custom costmap plugins, and implementing swerve-specific control strategies.

Changes:

  • Fixed critical costmap plugin bug that was clamping lethal cost threshold to 100 instead of 255, preventing proper gradient representation
  • Replaced footprint-based collision checking with point robot configuration, leveraging upstream elevation mapping inflation
  • Implemented rotation shim controller to enable point-turn-before-drive behavior for swerve chassis
  • Updated behavior tree with forward-only recovery sequence (backup 0.3m, then spin 180°)
  • Fixed "trasversability" → "traversability" spelling errors across multiple configuration files
  • Increased costmap update frequencies from 1-2 Hz to 10 Hz for more responsive collision checking
  • Reduced minimum turning radius from 0.80m to 0.40m to leverage tighter swerve turning capability

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Nav/navigation/params/nav2.yaml Major configuration overhaul: implemented point robot costmap strategy, rotation shim controller, tighter planner parameters, updated velocity limits for indoor testing
src/Nav/navigation/launch/nav2.launch.py Added namespace parameter to all nav2 nodes and changed default behavior tree to swerve-specific version
src/Nav/navigation/config/elevation_mapping/postprocessing_traversability.yaml Fixed typo in output_topic from "trasversability_map" to "traversability_map"
src/Nav/navigation/behavior_trees/bt_swerve_dynamic_replanning.xml New behavior tree with swerve-optimized recovery actions (backup + 180° spin sequence)
src/Nav/navigation/2026_changes.md Comprehensive implementation guide documenting all 2026 navigation upgrades and architectural decisions
src/Nav/localization/config/rviz.views/basicNavMap.rviz Updated topic reference from "/trasversability_map" to "/traversability_map"
src/Nav/elevation_mapping/rviz2/zed2i.rviz Updated topic reference from "/trasversability_map" to "/traversability_map"
src/Nav/elevation_mapping/config/postprocessing/traversability_pipeline.yaml Fixed typo in output_topic from "trasversability_map" to "traversability_map"
src/Nav/cprt_costmap_plugins/src/gridmap_layer.cpp Critical fix: changed lethal_threshold clamp from 100 to 255, and fixed default layer_name spelling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

plugin: "cprt_costmap_plugins::GridmapLayer"
enabled: true
map_topic: "/trasversability_map"
map_topic: "/traversability_map"
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spelling correction from "trasversability" to "traversability" should also be applied to this rviz configuration file to maintain consistency across the codebase. The file src/Nav/navigation/rviz/traversibility_gridmap.rviz still contains the misspelling on lines 225 and 251.

Copilot uses AI. Check for mistakes.
# Regulated Pure Pursuit Parameters (Driving Logic)
transform_tolerance: 1.0

desired_linear_vel: 0.3 # Increase to 1.0 for outdoor swerve agility
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation file describes setting desired_linear_vel: 1.0 for outdoor swerve agility (line 73 of 2026_changes.md), but the actual configuration sets it to 0.3 with a comment suggesting to increase it to 1.0 later. This discrepancy between the documentation's recommendation and the actual implementation could cause confusion. Consider updating the documentation to reflect that the current implementation uses conservative values for indoor testing, matching the actual configuration.

Copilot uses AI. Check for mistakes.
global_costmap:
ros__parameters:
update_frequency: 2.0
update_frequency: 10.0
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation file states "Global costmap runs at ~2Hz (sufficient for static terrain)" at line 184 of 2026_changes.md, but the actual configuration sets the global costmap update_frequency to 10.0 Hz. This inconsistency should be resolved. Based on the PR description mentioning "Increased update frequency of costmaps so its more update to date when its used", it appears the 10Hz value is intentional, so the documentation should be updated to reflect this change.

Copilot uses AI. Check for mistakes.
@ErikCald ErikCald merged commit 19820d1 into main Feb 7, 2026
8 of 10 checks passed
@ErikCald ErikCald deleted the nav2-swerve branch February 7, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants