Skip to content

ROS 2 Phase 2: bugbot_ros bridge + learned controller#2

Draft
Jerome-Graves wants to merge 1 commit into
mainfrom
ros2/phase2
Draft

ROS 2 Phase 2: bugbot_ros bridge + learned controller#2
Jerome-Graves wants to merge 1 commit into
mainfrom
ros2/phase2

Conversation

@Jerome-Graves

Copy link
Copy Markdown
Member

Phase 2: a ROS 2 (ament_python) package that bridges BugBot's holonomic drive into ROS 2 and runs the corrective policy from the simulation. Draft for review + a colcon build / runtime pass on a ROS 2 install (Humble/Jazzy, Ubuntu/WSL 2).

Package bugbot_ros

  • twist_bridge_node/cmd_vel (geometry_msgs/Twist) → four wheel commands on /bugbot/wheel_cmd via the firmware X-omni mix. Direct teleop / open-loop path.
  • policy_node — loads a sim-trained TorchScript policy and maps [command + noisy measured motion + previous action] → wheel commands (the learned micro-correction controller). Zero-policy default = safe bring-up.
  • deploy.py — shared observation builder + PolicyController, with the obs layout and normalisation constants kept identical to the simulation env, so a sim-trained policy runs unchanged on the real robot.
  • mixing.py — firmware-exact X-omni mix (unit-tested).
  • launch/bugbot.launch.py, package.xml, setup.py, test/test_mixing_parity.py.

/cmd_vel is a full Twist (holonomic): linear.x forward, linear.y left (mapped to BugBot's right-positive lateral), angular.z yaw.

Verified here

  • ✅ ROS-side mix matches the firmware/sim basis vectors and round-trips (parity test passes in plain Python).
  • ✅ All modules compile.

Not yet verified (needs a ROS 2 install)

colcon build, node startup, and topic wiring haven't been run. Build/run instructions are in ros2/README.md. Final integration step: wire /bugbot/wheel_cmd to the firmware's command channel (WebSocket/UDP).

Relationship to the sim PR

Independent of the simulation PR, but designed to consume its trained policy. The mix is duplicated (not cross-imported) so the ROS package builds standalone; a comment in each mixing.py notes they must stay in sync.

ament_python package: twist_bridge_node (/cmd_vel -> 4 wheel cmds via the X-omni
mix), policy_node (sim-trained TorchScript policy -> wheel cmds with noisy sensor
inputs), shared deploy.py (observation builder + PolicyController, obs layout kept
identical to the sim), mixing.py (firmware-exact, unit-tested), launch file, and a
mix-parity test. Targets ROS 2 Humble/Jazzy; mix verified, colcon build pending.
@Jerome-Graves Jerome-Graves reopened this Jul 2, 2026
@github-actions github-actions Bot added area:docs Changes to the docs area area:ros2 Changes to the ros2 area labels Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Changes to the docs area area:ros2 Changes to the ros2 area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant