mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Fix mjv_moveCamera argument mismatch for MuJoCo 3.x compatibility

Open FurkannByrm opened this issue 3 months ago • 1 comments

Intro

Robotics developer working with ROS 2 and MuJoCo simulation for manipulators/mobile robots.

My setup

OS: Ubuntu

ROS 2 Version: ROS 2 (Humble / Iron / Rolling)

MuJoCo Version: 3.11.0 (C API)

Package: mujoco_ros2_control

What's happening? What did you expect?

Compilation fails in mujoco_rendering.cpp when building against MuJoCo 3.11.0 because mjv_moveCamera is called with 6 arguments instead of 5. error: cannot convert 'mjvScene*' to 'mjvCamera*' 204 | mjv_moveCamera(mj_model_, action, dx / height, dy / height, &mjv_scn_, &mjv_cam_); note: initializing argument 5 of 'void mjv_moveCamera(const mjModel*, int, mjtNum, mjtNum, mjvCamera*)'

Steps for reproduction

Image

Minimal model for reproduction

//

Code required for reproduction

mjv_moveCamera(mj_model_, action, dx / height, dy / height, &mjv_cam_); mjv_moveCamera(mj_model_, mjMOUSE_ZOOM, 0, -0.05 * yoffset, &mjv_cam_);

Confirmations

FurkannByrm avatar Aug 11 '26 06:08 FurkannByrm

The extra argument was removed in version 3.11. See our release notes.

https://mujoco.readthedocs.io/en/stable/changelog.html#version-3-11-0-july-27-2026

haroonq avatar Aug 24 '26 15:08 haroonq