Robot deployment fixes: the bag recorder never launched, and identity resolution failed silently - #377
Draft
JohnYanxinLiu wants to merge 4 commits into
Draft
Robot deployment fixes: the bag recorder never launched, and identity resolution failed silently#377JohnYanxinLiu wants to merge 4 commits into
JohnYanxinLiu wants to merge 4 commits into
Conversation
JohnYanxinLiu
marked this pull request as draft
August 3, 2026 02:53
LOG_CONFIG selects which topic set in logging_bringup/config to record, default log.yaml. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JohnYanxinLiu
force-pushed
the
johnliu/robot-deployment-fixes
branch
from
August 4, 2026 15:43
5710c4b to
fd4b131
Compare
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.
What features did you add and/or bugs did you address?
None — both bugs were found while porting fixes back from a real mocap-room Jetson
deployment. Independent of the OptiTrack stack (#374/#375/#376); can merge in either order.
1.
RECORD_BAGS=truenever brought the bag recorder up on a robot.robot-base-docker-compose.yamlhas forwarded the variable since #318, butlogging_bringup/launch/logging.launch.xmlhardcodedrecord_bag=falseandonboard_autonomy_all.launch.xmlincludes it with no arguments, so nothing ever overrodethe default. Only
gcs.launch.xmlread the variable — which is why the flag looksfunctional if you only check the GCS.
The consequence is worse than "no bags": with no
bag_recordnode running, the GCScontrol panel's start/stop toggle had no subscriber.
rqt_airstack_control_panelpublishes
set_recording_status, and bothonboard_all/config/domain_bridge.yamlanddds_router.yamldeliberately bridge that topic across domains — all of it pointing at anode that never existed.
2. Falling back to
unknown_robot/ domain 0 was silent.On the
hostname-sourced profiles (l4t,voxl) the OS hostname is the robot'sidentity. A device whose name doesn't match
default_robot_name_map.yaml's.*robot-.*(\d+)rule hits the.*catch-all and boots cleanly asunknown_robotondomain 0, with no error. The symptoms — nothing under
/robot_<n>, per-robot configlookups keyed on
ROBOT_NAMEfinding no profile,zed-l4t(hardcodedROS_DOMAIN_ID=1) no longer seeing the stack — surface much later and far from the cause.N/A — both changes are console-observable. The new warning prints at container startup:
How did you implement it?
Bag recording —
logging.launch.xmlnow reads$(env RECORD_BAGS false)instead of ahardcoded
false, with an explicit default so it stays launchable when the variable isunset. Added
LOG_CONFIG(defaultlog.yaml) to select which topic set inlogging_bringup/configto record, forwarded inrobot-base-docker-compose.yaml.Deliberately not changed: recording still starts and stops via the GCS
set_recording_statustoggle. An earlier draft added anauto_startparameter tobag_record_node; that was dropped because the toggle is the intended control path and isalready bridged across domains on purpose.
bag_record_pidis untouched by this PR.Identity warning — the
unknown_robotfallback itself is unchanged. It is a sentinel,not a guess: it keeps an unidentified robot out of every real robot's namespace so it
can't fight one for a command topic. Changing it to default to
robot_1/domain 1 wasconsidered and rejected — a device that failed to identify itself would take a real
identity, and two aircraft publishing
/robot_1/interface/cmd_poseon one domain is aworse failure than an inert one.
The check tests the resolved identity rather than the sentinel value, because only one
of several failure paths yields
unknown_robot:unknown_robot/ 0ROBOT_NAMEemptymappingskeycontainer_namesource, Docker-DNS lookup failsname_to_mapempty, mapping block skippedresolve_robot_name.pyreports the middle three on stderr and prints nothing tostdout, so
evalassigns nothing andROBOT_NAMEis left empty — which is worse thanunknown_robot, sincepush_ros_namespacethen gets an empty namespace and topics landat the root. The check also sits outside the
if [ -n "$name_to_map" ]block so itstill fires in the fourth case, where that block is skipped entirely.
Removed dead config —
overrides/l4t-px4-realrobot.envsetROBOT_NAME="robot_1"/ROS_DOMAIN_ID="1". No compose service declares either variable, and Compose only injectswhat a service names in its
environment:block, so an env file could never set them.Verified with
grep -rn '${ROBOT_NAME\|${ROS_DOMAIN_ID' --include=*.yaml .— onlyROBOT_NAME_MAP_CONFIG_FILEis interpolated anywhere. Those lines have been inert since#371.
docs/robot/docker/robot_identity.mdand theconfigure-multi-robotskill bothprescribed that route and now point at the hostname or a map file instead.
How do you run and use it?
Bag recording — negative control first. This is what demonstrates the fix, since the
old failure was an absent node, not a broken one:
Then with the flag on:
Exercise the GCS toggle — the path that was unreachable:
Confirm
LOG_CONFIGis actually read:Identity warning — two one-liners cover both branches without editing any files:
Both print the warning at shell start.
Testing with PyTest
None. Both changes are container bring-up wiring, which the existing tiers don't cover
cheaply: the
unittier collects colcon package tests (this touches a launch file and ashell script, neither of which is a testable package), and
integration/systembothrequire a running stack.
What I did instead: exercised all five identity-resolution outcomes against the real
resolve_robot_name.pyand the real map files with a harness that sources the actual.bashrcblock, confirming the warning fires in exactly the four failure cases and staysquiet on success. Compose resolution was verified with
docker compose config --format jsonacross thedesktopandl4tprofiles.N/A. Existing suites should be unaffected —
airstack test -m unitfor a regression check.A maintainer should run the bring-up commands in the section above. The single most
telling check is the negative control:
ros2 node list | grep bag_recordreturns nothingon
developwithRECORD_BAGS=true, and returns/robot_1/bag_recordwith this branch.Possible follow-up: a
system-tier test assertingbag_recordappears underRECORD_BAGS=trueand reachesbag_recording_status: trueafter a toggle would cover thebag half properly. Happy to add it here if reviewers would rather it not land untested.
Documentation
n —
docs/robot/docker/robot_identity.mdis already in the nav (mkdocs.yml:106); thisedits that existing page rather than adding one.
Yes.
robot_identity.mdgains: a correction (an unmatched hostname does not makeresolve_robot_name.pyexit withROBOT_NAMEunset — the stock map's.*catch-allalways matches, so it boots silently as
unknown_robot), a note that onhostnameprofiles the device name is how a robot gets named at all rather than only how robots are
told apart, and a danger box explaining that setting
ROBOT_NAMEin an env file doesnothing. The
configure-multi-robotskill gets the same corrections plus a reordered fixlist that leads with the two routes that work.
The warning text above is the user-facing surface; there is no GUI component.
Versioning
Yes —
0.19.0-alpha.8->0.19.0-alpha.12, in its own commit (fd4b1319) per theconvention used by the OptiTrack stack.
alpha.9/.10/.11are claimed by #374/#375/#376,hence the jump to
.12; if this merges before that stack, those will need renumbering.Behavior change to flag for reviewers
Anyone currently running
RECORD_BAGS=truefor GCS bags will now also get abag_recordnode on every robot. It comes up idle and records nothing until the GCS toggle says so,
but it is not a no-op.
RECORD_BAGS=falseopts out.🤖 Generated with Claude Code