dojo-sim / Dojo.jl

A differentiable physics engine for robotics
MIT License
309 stars 27 forks source link

`env.observation_space` doesn't match the shape of actual `observation` returned during env reset/step #11

Closed rejuvyesh closed 1 year ago

rejuvyesh commented 2 years ago

e.g.

size(reset(antenv), 1) == antenv.observation_space.n

returns false.

I'll add those tests in a PR.

Reason is because although wedefine observation space as https://github.com/dojo-sim/Dojo.jl/blob/main/environments/ant/methods/env.jl#L44-L51 but then get_observation concatenates the contact forces as well: https://github.com/dojo-sim/Dojo.jl/blob/main/environments/ant/methods/env.jl#L175. We need a way to reflect this in the observation space.

janbruedigam commented 1 year ago

I cut down the Environments in the latest version to be very minimal, and observartion_space does no longer exist. I think Dojo's environments should really mostly be about the dynamics. As an example, for RL, you would have a Dojo Environment for the dynamical system, and a ReinforcementLearning Environment for the actual learning including rewards, state spaces, and so on. But Dojo's Environments definitely need rethinking.

I'll close this for now, but feel free to open a general issue on Environments