Tuning navigation - Great improvements#115
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tunes Nav2 planning/control/smoothing parameters, updates launch-time cmd_vel remapping behavior, adjusts robot_localization EKF sensor fusion settings for GPS/wheel/IMU inputs, and refactors mission cancellation/update flow in the nav commander to avoid executor deadlocks.
Changes:
- Retuned Nav2 planner/smoother/controller and velocity smoother limits for improved path quality and outdoor swerve behavior.
- Updated Nav2 launch to explicitly remap
cmd_vel/cmd_vel_smoothedtopic flow. - Modified mission cancellation/update handling and updated GPS base station launch + added known GPS coordinate files.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nav/navigation/params/nav2.yaml | Planner/smoother/controller tuning and velocity smoother limit changes. |
| src/Nav/navigation/launch/nav2.launch.py | Cmd_vel and cmd_vel_smoothed remapping adjustments for composed and non-composed bringup. |
| src/Nav/nav_commanders/nav_commanders/cprt_commander.py | Mission cancellation/update logic refactor and BT path resolution changes. |
| src/Nav/nav_commanders/known_gps_coords/edc_home.yaml | Adds a named lat/lon coordinate. |
| src/Nav/nav_commanders/known_gps_coords/edc_grass1.yaml | Adds a named lat/lon coordinate. |
| src/Nav/localization/config/ekf/gps_ekf_local.yaml | Updates local EKF fusion configuration for GPS/wheel odom/IMU inputs. |
| src/Nav/localization/config/ekf/gps_ekf_global.yaml | Updates global EKF fusion configuration for GPS/wheel odom/IMU inputs. |
| src/Nav/gps/launch/basestation.launch.py | Switches to new base station node and updates serial/survey-in parameters. |
| src/Nav/compressed_telemetry_cpp/rviz/compressed_nav2.rviz | RViz frame/display updates (e.g., add utm, remove unused links, view tweaks). |
Comments suppressed due to low confidence (5)
src/Nav/navigation/launch/nav2.launch.py:249
- This node no longer uses the shared
remappingslist, which drops the/tfand/tf_staticremaps and bypasses thecmd_vel_topiclaunch argument. It also introduces cmd_vel remaps that should likely be added on top of the common remappings for consistency. Consider composing remappings (common + cmd_vel/cmd_vel_smoothed) instead of replacing them.
Node(
package="nav2_velocity_smoother",
executable="velocity_smoother",
name="velocity_smoother",
output="screen",
namespace=namespace,
respawn=use_respawn,
respawn_delay=2.0,
parameters=[configured_params],
remappings=[
("cmd_vel", "cmd_vel_nav"),
("cmd_vel_smoothed", "cmd_vel"),
],
),
src/Nav/navigation/launch/nav2.launch.py:291
- The composed controller_server also replaces the shared
remappingslist, dropping/tfand/tf_staticremaps and ignoring thecmd_vel_topiclaunch argument. For consistency with the non-composed path and other nodes, consider appending the cmd_vel remap to the existingremappingslist instead.
ComposableNode(
package="nav2_controller",
plugin="nav2_controller::ControllerServer",
name="controller_server",
parameters=[configured_params],
remappings=[("cmd_vel", "cmd_vel_nav")],
),
src/Nav/navigation/launch/nav2.launch.py:348
- The composed velocity_smoother also replaces the shared
remappingslist, dropping/tfand/tf_staticremaps and ignoring thecmd_vel_topiclaunch argument. Consider composing remappings (common + cmd_vel/cmd_vel_smoothed) to keep TF/topic remapping behavior consistent across all nav2 nodes.
ComposableNode(
package="nav2_velocity_smoother",
plugin="nav2_velocity_smoother::VelocitySmoother",
name="velocity_smoother",
parameters=[configured_params],
remappings=[
("cmd_vel", "cmd_vel_nav"),
("cmd_vel_smoothed", "cmd_vel"),
],
src/Nav/navigation/params/nav2.yaml:211
- The
optimizer.max_iterationscomment says "reduced from 70 for faster convergence" but the value is now 80, and the tolerance-related comments were removed while values changed substantially. Please update the comment to reflect the current intent (higher iterations vs. convergence criteria) to avoid confusion when tuning.
optimizer:
max_iterations: 80 # max iterations of smoother (reduced from 70 for faster convergence)
debug_optimizer: false # print debug info
gradient_tol: 5000.0
fn_tol: 1.0e-15
param_tol: 1.0e-20
src/Nav/nav_commanders/nav_commanders/cprt_commander.py:131
- Behavior tree paths are now hard-coded to
/rover/install/..., which will fail in non-container setups, local dev workspaces, or when the install prefix changes. Prefer resolving viaget_package_share_directory('navigation')(or a launch/parameter override) and only fall back to a fixed path if needed.
# Dynamically resolve BT paths
# nav_pkg_share = get_package_share_directory("navigation")
nav_pkg_share = "/rover/install/navigation/share/navigation"
self.nav_bt_path = os.path.join(
nav_pkg_share, "behavior_trees", self.nav_bt_file
)
self.search_bt_path = os.path.join(
nav_pkg_share, "behavior_trees", self.search_bt_file
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+32
to
+33
| {"SvinMindur": 300}, # Survey in time (s) | ||
| {"SvinMinAccDur": 10_000}, # Survey in accuracy (mm) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several important changes across navigation, localization, and visualization configurations, with the main goals of improving navigation behavior, updating GPS handling, and enhancing system robustness. The changes include updates to launch files for better velocity command remapping, adjustments to EKF localization parameters, improvements to mission cancellation handling to avoid deadlocks, and tuning of path planning parameters for better path quality and safety.
Navigation and Velocity Command Handling:
nav2.launch.pyto explicitly remapcmd_velandcmd_vel_smoothedtopics for the navigation stack and velocity smoother, ensuring correct topic flow and compatibility with other components. [1] [2] [3] [4]Localization and EKF Configuration:
Mission Handling and Deadlock Prevention:
cprt_commander.pyto run potentially blocking operations likenavigator.cancelTask()in background threads, preventing deadlocks in the ROS 2 executor and improving reliability during mission updates and target detection. [1] [2] [3] [4]GPS and Launch Configuration:
gps_base_pub_node), updated device path and baudrate, and revised survey-in parameters for improved RTK base station operation.edc_grass1andedc_homelocations. [1] [2]Navigation Parameter Tuning:
max_planning_time, increasedminimum_turning_radius, and raised non-straight and cost penalties to favor safer, more predictable paths.Additional Improvements:
utm), remove unused links, and adjust camera and view settings for better visualization. [1] [2] [3] [4] [5] [6]cprt_commander.pyto use a static install path, improving deployment reliability.These changes collectively improve the system's navigation robustness, localization accuracy, and operational reliability, especially in mission-critical scenarios.