---json {"name": "ROS 2"} --- ====== ROS 2 ====== Connect Marty V2 to ROS 2 over USB, Wi-Fi or an onboard Pi expansion UART. The standalone driver provides accelerometer, joint and battery topics, connection services and a movement action. Commands run from a Bash terminal on Linux. ===== Start here ===== - [[:martyv2:ros2:getting_started|Install and connect]] — build on Linux, configure the machine and robot, then read acceleration. - [[:martyv2:ros2:interfaces|Topics, services and movement]] — inspect the ROS graph and send movement commands. - [[:martyv2:ros2:simulation|RViz simulation]] — run a simulated Marty and control its joints without hardware. - [[:martyv2:ros2:onboard_pi_camera|Onboard Pi, camera and RViz]] — run the driver on the Pi, receive encoded video on another Linux machine and view ROS images. Source: [[https://github.com/robotical/marty-ros2|robotical/marty-ros2]]. Workstation target: Ubuntu 24.04, ROS 2 Jazzy and Python 3.12. The onboard example uses 64-bit Raspberry Pi OS with a Jazzy container on the Pi. ===== ROS graph ===== {{https://raw.githubusercontent.com/robotical/marty-ros2/05b750bc1c36ca07f9d66e595f94eac769fe84ea/docs/ros-graphs/marty-overview.png?760&nolink|Marty ROS 2 node, topics, services and action}} ''/marty/marty_driver'' owns one MartyPy connection. ROS subscribers receive measurement topics; service and action clients send requests to the driver. The firmware generates the movements. Each robot uses a separate namespace. There is no dependency on Axiom or a dashboard. ===== Connection and telemetry ===== The guide starts the driver disconnected. ''/marty/connect'' opens the configured connection and MartyPy starts telemetry at ''subscribe_rate_hz''. There is no separate acquisition service. A ''ros2 topic echo'' command subscribes to an existing ROS topic; stopping that echo does not stop the driver or firmware telemetry. ''/marty/disconnect'' closes the connection and disables automatic reconnect. Driver measurement topics use best-effort QoS. The optional workstation camera receiver publishes Image messages with reliable, volatile, depth-1 QoS. ''/marty/status'' is reliable and transient-local. ===== Onboard Pi and workstation ===== The [[:martyv2:ros2:onboard_pi_camera|onboard example]] runs Jazzy's headless Marty driver in a Docker container on a 64-bit Raspberry Pi OS host. The native Pi camera streams H.264/MPEG-TS over TCP; a workstation receiver publishes ''/marty/camera/image_raw'' for an RViz Image display. ROS DDS carries Marty telemetry/control separately. Startup remains manual, and no calibrated camera TF/CameraInfo is supplied. Axiom can use its separate host driver on that workstation. [[:axiom:ros2:start|Axiom ROS 2]] describes its sensors and outputs; sharing a ROS domain lets applications consume both without merging their firmware or connections. ===== Current scope ===== The IMU topic contains acceleration in m/s², including gravity; gyro and orientation are unavailable. Joint positions are in radians. Movement goals use firmware degrees and millimetres. The driver exposes walk, dance, kick, stand and single-joint movement. [[:martyv2:ros2:simulation|RViz simulation]] displays a separate simulated Marty. Displaying measured joints from physical Marty still needs a calibrated joint mapping; velocity control and odometry are not included. [[https://github.com/robotical/marty-ros2/blob/main/docs/validation.md|Validation details]] distinguish automated checks from physical tests.