-
Notifications
You must be signed in to change notification settings - Fork 6
fix(mcp): take the achieved position from the controller's result #91
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
base: feat/mcp
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,8 @@ def classify( | |
| return "refused" | ||
| if motion.timed_out: | ||
| return "incomplete" | ||
| if motion.reached_goal: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Low —
|
||
| return "reached" | ||
| if stopped_on_something(commanded_mm, achieved_mm, stroke): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Low — the object-detection floor is now the controller's
Don't align the two numbers: the position comparison itself is on its way out. Once the controller takes stall and reached from the gripper's object status (#96, follow-up to #92), |
||
| return "stopped_on_object" | ||
| return "reached" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,6 +223,7 @@ def test_each_gripper_opens_to_its_own_model_width(): | |
| (motion(reached_goal=False, stalled=True), 85.0, 49.0, "stopped_on_object"), | ||
| (motion(reached_goal=True), 30.0, 30.0, "reached"), | ||
| (motion(reached_goal=False, stalled=True), 30.0, 30.0, "reached"), | ||
| (motion(reached_goal=True), 85.0, 83.1, "reached"), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||
| ], | ||
| ids=[ | ||
| "refused", | ||
|
|
@@ -233,6 +234,7 @@ def test_each_gripper_opens_to_its_own_model_width(): | |
| "open blocked part-way", | ||
| "move landed", | ||
| "move landed but the driver says stalled (#29)", | ||
| "the controller reached within its own tolerance, wider than ours", | ||
| ], | ||
| ) | ||
| def test_classify_decides_from_position_not_the_stall_flag( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit ( |
||
|
|
||
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.
2. Low — the unnamed-position rule is the action result's contract, but lives in the
joint_stateslookupmcp/gripper_mcp/ros_messages.py:108-109.position_ofis also called onjoint_statessamples (ros_backend.py:208,:283). AJointStateon that topic always names its joints, so the branch is dead there and reads as a generic heuristic. Nothing says why it exists. Either add a one-line why (# parallel_gripper_action_controller fills result.state.position but never result.state.name) or split it out so the rule sits on the result path only:and call it from
_result_position(ros_backend.py:334); move the two new tests with it.