diff --git a/README.md b/README.md index 4de0221..86c1f88 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ROS 2 package for differential-drive motor control on the Yahboom Raspbot V2 pla ## Architecture ``` - ┌──────────────────────────────────┐ + ┌───────────────────────────────────┐ │ MotorControllerNode │ │ │ /cmd_vel ──────────>│ Twist → differential kinematics │ @@ -18,14 +18,14 @@ ROS 2 package for differential-drive motor control on the Yahboom Raspbot V2 pla (Float32MultiArray │ [FL, FR, RL, RR] │ 4 × float32) │ │ │ ▼ │ - │ raspbot_v2_interface │ + │ raspbot_v2_interface │ │ I²C bus 1, addr 0x2B │ │ ▼ │ │ /dev/i2c-1 ─────────> Motors │ │ │ /current_wheel_speeds│<─ telemetry @ 10 Hz │ (Float32MultiArray) │ [FL, FR, RL, RR] │ - └──────────────────────────────────┘ + └───────────────────────────────────┘ ``` ### Topics @@ -72,18 +72,6 @@ The [ansible/](ansible/) directory contains a playbook that handles the remainin --- -## Deploying - -Once the image is built, pipe it directly to the target over SSH — no intermediate file or registry needed: - -```bash -docker save my_robot:latest | ssh matt@raspbot-v2.local docker load -``` - -Replace `matt` with the username configured in [ansible/inventory.ini](ansible/inventory.ini). - ---- - ## Building ### Prerequisites @@ -112,13 +100,27 @@ The build is split into two stages: --- +## Deploying + +Once the image is built, pipe it directly to the target over SSH — no intermediate file or registry needed: + +```bash +docker save my_robot:latest | ssh matt@raspbot-v2.local docker load +``` + +Replace `matt` with the username configured in [ansible/inventory.ini](ansible/inventory.ini). + +--- + ## Launching The container needs access to the I²C bus that the motor controller is wired to. Pass only that device rather than running the container in privileged mode: ```bash docker run --rm \ + --network=host \ --device /dev/i2c-1 \ + --env ROS_DOMAIN_ID=0 \ my_robot:latest ``` @@ -130,7 +132,9 @@ ROS 2 parameters can be passed through `--ros-args`: ```bash docker run --rm \ + --network=host \ --device /dev/i2c-1 \ + --env ROS_DOMAIN_ID=0 \ my_robot:latest \ ros2 run my_robot motor_controller \ --ros-args -p wheel_base:=0.25 -p max_speed:=0.8 @@ -143,7 +147,7 @@ With the container running, publish a `cmd_vel` message from another terminal (r ```bash # Drive forward at 0.2 m/s ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist \ - "{linear: {x: 0.2}, angular: {z: 0.0}}" + "{linear: {x: 0.02}, angular: {z: 0.0}}" # Turn on the spot ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist \