Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor Reading is Brittle in Some Environments #62

Closed
rachel-1 opened this issue Feb 21, 2020 · 1 comment
Closed

Sensor Reading is Brittle in Some Environments #62

rachel-1 opened this issue Feb 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@rachel-1
Copy link

rachel-1 commented Feb 21, 2020

In some environments (which don't look to have been merged yet, such as wiping environments in the vices_19 branch), sensor data from sensor with id sensor_id is referenced using env.sim.data.sensordata[sensor_id*3:sensor_id*3+3], where the magic number 3 is used based on the assumption that the previous sensors all have 3 values associated with them. If sensors with different dimensions are added (e.g. 1-dim contact sensors), the returned values for will be wrong.

Note: this is due to the fact that Mujoco/mujoco-py simply puts all sensor data in a single array in env.sim.data.sensordata (in the order that the sensors were added).

We will eventually need some way of tracking the kinds of sensors that have been added to mitigate the issue; filing the issue here for reference in the meantime. Users will have to manually keep track of what sensors are used and be careful with how they reference them.

@yukezhu yukezhu added the enhancement New feature or request label Mar 23, 2020
@cremebrule
Copy link
Member

fixed. Note: we should avoid using sim.data.get_sensor("..."), as this returns an INCORRECT value since it only returns a scalar, irregardless of the dimensionality of the sensor being requested!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants