-
Notifications
You must be signed in to change notification settings - Fork 27
[RSDK-10923] Add IsHoldingSomething to Gripper API #454
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
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -26,6 +26,23 @@ bool GripperClient::grab(const ProtoStruct& extra) { | |
| }); | ||
| } | ||
|
|
||
| Gripper::holding_status GripperClient::is_holding_something(const ProtoStruct& extra) { | ||
| return make_client_helper(this, *stub_, &StubType::IsHoldingSomething) | ||
| .with(extra) | ||
| .invoke([](auto& response) { | ||
| Gripper::holding_status holding_status; | ||
| holding_status.is_holding_something = response.is_holding_something(); | ||
| if response | ||
| .has_meta() { | ||
| holding_status.meta = from_proto(response.meta()); | ||
|
||
| } | ||
| else { | ||
| holding_status.meta = {}; | ||
| } | ||
|
||
| return holding_status; | ||
| }); | ||
| } | ||
|
|
||
| bool GripperClient::is_moving() { | ||
| return make_client_helper(this, *stub_, &StubType::IsMoving).invoke([](auto& response) { | ||
| return response.is_moving(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,13 @@ bool MockGripper::is_moving() { | |
| return false; | ||
| } | ||
|
|
||
| Gripper::holding_status MockGripper::is_holding_something(const ProtoStruct&) { | ||
| Gripper::holding_status res; | ||
| res.is_holding_something = false; | ||
| res.meta = {}; | ||
| return res; | ||
| } | ||
|
|
||
|
||
| ProtoStruct MockGripper::do_command(const ProtoStruct& command) { | ||
| return (peek_command = command); | ||
| } | ||
|
|
||
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.
You can probably just include
proto_value.hpphere.