maxspahn / gym_envs_planar

Planar gym environments
7 stars 4 forks source link

Goal position can not exceed the sensor limit #41

Open maxspahn opened 2 years ago

maxspahn commented 2 years ago

I am currently migrating my planner to use the integrated pseudo-sensor for goals (soon also obstacles). I run into a potential bug when using the goal position sensor:

When the goal exceeds the limit set in the sensor, the information is simply clipped to the limit. While this seems to make sense when using relative distance sensor, it it restrictive with the absolute position sensor.

Was this the intended behavior, @alxschwrz ?

https://github.com/maxspahn/gym_envs_planar/blob/354288a67b7185843dcb2c917ade86974ac18607/planarenvs/sensors/goal_sensor.py#L43

alxschwrz commented 2 years ago

Yes, I intended to do so. I assume it to be some kind of maximum sensor range for the relative distance sensor. For the absolute position sensor, I expected the goals to be within the defined observation space limits. For RL applications, this is relevant. However, I understand that it might be different for other purposes. Would you prefer the observation to not be clipped?

maxspahn commented 2 years ago

Ok, that makes sense!

I expected the goals to be within the defined observation space limits.

Then, we should make sure that the sensor limits are actually taken from the observation space and not hardcoded by the default value for the lim_sensor attribute. I don't see the 10 ever being overwritten.

alxschwrz commented 2 years ago

oh yes, this is true. The sensor limit should be taken from the observation space. It would be good to add it to the example in the initialization of the sensors.