openarm_ros2/openarm_mujoco_hardware
thomason 158d15dfa9
Add mujoco ros2 control (#26)
Add support for simulated openarm hardware with MuJoCo backend.
2025-07-03 21:43:08 -07:00
..
include/openarm_mujoco_hardware Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
src Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
test Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
CMakeLists.txt Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
LICENSE Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
openarm_mujoco_hardware.xml Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
package.xml Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00
README.md Add mujoco ros2 control (#26) 2025-07-03 21:43:08 -07:00

OpenArm MuJoCo Hardware Interface

This package provides a ros2_control hardware interface for simulating OpenArm using the MuJoCo physics engine in place of physical hardware. It connects to a WebAssembly instance of MuJoCo through WebSockets.

Usage

Certain OpenArm packages have been configured to use this interface by specifying the hardware_type flag. This flag defaults to real, which assumes the use of physical hardware. Setting the flag to mock uses an interface that writes commands to states directly (with some delays). Setting the flag to sim uses the MuJoCo hardware interface.

For example, to use MoveIt2 with simulated bimanual hardware, first run MuJoCo by visiting:

github.com/thomasonzhou/mujoco_anywhere

Then run the original command with the hardware_type flag:

ros2 launch -d openarm_bimanual_moveit_config demo.launch.py hardware_type:=sim

It may be necessary to install the nlohmann-json-dev library before building

Please note that running multiple instances of the website will cause conflicting signals. Future configurations will allow for multiple instances to run simultaneously.

Configuration

Hardware Plugin Config

The hardware plugin is specified in openarm_description/openarm.ros2_control.xacro as follows:

<ros2_control name="openarm_system" type="system">
  <hardware>
    <plugin>openarm_mujoco_hardware/MujocoHardware</plugin>
    <param name="prefix">left_</param>
    <param name="websocket_port">1337</param>
  </hardware>
  <!-- Joint configurations -->
</ros2_control>

When using OpenArm in a bimanual configuration, the WebSocket ports default to 1337 for right arm and 1338 for left arm commands. However, in practice commands can be sent and states can be received through any connected port.