feat: 2-terminal demo scripts for ROS 1 <-> ROS 2 bridge#26
Merged
ycpss91255 merged 2 commits intomainfrom Apr 24, 2026
Merged
Conversation
This was referenced Apr 24, 2026
…yaml) Symmetric server/client pair that runs an end-to-end std_msgs/String bridge demo across two terminals. Server scripts self-bootstrap roscore + parameter_bridge with explicit step-by-step logs ([ros1_server] step N/5: ...); client scripts only source the relevant distro and subscribe. - script/ros1_server.sh + ros2_client.sh: Demo A (ROS 1 -> ROS 2) - script/ros2_server.sh + ros1_client.sh: Demo B (ROS 2 -> ROS 1) - config/demo_bridge.yaml -> /demo_bridge.yaml in image (no env override needed) - Dockerfile COPY script/ glob picks up the four new helpers automatically - 9 new smoke tests (28 -> 37): exists+executable + -h prints Usage for each script, plus /demo_bridge.yaml exists
…shells
Sourcing both ROS 1 (noetic) and ROS 2 (foxy) into the same shell breaks
roscore: it's a Python script that imports rosgraph_msgs.msg.Log, but
sys.path resolves rosgraph_msgs to ROS 2's copy (which lacks Log) when
ROS 2 is sourced last. Result on Jetson:
ImportError: cannot import name 'Log' from 'rosgraph_msgs.msg'
Restructure ros{1,2}_server.sh so the main shell never sources either
distro; each command runs in a subshell that sources only what it needs:
- roscore / rostopic / rosparam -> ROS 1 only
- parameter_bridge -> ROS 1 + ROS 2
- ros2 topic pub/echo -> ROS 2 only
Subshells use `( ros1_env; exec <cmd> )` so $! captures the actual
command PID (not a wrapper), keeping the trap cleanup correct.
Verified end-to-end on Jetson (arm64): both Demo A (ROS 1 -> ROS 2) and
Demo B (ROS 2 -> ROS 1) pub/echo across the bridge as expected.
142bce6 to
058b25d
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.
Summary
script/ros{1,2}_{server,client}.sh— that drive an end-to-endstd_msgs/Stringbridge across two terminals. Server side self-bootstrapsroscore+parameter_bridge(loads/demo_bridge.yaml) and publishes; client side just subscribes. Each step is logged explicitly ([ros1_server] step N/4: ...) so the user can see whenroscoreand the bridge are up.config/demo_bridge.yamlinto the image as/demo_bridge.yamlso the demo scripts pick it up without env overrides. Switch DockerfileCOPY script/...to a directory glob so future helpers are picked up automatically.parameter_bridge). This avoids theImportError: cannot import name 'Log' from 'rosgraph_msgs.msg'failure that happens when both distros are sourced into one shell —roscoreis a Python script andsys.pathresolvesrosgraph_msgsto ROS 2's copy (which lacksLog). The fix is split across two commits in this PR so the failure mode stays in the history.-hUsage for each demo helper, plus/demo_bridge.yamlpresence).doc/test/TEST.md,doc/changelog/CHANGELOG.md, and all four READMEs (en / zh-TW / zh-CN / ja) updated.Test plan
./build.sh test— 37/37 bats green, ShellCheck and Hadolint clean./exec.sh /ros1_server.sh+./exec.sh /ros2_client.sh— ROS 2 client receiveshello from ROS 1./exec.sh /ros2_server.sh+./exec.sh /ros1_client.sh— ROS 1 client receiveshello from ROS 2Ctrl+Ctears downparameter_bridge+roscore; client EOFsmain.yamldoes not yet opt in to the arm64 matrix). After ci: enable arm64 in build matrix (linux/amd64,linux/arm64) #27 merges, this PR will be rebased onto main and re-tested.