Describe the bug
I am specifying a <site> position in the XML file to zero in all x y z and when I try to change the site position programmatically the value doesn't change and is not reflected in the viewer. However, having a non-zero value for a position in XML allows changing it programmatically and is reflected in the viewer.
2. Use following function to set and get the position of `site`
import mujoco as mj
model = mj.MjModel.from_xml_path(str("pendulum.xml"))
data = mj.MjData(model)
model.site('my_site').pos[:2] = [0.5, 0.5]
mj.mj_forward(model, data)
print(data.site('my_site').xpos)
**Expected behavior**
The result expected here is `[0.5 0.5 0.]`. However, the result comes to be `[0. 0. 0.]`.
**Workaround**
The current solution is to have a non-zero position in the XML. So,
Change `<site name='my_site' size='0.05' pos='0 0 0' rgba='0.0 0.5 0.5 1.0'/>`
to
`<site name='my_site' size='0.05' pos='0.1 0 0' rgba='0.0 0.5 0.5 1.0'/>`
**Desktop**
- OS: macOS 14.1.2
- Python Version 3.10.11
- Mujoco Version 3.1.2
- mujoco-py version 3.1.2
Describe the bug I am specifying a
<site>
position in the XML file to zero in all x y z and when I try to change the site position programmatically the value doesn't change and is not reflected in the viewer. However, having a non-zero value for a position in XML allows changing it programmatically and is reflected in the viewer.To Reproduce
Create a Mujoco XML file. Download a file from the example here (https://github.com/google-deepmind/mujoco/blob/main/doc/_static/pendulum.xml) and add a site.
import mujoco as mj
model = mj.MjModel.from_xml_path(str("pendulum.xml")) data = mj.MjData(model)
model.site('my_site').pos[:2] = [0.5, 0.5]
mj.mj_forward(model, data)
print(data.site('my_site').xpos)