openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.83k stars 810 forks source link

sim.data.get_sensor #684

Open takashi-suehiro opened 2 years ago

takashi-suehiro commented 2 years ago

Describe the bug The sim.data.get_sensor(sensor_name) function only returns the data of the sensor's id location, not the correct value of the sensor.

Desktop (please complete the following information):

Additional context I think it is better to rewrite this function as follows.

def get_sensor(i) : return sim.data.sensordata[model.sensor_adr[i]:model.sensor_adr[i]+model.sensor_dim[i]]

(sorry, this is not a method of MjSim.)