-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature/implement grasp detector in grab #1239
base: master
Are you sure you want to change the base?
Conversation
c2741bd
to
b3ead88
Compare
@@ -155,6 +155,12 @@ def handover_detector(self): | |||
self._test_die(hasattr(self._arm, 'handover_detector'), "This arm does not have a handover_detector") | |||
return self._arm.handover_detector | |||
|
|||
@property | |||
def gripper_position_detector(self): |
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.
What does a gripper_position_detector
do? We already know where the gripper is with the joint_states/TF.
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.
It reads the joint state of the gripper
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.
So how open the fingers are?
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.
Yes
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.
Yes. And upon further inspection we can use the get_joint_states function of the robot object for this but this allows us to already specify which joint corresponds to the fingers. That is something that can potentially be improved. But for now we want to see if this gives us the desired behaviour. Lets not do premature optimization.
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.
That is a different can of worms and not for this project.
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.
The handover_detector
can be ignored in this project, but gripper_position_detector
should be modelled correctly. It doesn't mean it should be done correctly right now in this PR. But it should be done correctly soon.
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.
#stopdeverloederingvanonzecode
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.
We should create an issue about this. With a deadline this should be fixed.
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.
I created an issue to look into the grasp position detector robot part #1248 . It does not have high priority though. So I don't think we need to add a deadline
db06a2c
to
1461fa4
Compare
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.
some minor remarks but looks like a promising start
From testing, seems like an error from the kinect.
|
…:tue-robotics/tue_robocup into feature/implement_grasp_detector_in_grab
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.
A few things we must watch out for in the future:
retrying grasp might not always be desired but we'll see when that becomes a problem.
Some magic numbers are very hero-specific. but as long as we keep it configurable we should be good.
@@ -14,7 +14,7 @@ class ActiveGraspDetector(smach.State): | |||
REQUIRED_ARM_PROPERTIES = {"required_gripper_types": [GripperTypes.GRASPING], } | |||
|
|||
def __init__(self, robot: Robot, arm_designator: ArmDesignator, threshold_difference: float = 0.075, | |||
minimum_position: float = -0.82, max_torque: float = 0.15) -> None: | |||
minimum_position: float = -0.75, max_torque: float = 0.15) -> None: |
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.
These are still very much magic numbers. They have the downside that they need to be tuned constantly. But I think that may be for another time
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.
Make this an issue. If we need keep changing this, this is something we need to work on with high priority.
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.
I created an issue to look into the grasp position detector robot part #1248 . It does not have high priority though. So I don't think we need to add a deadline
Yes, the retry option is defaulted to False for these cases. I think this is the correct way of approaching this. |
@@ -155,6 +155,12 @@ def handover_detector(self): | |||
self._test_die(hasattr(self._arm, 'handover_detector'), "This arm does not have a handover_detector") | |||
return self._arm.handover_detector | |||
|
|||
@property | |||
def gripper_position_detector(self): |
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.
We should create an issue about this. With a deadline this should be fixed.
@@ -14,7 +14,7 @@ class ActiveGraspDetector(smach.State): | |||
REQUIRED_ARM_PROPERTIES = {"required_gripper_types": [GripperTypes.GRASPING], } | |||
|
|||
def __init__(self, robot: Robot, arm_designator: ArmDesignator, threshold_difference: float = 0.075, | |||
minimum_position: float = -0.82, max_torque: float = 0.15) -> None: | |||
minimum_position: float = -0.75, max_torque: float = 0.15) -> None: |
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.
Make this an issue. If we need keep changing this, this is something we need to work on with high priority.
@MatthijsBurgh, your comments have been adressed. can we merge this PR now? |
I have also created #1249. I think this is really important that we keep it structured how robot parts are added. I sometimes get the feeling we are skipping the complex thoughts on how we keep the code organized for the sake of development. But in the end people are complaining code is messy, not robust, hard to maintain, not modular, etc. That is indeed what you get, when you skip the steps to keep your code organized. I don't want to put a hold on development. So first get things working, then refactor it, so it is maintainable, etc. But this should be done before merging stuff into master. Because when it is in master, there is no motivation anymore to fix it. So I am not sure, I accept this code in master yet. Lets have a discussion with everyone tonight how we want to balance between development and good, modular, robust, maintainable, etc. code. |
From testing, I still have this error after add gripperpositiondetector to mockbot.
|
b232dd7
to
f31614e
Compare
… active_grasp_detector
Merge after #1238
Implementation of active_grasp_detector in grab.py. Also added a retry.