turtlebot3: run the simulator, the map and the pose in the same place - #76
Open
bburda wants to merge 2 commits into
Open
turtlebot3: run the simulator, the map and the pose in the same place#76bburda wants to merge 2 commits into
bburda wants to merge 2 commits into
Conversation
The headless profile passed gz_args as separate tokens, and launch joins those with no separator, so the simulator was started with one glued argument "-r-s-v2<world>" and never ran the world. No sensor data reached ROS, the global costmap never got its transform, planner_server hung in Activating, and the lifecycle manager aborted the whole navigation bringup. Keeping the separator inside the string is the form ros_gz_sim expects. The map yaml carried origin [-1.76, -2.42] while the map.pgm it points at ships with [-10.0, -10.0], so the map sat about eight metres away from the robot. The spawn point then fell outside the global costmap and every plan was refused with "Start Coordinates ... was outside bounds". AMCL was configured to start at (0, 0) while the robot spawns at (-2.0, -0.5). Headless has no RViz to correct that by hand, so the covariance stayed high and the robot could not follow a path. Add tests/smoke_test_navigation.sh, which asserts the lifecycle nodes reach active, the robot is inside the costmap, a goal completes and localization stays certain. It runs in the existing turtlebot job, on the stack that job already starts. The other smoke test deliberately does not navigate, which is how all three of these could ship together unnoticed.
The localization check passed whenever the fault list could not be read, so an unreachable gateway looked like healthy localization, and it read the whole fault list rather than this run's, which matters because the default profile confirms on one event and never heals: one uncertain moment at startup would have failed every later run against the same container. It now distinguishes "no fault" from "could not read", takes a baseline before driving, and requires the detector to be registered so an empty list means something. It also failed on a healthy stack. AMCL's spread widens while the robot drives and touches 0.307 against a warn threshold of 0.300, so the check now keys on the error severity above a covariance of 1.0. With the initial pose deliberately put back to (0, 0) the goals stop completing while this check still passes, so the goals are what pin that value and the comment now says so. Drive two goals instead of one, the second back to the spawn point. A single goal left the robot standing on it, and the goal checker's xy_goal_tolerance is 0.25 m, so a second run against the same container reported success without moving. Bound the waiting. Every request in the shared smoke library ran without a timeout, so a wedged gateway could hold a job until the six hour default. Requests now time out, the lifecycle and goal budgets are halved, and the turtlebot job carries a timeout of its own.
mfaferek93
reviewed
Sep 10, 2026
| status="running" | ||
| elapsed=0 | ||
| while [ "$elapsed" -lt "$GOAL_TIMEOUT" ]; do | ||
| status=$(curl -s -m 20 \ |
Contributor
There was a problem hiding this comment.
smoke_lib.sh:8 has set -euo pipefail and this assignment has no || true, so one curl timeout or connection reset ends the whole script (reproduced with an unreachable port: rc 7, "exited abnormally") instead of the goal being recorded as failed. lifecycle_state at 78-81 already captures the body first with || true; same pattern here.
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.
Description
Three settings had drifted apart in the headless turtlebot3 profile, and together they stopped the
demo from navigating at all. Each one hid the next, so they had to be found in order.
The simulator was never given the world.
gz_argswas passed as separate tokens, and launchjoins those with no separator, so gz started with one glued argument:
No sensor data reached ROS, so AMCL never published the map to odom transform, the global costmap
could not activate,
planner_serversat inActivatingfor 68 seconds and the lifecycle managergave up on the whole stack:
The map was in the wrong place.
turtlebot3_world.yamlcarriedorigin: [-1.76, -2.42]whilethe
map.pgmit points at ships in turtlebot3_navigation2 withorigin: [-10.0, -10.0]. The maplanded about eight metres from the robot, so the spawn point at (-2.0, -0.5) sat outside the map
rectangle. This one only bites once the pose below is right: Nav2 plans from the estimated pose, and
the old configuration estimated (0, 0), which was still inside the old bounds. With the pose
corrected and the origin still wrong, every plan is refused before it starts:
AMCL started somewhere the robot is not. It was configured at
(0, 0)while the robot spawnsat
(-2.0, -0.5). Headless has no RViz to set the pose by hand, so the covariance stayed high andthe robot could not follow a path.
Related Issue
closes #75
Testing
New
tests/smoke_test_navigation.shruns in the existing turtlebot job, on the stack that jobalready starts, so it costs no extra build. Measured against a running demo, 10 passed and 0 failed:
Each fix was then reverted on its own, to check the test fails when the bug comes back:
The localization check is a guard against AMCL losing the robot altogether, not the check that pins
the initial pose: under that last mutation the goals fail while it still passes. It keys on error
severity on purpose, because a healthy drive touches a covariance of 0.307 against the detector's
warn threshold of 0.300, and failing on that would turn the demo doing its job into a red build.
The second goal is there because the goal checker's
xy_goal_toleranceis 0.25 m: with one goal therobot ends up standing on it, and a second run against the same container reported success without
moving.
The existing
tests/smoke_test_turtlebot3.shstill passes 49 of 49 on the same stack, includingafter the shared smoke library gained request timeouts.
One thing outside this branch: the spawn point stays configurable through
x_poseandy_posewhile the AMCL pose is a fixed value in the parameter file, so overriding the spawn recreates the
mismatch. That coupling predates this change and is not addressed here.
Benchmark baselines for this demo are no longer comparable with older runs, because the simulator
and the navigation stack now actually run.
With all three in place the demo raises its navigation faults for real for the first time: a goal
sent while the stack was misconfigured produced
NAVIGATION_GOAL_ABORTEDfrom/bridge/anomaly_detector/goal_statusthrough the detector itself, not through injection.Checklist