Skip to content

Commit

Permalink
Use MuJoCo 3.0.0 for the simulation
Browse files Browse the repository at this point in the history
MuJoCo now uses the conventional package layout for its includes.
This is hopefully more stable for upcoming MuJoCo releases.
  • Loading branch information
stefanscherzinger committed Jan 10, 2024
1 parent 818cc0b commit 91d5a17
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/script/install_mujoco.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/usr/bin/bash
cd $HOME
apt install wget
wget https://github.com/deepmind/mujoco/releases/download/2.1.1/mujoco-2.1.1-linux-x86_64.tar.gz
tar -xf mujoco-2.1.1-linux-x86_64.tar.gz
wget https://github.com/deepmind/mujoco/releases/download/3.0.0/mujoco-3.0.0-linux-x86_64.tar.gz
tar -xf mujoco-3.0.0-linux-x86_64.tar.gz
4 changes: 2 additions & 2 deletions cartesian_controller_simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ find_package(rclcpp REQUIRED)
# Mujoco comes as a pre-built library package.
# Extract this package somewhere and point CMake towards it during the build process.
if(NOT DEFINED MUJOCO_DIR)
set(MUJOCO_DIR "$ENV{HOME}/mujoco-2.1.1") # CI setting
set(MUJOCO_DIR "$ENV{HOME}/mujoco-3.0.0") # CI setting
message(WARNING "MUJOCO_DIR not specified. Using default ${MUJOCO_DIR}")
endif()
set(MUJOCO_INCLUDE_DIRS ${MUJOCO_DIR}/include)
set(MUJOCO_LIBRARIES
${MUJOCO_DIR}/lib/libmujoco_nogl.so
${MUJOCO_DIR}/lib/libmujoco.so
)

# --------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions cartesian_controller_simulation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ This gives us a strong environment to realistically test control and contact phe
We use MuJoCo in [headless mode](https://mujoco.readthedocs.io/en/latest/programming.html?highlight=headless#using-opengl)
and don't need OpenGL-related dependencies.

1. Download MuJoCo's most recent [release](https://github.com/deepmind/mujoco/releases/) and extract that somewhere.
It's a ready-to-use, pre-built library package, and we will just point to it during the build.
1. Download MuJoCo's pre-built [library package](https://github.com/deepmind/mujoco/releases/) and extract that somewhere.
It's ready-to-use and we will just point to it during the build.
```bash
cd $HOME
wget https://github.com/deepmind/mujoco/releases/download/2.1.1/mujoco-2.1.1-linux-x86_64.tar.gz
tar -xf mujoco-2.1.1-linux-x86_64.tar.gz
wget https://github.com/deepmind/mujoco/releases/download/3.0.0/mujoco-3.0.0-linux-x86_64.tar.gz
tar -xf mujoco-3.0.0-linux-x86_64.tar.gz
```

3. Switch to the *root* of your ROS2 workspace and build the package (*standalone*) with
```bash
colcon build --cmake-args "-DMUJOCO_DIR=$HOME/mujoco-2.1.1" --packages-select cartesian_controller_simulation
colcon build --cmake-args "-DMUJOCO_DIR=$HOME/mujoco-3.0.0" --packages-select cartesian_controller_simulation
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <string>
#include <vector>

#include "mujoco.h"
#include "mujoco/mujoco.h"

namespace cartesian_controller_simulation
{
Expand Down

0 comments on commit 91d5a17

Please sign in to comment.