-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bound values. #156
Bound values. #156
Conversation
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.
Minor comments. Merge back develop to get some unit tests and new features.
Try to remove as much Any type as possible. So mypy can work for us
@@ -394,6 +395,21 @@ def goto_joints( | |||
response = self._goto_stub.GoToJoints(request) | |||
return response | |||
|
|||
def _bound_goto_joints_values(self, positions: List[float], degrees: bool = True) -> List[float]: | |||
if not degrees: |
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.
Please add a description of the function to explain what is in degree and what's in radian
src/reachy2_sdk/orbita_utils.py
Outdated
goal_position = Register( | ||
readonly=False, | ||
type=FloatValue, | ||
label="goal_position", | ||
conversion=(_to_internal_position, _to_position), | ||
) | ||
|
||
def __init__(self, initial_state: Dict[str, float], axis_type: str, actuator: Any) -> None: | ||
def __init__(self, initial_state: Dict[str, Any], axis_type: str, actuator: Any) -> 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.
Why the types are changed to Any? Can actuator be typed as well?
src/reachy2_sdk/orbita_utils.py
Outdated
goal_position = Register( | ||
readonly=False, | ||
type=float, | ||
label="goal_position", | ||
conversion=(_to_internal_position, _to_position), | ||
) | ||
|
||
def __init__(self, initial_state: Dict[str, float], axis_type: str, actuator: Any) -> None: | ||
def __init__(self, initial_state: Dict[str, Any], axis_type: str, actuator: Any) -> 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.
Same comment
src/reachy2_sdk/register.py
Outdated
new_value = max(self.lower_limit, min(self.upper_limit, value)) | ||
if new_value != value: | ||
if self.cvt_to_external is not None: | ||
print( |
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.
Merge back develop and use log system
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Bound values for registers:
Note that joint_limit are given in degrees by the server for the moment, while goal_position and present_position are given in degrees. I think all values should be sent in radians by the server, that's why I converted values to degrees.