AIcrowd / real_robots

Gym environments for Robots that learn to interact with the environment autonomously
https://www.aicrowd.com/challenges/neurips-2019-robot-open-ended-autonomous-learning
MIT License
34 stars 18 forks source link

Phase step_num unable to customize #36

Open zijiebite opened 2 years ago

zijiebite commented 2 years ago

Description

I use the starterkit AIcrowd offered and tried to customize intrinsic phase to 1e6 instead of 15e6 (which is the default value). The progress bar works well but the environment is not turning "done" to True, after 1e6 steps, and the environment continues to run untill 15e6 steps finished.

What I Did

A fix suggestions

line 32 ~34 of real_robots/envs/env.py assigns default data to global value "intrinsic_timesteps", "extrinsic_timesteps", "extrinsic_trials", which cannot be changed by changing the parameters offered to function "real_robots.evaluate". Probably these three lines should be moved inside "init" so that they can be modified while building the environment

emilio-cartoni commented 2 years ago

Dear @zijiebite , the real_robots.evaluate function already offers a way to run the environment for any amount of steps. Checking on the latest starter kit local_evaluation.py it seems to work well, running for the desired amount of intrinsic and extrinsic timesteps and trials.

It is true that in future version of the environment, it might good to pass the arguments directly to the environment init function which is more standard instead of modifying the attributes after creation.

I use the starterkit AIcrowd offered and tried to customize intrinsic phase to 1e6 instead of 15e6 (which is the default value). The progress bar works well but the environment is not turning "done" to True, after 1e6 steps, and the environment continues to run untill 15e6 steps finished.

I could not reproduce this situation, let me know which starter kit you were using. You mentioned the "AIcrowd offered" one, however the latest version of the competition is no longer hosted by AICrowd, so maybe it is an old version.

zijiebite commented 2 years ago

Sorry for not replying in time. I'm using the older version. I'll switch to the latest version as soon as possible.

zijiebite commented 2 years ago

Here I'm encountering another problem. It seems that the camera image observation['retina'] may turn zero from time to time. I'm not sure if there's a mistake. This zipfile below contains the code where I found this problem, and some of its results. results.zip

emilio-cartoni commented 2 years ago

Here I'm encountering another problem. It seems that the camera image observation['retina'] may turn zero from time to time. I'm not sure if there's a mistake. This zipfile below contains the code where I found this problem, and some of its results. results.zip

Dear @zijiebite ,
the action space is a dictionary with two parts.
The first part represents the action itself, and it can be "cartesian_command" (plus "gripper_command"), "joint_command" or "macro_action" depending on the control scheme / environment type chosen.
The second part has they key "render" and enables (or disables) the camera for that step.
When in your code you use self.action_space.sample(), random values are drawn for all the parts of the action, including "render".
So "render" is randomly set to either True or False. When it is False, the retina is all zeros.
This is useful when you want to check the images with a particular frame_rate (e.g. only once every 20 steps), as this speeds up the simulation.

zijiebite commented 2 years ago

Thanks a lot! What a silly mistake I had made.