Skip to main content
Version: 9

Adjusting the Simulated Camera Resolution

By default, MoveIt Pro ships its example simulation configurations with modest camera resolutions so the stack runs smoothly on machines without a lot of available CPU. If your machine can spare the rendering cost, you can increase the resolution of the simulated cameras for sharper images and point clouds.

This guide uses the lab_sim robot configuration package as an example.

Edit the MuJoCo scene

Camera resolution in MuJoCo is set in two places inside the scene file. For lab_sim, that file is:

src/lab_sim/description/scene.xml

1. Camera sensor resolution

Each <camera> element has a resolution attribute (width height, in pixels):

<camera
name="scene_camera"
fovy="58"
mode="fixed"
resolution="640 480"
...
/>

Change the two numbers to your desired resolution (for example, 1280 720).

2. Offscreen render buffer

MuJoCo only renders camera images up to the size of the offscreen framebuffer. Bump the framebuffer to match — or exceed — the largest camera resolution:

<visual>
<global offwidth="640" offheight="480" />
...
</visual>

If you forget this step, MuJoCo will silently clamp camera output to the smaller framebuffer dimensions.

Apply the change

Restart the MoveIt Pro backend to pick up the new scene file. The wrist and scene cameras will now publish images at the higher resolution.

Performance

Higher camera resolutions cost more CPU time per render (MuJoCo renders on the CPU) and increase ROS message bandwidth. If sim feels sluggish, drop the resolution back down or reduce the camera publish rate (render_publish_rate parameter on the MujocoSystem hardware plugin).