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

GoalEnv for Robot-Supervisor scheme #103

Closed
wants to merge 5 commits into from

Conversation

KelvinYang0320
Copy link
Member

@KelvinYang0320 KelvinYang0320 commented Dec 8, 2021

I integrate GoalEnv from gym/core.py with deepbots for Robot-Supervisor scheme.
GoalEnv also inherite Env, but it imposes a required structure on the observation_space.

  1. reset(self):
    self.observation_space must be a Goal-compatible observation space.
    It is required to contain at least three elements, namely observation, desired_goal, and achieved_goal.
    Refer to robot_env.py in gym.

  2. compute_reward(self, achieved_goal, desired_goal, info):
    Since in our panda example, we need to get the observation to compute achieved_goal, and then we can compute the reward by using achieved_goal and desired_goal.
    Our original get_reward(action) is actually not that suitable for robotics control task.
    So I think we can let users implement their own step(), so I add raise NotImplementedError in step() function of RobotGoalSupervisor.

I think my coding style or implementation is not good enough.
Any suggestions would be appreciated! 😄

@KelvinYang0320 KelvinYang0320 linked an issue Dec 8, 2021 that may be closed by this pull request
@tsampazk tsampazk self-requested a review December 8, 2021 14:06
@tsampazk
Copy link
Member

tsampazk commented Dec 8, 2021

Thanks @KelvinYang0320 ! I'll review this PR in the following days.

@tsampazk tsampazk added the enhancement New feature or request label Dec 8, 2021
@tsampazk tsampazk added this to the Release 0.2.0 milestone Dec 8, 2021
@KelvinYang0320
Copy link
Member Author

@tsampazk Thank you!
Since it is mainly used for robotic control task in gym, I think I can make an deepworlds example with panda for GoalEnv demo.

@tsampazk
Copy link
Member

tsampazk commented Dec 8, 2021

@tsampazk Thank you! Since it is mainly used for robotic control task in gym, I think I can make an deepworlds example with panda for GoalEnv demo.

That sounds nice so we can actually have a usage example to make it more clear.

Copy link
Member

@tsampazk tsampazk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some inline comments, several minor PEP8 comments that should had failed the automated tests (something we should look into) and two major comments about code/class hierarchy structure, that need further discussion.

As a general comment, i think we should also look into how the new GoalEnv classes interact with the emitter/receiver classes. Right now emitter/receiver classes seem to not have access to the GoalEnv stuff.

deepbots/supervisor/controllers/robot_supervisor.py Outdated Show resolved Hide resolved
deepbots/supervisor/controllers/robot_supervisor.py Outdated Show resolved Hide resolved
deepbots/supervisor/controllers/supervisor_env.py Outdated Show resolved Hide resolved
deepbots/supervisor/controllers/supervisor_env.py Outdated Show resolved Hide resolved
deepbots/supervisor/controllers/supervisor_env.py Outdated Show resolved Hide resolved
@KelvinYang0320
Copy link
Member Author

As a general comment, i think we should also look into how the new GoalEnv classes interact with the emitter/receiver classes. Right now emitter/receiver classes seem to not have access to the GoalEnv stuff.

Yes, I am still trying to integrate GoalEnv with emitter/receiver.
However, we might need to decide how to design the highest level class to support both gym.GoalEnv and gym.Env first, and then we can think about how to design emitter-receiver and robot-supervisor.

Thank you for reviewing the code!

@KelvinYang0320
Copy link
Member Author

KelvinYang0320 commented Dec 12, 2021

@tsampazk I have made an example in deepworlds to demo GoalEnv with Panda.
Check this PR.
Also, I have updated this GoalEnv PR for those we have discussed about.
Thank you!

@KelvinYang0320 KelvinYang0320 marked this pull request as draft June 23, 2022 00:27
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

Successfully merging this pull request may close these issues.

Deepbots GoalEnv
2 participants