Skip to content

Commit

Permalink
Support MuJoCo 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Nov 9, 2023
1 parent 179c2f6 commit 428e54d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
set -e
mkdir -p /opt
cd /opt
MUJOCO_VERSION=2.3.7
MUJOCO_VERSION=3.0.0
wget --quiet https://github.com/deepmind/mujoco/releases/download/${MUJOCO_VERSION}/mujoco-${MUJOCO_VERSION}-linux-x86_64.tar.gz
tar xzf mujoco-${MUJOCO_VERSION}-linux-x86_64.tar.gz
mv mujoco-${MUJOCO_VERSION} mujoco
Expand Down
11 changes: 10 additions & 1 deletion src/mj_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,20 @@ void uiEvent(mjuiState * state)
// find geom and 3D click point, get corresponding body
mjrRect r = state->rect[0];
mjtNum selpnt[3];
int selgeom, selskin;
int selgeom;
int selskin;
#if mjVERSION_HEADER < 300
int selbody =
mjv_select(mj_sim->model, mj_sim->data, &mj_sim->options, (mjtNum)r.width / (mjtNum)r.height,
(mjtNum)(state->x - r.left) / (mjtNum)r.width, (mjtNum)(state->y - r.bottom) / (mjtNum)r.height,
&mj_sim->scene, selpnt, &selgeom, &selskin);
#else
int selflex;
int selbody =
mjv_select(mj_sim->model, mj_sim->data, &mj_sim->options, (mjtNum)r.width / (mjtNum)r.height,
(mjtNum)(state->x - r.left) / (mjtNum)r.width, (mjtNum)(state->y - r.bottom) / (mjtNum)r.height,
&mj_sim->scene, selpnt, &selgeom, &selflex, &selskin);
#endif

// set lookat point, start tracking is requested
if(selmode == 2 || selmode == 3)
Expand Down

0 comments on commit 428e54d

Please sign in to comment.