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

[WIP] RobotCollisionChecker refactor #342

Closed

Conversation

mkoval
Copy link
Member

@mkoval mkoval commented Aug 1, 2016

No description provided.

self.collision_saver = CollisionOptionsStateSaver(
self.checker, collision_options)

def __enter__(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these duplicated __enter__ and __exit__ methods intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. Good catch. 👍

@cdellin
Copy link
Contributor

cdellin commented Aug 2, 2016

Except the one issue above, I like this change. I have three comments:

  • The naming is a bit weird; the CollisionChecker objects which are passed as arguments named robot_collision_checker are actually factories which produce context managers, but when instantiated in with self.robot_collision_checker(robot) as robot_checker:, the context manager is called a checker.
  • I don't immediately know why it's a good idea to pull the CollisionOptionsStateSaver into the robot state checker. Why not keep the robot checker collision option agnostic, and use nested managers to handle that? If it's just for convenience, maybe you can just define nested versions which just call nested()?
  • The wrapper (factory) classes seem a bit strange ... why not just pass the context manager class name as an argument? Is it so you can specify a default value for collision_options? Oh, perhaps it's so you can extract the desired collision options in case the planner wants to handle them differently?

@cdellin
Copy link
Contributor

cdellin commented Aug 2, 2016

Ok, I thought about this a bit, and this seems like the most reasonable solution (although the naming issue in my first bullet is still a bit confusing).

@mkoval
Copy link
Member Author

mkoval commented Aug 2, 2016

The naming is a bit weird [...]

I agree that the naming is a mess. It was already confusing and introducing an extra level of factories makes it more so. Any suggestions about how we can rename the factory and the context manager to make this more clear?

Why not keep the robot checker collision option agnostic, and use nested managers to handle that?

This would require that we create a nested context manager factory. It would also mean that we can't easily use the same API on C++ planners, like OMPL and CBiRRT, using isinstance checks.

Is it so you can specify a default value for collision_options?

Yes. In the future, we might want to do more here. For example, we could configure how the baking is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants