Closed bgill92 closed 5 months ago
replicate only works on kinematic tree elements. If you replicate the site that your sensor is attached to, the sensor will be automatically replicated and correctly namespaced.
This is well documented, do you not agree? Let us know if the documentation could be improved. Perhaps we should add a sensor to the example model?
https://mujoco.readthedocs.io/en/latest/XMLreference.html#replicate-r
Before replicate:
<mujoco>
<worldbody>
<replicate count="2" offset="0 1 0" euler="90 0 0">
<replicate count="2" sep="-" offset="1 0 0" euler="0 90 0">
<geom name="Alice" size=".1"/>
</replicate>
</replicate>
</worldbody>
<sensor>
<accelerometer name="Bilal" site="Alice"/>
</sensor>
</mujoco>
After:
<mujoco>
<worldbody>
<geom name="Alice-00" size="0.1"/>
<geom name="Alice-10" size="0.1" pos="1 0 0" quat="1 0 1 0"/>
<geom name="Alice-01" size="0.1" pos="0 1 0" quat="1 1 0 0"/>
<geom name="Alice-11" size="0.1" pos="1 1 0" quat="0.5 0.5 0.5 0.5"/>
</worldbody>
<sensor>
<accelerometer name="Bilal-00" site="Alice-00"/>
<accelerometer name="Bilal-10" site="Alice-10"/>
<accelerometer name="Bilal-01" site="Alice-01"/>
<accelerometer name="Bilal-11" site="Alice-11"/>
</sensor>
</mujoco>
Hi,
I'm a robotics engineer at PickNik Robotics and we're trying to use MuJoCo for simulating a mobile manipulator. An important sensor for mobile robotics is the LIDAR. When researching if it was possible to simulate a LIDAR in MuJoCo, I came across this issue: #688. It doesn't seem like there has been much progress since last year.
Earlier this month version 3.1.5 was released which introduced the
replicate
meta tag. Initially, I tried using it as followed:but I get the following error when launching MuJoCo Viewer:
To get the "rangefinder array" to work properly, I had to make a site at the desired link of the kinematic tree, something akin to:
and then in the
sensor
portion of the MJCF file, populate 360 individual LIDARs. This is very cumbersome, so I ended up writing a Python script to automate the process. This ended up working, as I was able to get a reasonable looking rangefinder array, i.e. a LIDAR:So my question is:
Is it the intent that the replicate tag cannot be used for replicating sensors, or is this a bug?