Skip to content

Commit

Permalink
[giskard] made threshold of cart_goal optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigul authored Sep 2, 2024
1 parent e67dd2b commit 98bf3b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pycram/external_interfaces/giskard.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,16 @@ def achieve_joint_goal(goal_poses: Dict[str, float]) -> 'MoveResult':

@init_giskard_interface
@thread_safe
def achieve_cartesian_goal(goal_pose: Pose, tip_link: str, root_link: str) -> 'MoveResult':
def achieve_cartesian_goal(goal_pose: Pose, tip_link: str, root_link: str, position_threshold: float = 0.02, orientation_threshold: float = 0.02) -> 'MoveResult':
"""
Takes a cartesian position and tries to move the tip_link to this position using the chain defined by
tip_link and root_link.
:param goal_pose: The position which should be achieved with tip_link
:param tip_link: The end link of the chain as well as the link which should achieve the goal_pose
:param root_link: The starting link of the chain which should be used to achieve this goal
:param position_threshold: Position distance at which the goal is successfully reached
:param orientation_threshold: Orientation distance at which the goal is successfully reached
:return: MoveResult message for this goal
"""
sync_worlds()
Expand All @@ -336,7 +338,7 @@ def achieve_cartesian_goal(goal_pose: Pose, tip_link: str, root_link: str) -> 'M

cart_monitor1 = giskard_wrapper.monitors.add_cartesian_pose(root_link=root_link, tip_link=tip_link,
goal_pose=_pose_to_pose_stamped(goal_pose),
position_threshold=0.02, orientation_threshold=0.02,
position_threshold=position_threshold, orientation_threshold=orientation_threshold,
name='cart goal 1')
end_monitor = giskard_wrapper.monitors.add_local_minimum_reached(start_condition=cart_monitor1)

Expand Down

0 comments on commit 98bf3b6

Please sign in to comment.