-
Notifications
You must be signed in to change notification settings - Fork 52
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] Ensure contact happens within slicer volume before slicing #588
base: og-develop
Are you sure you want to change the base?
Conversation
@@ -89,6 +89,7 @@ def main(random_selection=False, headless=False, short_exec=False): | |||
knife.set_position_orientation( | |||
position=apple.get_position() + np.array([-0.15, 0.0, 0.2]), | |||
orientation=T.euler2quat([-np.pi / 2, 0, 0]), | |||
# orientation=T.euler2quat([np.pi / 2, 0, 0]) # The back of the knife cuts the apple as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tests/test_transition_rules.py create two unit tests, one that has the object falling on the sharp side and cutting, one that has the object falling on the blunt side and not cutting. Essentially you need to create a function called test_{test_name_here}
and run it using pytest tests/test_transition_rules.py
and it should pass. Ask for in-person help from Eric if you can't figure out how to run pytest. Once the test is ready, remove this change.
omnigibson/transition_rules.py
Outdated
class TouchingVolumeCheckCondition(TouchingAnyCondition): | ||
def __init__(self, filter_1_name, filter_2_name): | ||
''' | ||
Checks if filter_2_bodies have a contact point within the collision volume generated from each obj in filter_1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's explicitly say that we are using the slicer meta link as the volume here.
omnigibson/transition_rules.py
Outdated
slicer_volume = None | ||
for name, link in self.obj.links.items(): | ||
if 'slicer' in name: | ||
slicer_volume = link | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ask @cremebrule if this is the best way to do this.
check_in_volume, _ = generate_points_in_volume_checker_function( | ||
obj=obj, | ||
volume_link=slicer_volume | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ask @cremebrule if repeatedly creating this function incurs a big performance penalty. We could do something clever here where the volume is known and the checker function pointer is held by the SlicerActive state and here we can just query it.
At the very least, add before this line:
# TODO: Consider moving this to the SlicerActive state for performance.
Final changes to the transition test
Issue here is that contact points dont show up where you expect them to. We need to figure out what to do |
No description provided.