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

Cancel goto for head #164

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/reachy2_sdk/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pyquaternion import Quaternion as pyQuat
from reachy2_sdk_api.goto_pb2 import (
CartesianGoal,
GoToAck,
GoToId,
GoToInterpolation,
GoToRequest,
Expand Down Expand Up @@ -229,6 +230,10 @@ def rotate_to(
response = self._goto_stub.GoToJoints(request)
return response

def cancel_goto_by_id(self, goto_id: int) -> GoToAck:
Copy link
Member Author

Choose a reason for hiding this comment

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

I gave the same name as for the arm, but the rotation function are called "look_at", "rotate_to" and "orient" for the head. Any idea on how to call the function?

Copy link
Contributor

Choose a reason for hiding this comment

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

cancel_rotation?

response = self._goto_stub.CancelGoTo(goto_id)
return response

def orient(self, q: pyQuat, duration: float = 2.0, interpolation_mode: str = "minimum_jerk") -> GoToId:
"""Send neck to the orientation given as a quaternion."""
request = GoToRequest(
Expand Down
Loading