Skip to content

Updated calc docstrings and removed deprecated flag #97

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

Merged
merged 4 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
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
23 changes: 8 additions & 15 deletions evasdk/Eva.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,18 +863,16 @@ def control_acknowledge_collision(self, wait_for_ready=True):
return self.__http_client.control_acknowledge_collision(wait_for_ready=wait_for_ready)

# Calc
def calc_forward_kinematics(self, joints, fk_type='both', tcp_config=None):
def calc_forward_kinematics(self, joints, fk_type=None, tcp_config=None):
"""Gives the position of the robot and orientation of end-effector in 3D space.

Args:
joints (list): a list of joint angles in RADIANS
fk_type (str): 'position', 'orientation', 'both' are available FK types.
Position is the XYZ of the end-effector in METERS from the middle-bottom-center of the robot.
Orientation is the quaternion WXYZ values of the angle of the end-effector.
tcp_config (dict, optional): dict containing TCP configuration.
fk_type (str): deprecated for 5.0.0
tcp_config (dict, optional): dict containing TCP configuration

Returns:
dict: containing 'result', 'success', and the FK type requested.
dict: containing 'result' value, 'position' dict, and 'orientation' dict

Raises:
EvaError: If it is not successful
Expand All @@ -883,10 +881,6 @@ def calc_forward_kinematics(self, joints, fk_type='both', tcp_config=None):
>>> eva.calc_forward_kinematics([0,0,0,0,0,0])
{'result': 'success', 'position': {'x': -0.065000005, 'y': -8.960835e-09, 'z': 0.87839997},
'orientation': {'w': 1, 'x': 0, 'y': 0, 'z': 0}}
>>> eva.calc_forward_kinematics([0,0,0,0,0,0], fk_type='position')
{'x': -0.065000005, 'y': -8.960835e-09, 'z': 0.87839997}
>>> eva.calc_forward_kinematics([0,0,0,0,0,0], fk_type='orientation')
{'w': 1, 'x': 0, 'y': 0, 'z': 0}
"""
self.__logger.debug('Eva.calc_forward_kinematics called')
return self.__http_client.calc_forward_kinematics(joints, fk_type=fk_type, tcp_config=tcp_config)
Expand All @@ -904,7 +898,7 @@ def calc_inverse_kinematics(self, guess, target_position, target_orientation, tc
orientation_type (str: optional): 'matrix', 'axis_angle', 'euler_zyx', or 'quat'(default) orientation types

Returns:
dict: containing 'ik' dict with joint angles (if successful) and 'result' of function call
list: containing joint angles if successful

Raises:
EvaError: If it is not successful
Expand All @@ -914,7 +908,7 @@ def calc_inverse_kinematics(self, guess, target_position, target_orientation, tc
>>> eva_orientation = {'w': 1, 'x': 0, 'y': 0, 'z': 0}
>>> eva_guess = [0, 0, 0, 0, 0, 0]
>>> robot.calc_inverse_kinematics(eva_guess, eva_position, eva_orientation)
{'ik': {'joints': [0, 0, 0, 0, 0, 0], 'result': 'success'}}
[0, 0, 0, 0, 0, 0]
"""
self.__logger.debug('Eva.calc_inverse_kinematics called')
return self.__http_client.calc_inverse_kinematics(guess, target_position, target_orientation,
Expand Down Expand Up @@ -982,7 +976,7 @@ def calc_rotate(self, joints, axis, offset, tcp_config=None):
TCP is considered to be the end-effector of the Robot.

Returns:
dict: containing rotate dict with joint angles and result dict of success/failure
list: containing joint angles

Raises:
EvaError: If it is not successful
Expand All @@ -992,8 +986,7 @@ def calc_rotate(self, joints, axis, offset, tcp_config=None):
>>> "radius": 0.07,
>>> "rotations": {"x": 0, "y": 0, "z": 0}}
>>> robot.calc_rotate([0, 0, 0, 0, 0, 0], axis='y', offset=0.1, tcp_config=eva_tcp)
{'rotate': {'joints': [-2.1625242e-09, -0.012081009, 0.09259305, 3.102962e-09, -0.1803575, -5.4273075e-09],
'result': 'success'}}
[-2.1625242e-09, -0.012081009, 0.09259305, 3.102962e-09, -0.1803575, -5.4273075e-09]
"""
self.__logger.debug('Eva.calc_rotate called')
return self.__http_client.calc_rotate(joints, axis, offset, tcp_config=tcp_config)
2 changes: 1 addition & 1 deletion evasdk/eva_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class EvaHTTPClient:
N_DIGITS = 8
__N_DIGITS = 8

"""
Eva HTTP client
Expand Down