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

Extended python robot interfaces #36

Merged

Conversation

diegoferigo
Copy link
Collaborator

@diegoferigo diegoferigo commented Sep 16, 2019

This PR mainly splits and extends the former base.Robot interface as previously discussed in #33.

In particular, these are the new interfaces introduced in 3302e17:

  • RobotABC: common abstract base class shared by all implementations. It only provides a valid() method.
  • RobotBaseFrame: set and get data related to the robot base, which can be either fixed or floating.
  • RobotContacts: get data related to the active contacts with the environment. It is quite simple for simulated robots, more challenging for real ones.
  • RobotJoints: set and get joint-related data. It is a small extension of what was already implemented in the previous unified interface.
  • RobotLinks: get link-related data.

At the moment the robots simulated in Gazebo and loaded through FactoryRobot have not been update with the new methods. A dummy implementation is used instead 6fc9a09. A full implementation would require some work in C++, porting the same interfaces into the gympp package. I will do it in a future PR.

Few other new features have been included in this PR:

  • robot_features: decorator that add a class method to unify the verification that a robot object inherits from all the interfaces required for the computation. It can be used for example for the Tasks which might not require all the interfaces from a robot implementation. You can see a typical usage in 056702e.
  • The Task has a new _create_spaces() method. It is useful for readability to divide this logic and store it in a separated method. Depending on the runtime, its execution can be deferred to a later stage than class initialization.
  • Registered wrapped environments have no spec openai/gym#1554 broke the former logic of our runtime wrapper. A temporary workaround has been implemented in 97661ef. I'm currently testing a polished method, but let's merge this as it is right now.

To conclude, I have a lot of new features pending (nice ones!). Since I took advantage to refactor many components of the project, I temporarily created a devel branch and will push everything there. As soon as tests and functionality will be fully restored, I plan to merge to master and create the first release.

@diegoferigo diegoferigo self-assigned this Sep 16, 2019
@diegoferigo diegoferigo marked this pull request as ready for review September 16, 2019 21:44
@diegoferigo diegoferigo force-pushed the feature/new_robot_interfaces branch 3 times, most recently from 94fe2cc to 01f0beb Compare September 17, 2019 08:30
Copy link
Contributor

@traversaro traversaro left a comment

Choose a reason for hiding this comment

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

I only commented a bit the interfaces.

gym_ignition/base/robot/robot_baseframe.py Show resolved Hide resolved
gym_ignition/base/robot/robot_baseframe.py Show resolved Hide resolved
gym_ignition/base/robot/robot_joints.py Show resolved Hide resolved
gym_ignition/base/robot/robot_joints.py Outdated Show resolved Hide resolved
gym_ignition/base/robot/robot_joints.py Outdated Show resolved Hide resolved
@diegoferigo diegoferigo force-pushed the feature/new_robot_interfaces branch from 01f0beb to 9e2e044 Compare September 17, 2019 14:16
gym_ignition/base/robot/robot_joints.py Show resolved Hide resolved
gym_ignition/base/robot/robot_joints.py Outdated Show resolved Hide resolved
gym_ignition/base/robot/robot_joints.py Outdated Show resolved Hide resolved
gym_ignition/base/robot/robot_baseframe.py Show resolved Hide resolved
gym_ignition/base/robot/robot_baseframe.py Show resolved Hide resolved
gym_ignition/base/robot/robot_baseframe.py Show resolved Hide resolved
gym_ignition/base/robot/robot_joints.py Outdated Show resolved Hide resolved
@diegoferigo diegoferigo mentioned this pull request Sep 17, 2019
4 tasks
@diegoferigo diegoferigo force-pushed the feature/new_robot_interfaces branch 3 times, most recently from a4422ba to 1c54427 Compare September 18, 2019 13:16
@diegoferigo diegoferigo force-pushed the feature/new_robot_interfaces branch 2 times, most recently from 1657020 to ccd50bc Compare September 19, 2019 10:15
@diegoferigo diegoferigo force-pushed the feature/new_robot_interfaces branch from ccd50bc to a9d21fa Compare September 19, 2019 11:37
@diegoferigo
Copy link
Collaborator Author

Merging as soon as CI goes green

@diegoferigo diegoferigo merged commit 7e6ddef into robotology-legacy:devel Sep 19, 2019
@diegoferigo diegoferigo deleted the feature/new_robot_interfaces branch September 19, 2019 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants