This repository provides a ROS2 package including a MuJoCo simulation environment, tasks and an interface to the physical hardware of the Solo8 quadruped robot by Open Dynamic Robot Initiative.
To build and source the package run:
colcon build --packages-select solo_mujoco
source install/setup.bash
The simulation environment is powered by the MuJoCo physics engine and connected to ROS2-control via a system interface. This system interface accepts control targets from ROS2 topics and publishes state information.
Start the simulation with
ros2 launch solo_mujoco simulate.launch.py
Options:
Option | Type | Description |
---|---|---|
plot | bool | Whether to start rqt alongside with the simulation |
The simulation accepts commands to the following topics:
Topic | Description |
---|---|
/position_controller/commands | Accepts joint position targets as Float64MultiArray in the order hip_front_left, knee_front_left, ..., hip_back_right, knee_back_right |
/velocity_controller/commands | Accepts joint velocity targets as Float64MultiArray in the order hip_front_left, knee_front_left, ..., hip_back_right, knee_back_right |
The system interface relays the following data to the ROS2 system:
Topic | Frequency | Description |
---|---|---|
/imu | 60Hz | Publishes an Imu object containing acceleration, angular velocity and quaternion orientation |
/foot_contacts | Publishes a Float64MultiArray of length 4 with the vertical force. Order: [FL, FR, HL, HR] |
The real robot system interface connects to the real robot using the Open Dynamic Robot Initiative SDK. The built SDK files are places in the master_biard_sdk_libs folder.
It accepts the same control targets as the simulation.
Launch the real robot interface with:
ros2 launch solo_mujoco real_solo.launch.py
Options:
Option | Type | Description |
---|---|---|
eth_interface | string | The ethernet interface name of the robot |
The repository comes along with a task controller which manages the execution of several tasks in the simulation and on the real robot, e.g., walking or sitting.
To change the executed task, use the following services. All services accept a std_srvs/srv/Trigger
message:
Service | Description |
---|---|
/tasks/trigger/TROT | Triggers a walk of the robot with a trot pattern |
/tasks/trigger/SIT | Triggers the robot to sit |
/tasks/trigger/STEER | The robot walks a curve to reach a specified steering angle and then maintains a stable stand. The steering angle can be specified by publishing the angle in degrees as std_msgs/msg/Float64 to the /steering_angle topic. For the simulation holds: East=0°, South=-90°, North=90° |
- Make sure to place a MuJoCo release somewhere in the ROS2 workspace and reference it with the
MUJOCO_DIR
environment variable. - Make sure to have the
rclcpp
,pluginlib
,hardware_interface
,glfw3
andGLEW
packages installed. See the CMakeLists.txt file for details.