Describe the bug
Object has no attribute '_xfrc_applied'
To Reproduce
force = [0, 0, 0]
torque = [0, 0, 0]
self._sim.data._xfrc_applied[self._sim.model._body_name2id["torso"],:] = force + torque
Expected behavior
Expected behavior is to apply the force and torque to the 'torso' body part.
Error Messages
Including more/longer error messages gives us more information to work with.
Desktop (please complete the following information):
Additional context
I uncompensated the example in mushroom_rl/environments/mujoco.py
def _simulation_pre_step(self):
"""
Allows information to be accesed and changed at every intermediate step
before taking a step in the mujoco simulation.
Can be usefull to apply an external force/torque to the specified bodies.
ex: apply a force over X to the torso:
"""
force = [0, 0, 0]
torque = [0, 0, 0]
self._sim.data._xfrc_applied[self._sim.model._body_name2id["torso"],:] = force + torque
#pass
I made the mistake of adding an extra underscore before the 'xfrc'. The correct way is:
self._sim.data.xfrc_applied[self._sim.model._body_name2id["torso"],:] = force + torque
Describe the bug Object has no attribute '_xfrc_applied'
To Reproduce force = [0, 0, 0] torque = [0, 0, 0]
Expected behavior Expected behavior is to apply the force and torque to the 'torso' body part. Error Messages Including more/longer error messages gives us more information to work with.
Desktop (please complete the following information):
Environment
echo $LD_LIBRARY_PATH
/home/luis/.mujoco/mujoco210/binecho $HOME
/home/luis/echo $USER
luisAdditional context I uncompensated the example in mushroom_rl/environments/mujoco.py
def _simulation_pre_step(self): """ Allows information to be accesed and changed at every intermediate step before taking a step in the mujoco simulation. Can be usefull to apply an external force/torque to the specified bodies.