This repository contains a customized navigation system based on the ROS 2 Navigation Stack (Nav2), adapted for DIT Robotics' Eurobot 2027 competition requirements.
Enables smooth and efficient autonomous movement.
- Uses
/nav_to_poseand/nav_thru_posesaction servers for basic navigation.
Seamlessly integrates docking and navigation for autonomous charging or station return.
- Utilizes the
/dock_robotaction server to control the docking process.
Offers a variety of commands for enhanced control and flexibility:
/stopRobot: Lock/unlock the robot./keepout_zone: Dynamically set keepout zones to avoid certain areas./dock_robot: Supports flexible keyword-based commands via thedock_typeparameter.rival_param.yaml: Supports dynamic rival data setup adjustments.
Control the robot's emergency stop or resume behavior via the /stopRobot topic.
true: Immediately stops and locks the robot.false: Unlocks and resumes normal operation.- Message Type:
std_msgs/msg/Bool
The keepout zones correspond to specific regions on the Eurobot 2027 field, used to restrict robot access dynamically via /keepout_zone.
- Pantry zones are labeled A through J on the field map.
- Hazelnut zones are labeled K through R on the field map.
- These zones can be toggled at runtime using the
/keepout_zonetopic. - Suitable for strategic behaviors like avoiding opponent areas or obstacle fields.
- Message Type:
std_msgs/msg/String - parameter settings:
global_costmap:
global_costmap:
ros__parameters:
keepout_layer:
inflation_length: 0.15 # distance over which cost is inflated
cost_scaling_factor: 5.0 # higher value -> steeper cost increase
keepout_expand_mode: 1 # 0: Circle, 1: Squaresee more about the params /navigation2_run/params/nav2_params_default.yaml
We use the TEB controller with multiple profiles (Fast/Slow/LinearBoost/AngularBoost) tuned for different speeds and obstacle conditions.
Main features:
-
Time‑elastic band optimization
Optimizes a short‑horizon trajectory (poses + timing) to satisfy kinematic limits while progressing toward the goal. -
Obstacle‑aware trajectory shaping
Penalizes proximity to obstacles and can slow down or replan when the costmap indicates blocked space ahead. -
Goal handling
Uses goal distance thresholds to decide when to stop in position vs. rotate toward the final heading. -
Profile‑based tuning
Different parameter sets for fast/slow/boost behaviors (e.g., max_v/max_w, obstacle distances, cooldowns).
See more about the params /navigation2_run/params/nav2_params_default.yaml
-
SmacPlanner2D
-
Straight-line refinement
SMAC 2D expands 8-connected neighbors, which can produce zig-zag paths even in free space. We add a line-of-sight check after A* (LineIterator + collision check): if a straight segment is collision-free, intermediate nodes are skipped and the segment is resampled into evenly spaced points with consistent orientation. This yields straighter, smoother paths. -
New parameters (planner_server -> GridBased)
straight_line_max_skip_points: max nodes to skip for line-of-sight jumpstraight_line_resample_points: points per segment (used when spacing <= 0)straight_line_resample_spacing: fixed spacing (meters), overrides points
-
-
NavfnPlanner2D
-
Straight-line refinement
- use linear scale to mapping global costmap into navfn costmap (cost 1~254), not use COST_NEUTRAL as base.
- add function to fix the oscillation and stagnation issues during path extraction, including plateau detection and fallback mechanisms for better robustness in complex environments.
- add obstacle bias in A* updates to penalize high-cost cells.
- adjust A* heuristic scaling, encouraging safer path choices.
-
New parameters (planner_server -> GridBased)
-
# A* / propagation parameters
heuristic_scale: 1.0 # Weight of heuristic term in A* (higher = more greedy toward goal)
priority_increment_scale: 2.0 # Scale factor for A* priority threshold increment (larger = faster but less optimal)
# Obstacle-aware bias
obstacle_bias_scale: 0.4 # Strength of extra cost added for high-cost cells to avoid obstacles/inflation (0.15 ~ 0.5)
obstacle_bias_offset: 10.0 # Cost offset before obstacle bias is applied (ignore small cost variations) (3.0 ~ 10.0)
# Path extraction / fallback
plateau_stagnation_steps: 3 # Number of stagnant steps to trigger plateau handling
min_gradient_norm: 0.9 # Minimum gradient norm to continue path extraction without fallback
potential_epsilon: 1.0e-3 # Minimum potential decrease to reset stagnation counter(Keyword order does not matter and is designed for compatibility.)
-
Template Base:
dock: Triggers the docking process.
-
Functional Tags:
- Controller Type:
fast,slow,linearBoost,angularBoost - Goal Checker Type:
precise,loose - Offset Direction:
x,y,z - Docking Style:
ordinary,gentle,rush - Special Control:
delaySpin
- Controller Type:
rival_parameters:
rival_inscribed_radius: *data(double)*This repository includes a convenient nav2.sh script for managing Docker containers and development workflows.
- Clone the repository:
git clone https://github.com/DIT-ROBOTICS/Eurobot-2027-Navigation2.git
cd Eurobot-2027-Navigation2- Install the
nav2command globally:
./nav2.sh install- Add to your PATH (if not already added):
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcOnce installed, you can use the following commands from anywhere:
Build & Development
nav2 rebuild- Rebuild Docker imagesnav2 build- Build the entire ROS2 workspacenav2 dev- Enter interactive development shell
Running Services
nav2 run- Launch Navigation2 stack (detached)nav2 vnc- Start VNC server with GUI support (port 5901)
Container Management
nav2 stop [service]- Stop containers (all or specific: build, dev, run, vnc)nav2 ps- Show running containers statusnav2 clean- Stop all and remove containers
Monitoring & Debugging
nav2 logs [service]- View container logs (follow mode)nav2 exec <service> <cmd>- Execute command in running container- Example:
nav2 exec dev "ros2 topic list"
- Example:
Help
nav2 tools- Show detailed command reference
- build - Compiles the ROS2 workspace using
colcon build - dev - Development environment for testing and debugging
- run - Runs the main navigation stack (
real_launch.py) - vnc - Provides GUI access via VNC (useful for rviz2)
# Build the workspace
nav2 build
# Enter development container
nav2 dev
# Inside the container, you can:
# - source install/local_setup.bash
# - ros2 launch navigation2_run real_launch.py
# - ros2 topic list
# - rviz2
# Run navigation (detached)
nav2 run
# Check logs
nav2 logs run
# Stop a specific service
nav2 stop runFor detailed environment setup instructions and Docker configurations, please refer to the docker/ directory.
Eurobot-2027
└── Eurobot-2027-ws/
└── src/
├── Eurobot-2027-Navigation2/ # Core navigation system code
├── custom_bts/ # Custom behavior trees
├── custom_controller/ # Custom controller plugins
├── custom_layer/ # Custom costmap layers
├── navigation2_run/ # Navigation system packages
├── Navigation2/ # Modified version of Nav2
└── opennav_docking/ # Docking server implementation
└── Eurobot-2027-Navigation2-envs/ # Docker environments
├── Navigation2-humble-local/ # Local PC environment
└── Navigation2-humble-deploy/ # Remote machine environment
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Portions of this software are based on the ROS 2 Navigation Stack (Nav2), which is licensed under the Apache License 2.0. See the Navigation2 submodule for more details.
For any issues or inquiries, please open an issue on GitHub or contact the DIT Robotics team.

