Skip to content
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
13 changes: 8 additions & 5 deletions arm_commander/commander_moveit.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ def invoke_service(self, ns: str, cls, **kwargs) -> None:
else:
rospy.loginfo(f"[GeneralCommander::invoke_service][Service invoked successfully]")


def controller_select(self, controller_type: ControllerState = ControllerState.TRAJECTORY) -> bool:
"""Attempts to select a given controller via controller manager

Expand Down Expand Up @@ -706,7 +705,8 @@ def move_displacement(self, dx=0.0, dy=0.0, dz=0.0, accept_fraction=0.9999, wait
target_pose.pose.position.y += dy
target_pose.pose.position.z += dz
waypoints = [current_pose.pose, target_pose.pose]
(plan, fraction) = self.move_group.compute_cartesian_path(waypoints, self.CARTE_PLANNING_STEP_SIZE, 0.00)
# changed for new moveit version
(plan, fraction) = self.move_group.compute_cartesian_path(waypoints, self.CARTE_PLANNING_STEP_SIZE)
if fraction < accept_fraction:
rospy.logerr(f'Planning failed')
self.commander_state = GeneralCommanderStates.ABORTED
Expand Down Expand Up @@ -766,7 +766,8 @@ def move_to_position(self, x:float=None, y:float=None, z:float=None, accept_frac
target_in_world_frame:PoseStamped = self.transform_pose(target_pose, self.WORLD_REFERENCE_LINK)
waypoints = [current_in_world_frame.pose, target_in_world_frame.pose]
self.commander_state = GeneralCommanderStates.BUSY
(plan, fraction) = self.move_group.compute_cartesian_path(waypoints, self.CARTE_PLANNING_STEP_SIZE, 0.00)
# changed for new moveit version
(plan, fraction) = self.move_group.compute_cartesian_path(waypoints, self.CARTE_PLANNING_STEP_SIZE)
if fraction < accept_fraction:
rospy.logerr(f'The commander (move_to_position): planning failed due to collision ({fraction})')
self.commander_state, self.commander_state.message = GeneralCommanderStates.ABORTED, 'PLANNING_FAILED_DUE_TO_COLLISION'
Expand Down Expand Up @@ -826,7 +827,8 @@ def move_to_multi_positions(self, xyz_list, reference_frame:str=None, wait=True)
waypoints_list.append(waypoint_in_world_frame.pose)

self.commander_state = GeneralCommanderStates.BUSY
(plan, fraction) = self.move_group.compute_cartesian_path(waypoints_list, self.CARTE_PLANNING_STEP_SIZE, 0.00)
# changed for new moveit version
(plan, fraction) = self.move_group.compute_cartesian_path(waypoints_list, self.CARTE_PLANNING_STEP_SIZE)
if fraction < 0.999:
rospy.logerr(f'The commander (move_to_multi_positions): planning failed due to collision ({fraction})')
self.commander_state, self.commander_state.message = GeneralCommanderStates.ABORTED, 'PLANNING_FAILED_DUE_TO_COLLISION'
Expand Down Expand Up @@ -1008,7 +1010,8 @@ def move_to_multi_poses(self, waypoints_list, reference_frame:str=None, wait=Tru
processed_waypoints_list.append(waypoint_in_world_frame.pose)

self.commander_state = GeneralCommanderStates.BUSY
(plan, fraction) = self.move_group.compute_cartesian_path(processed_waypoints_list, self.CARTE_PLANNING_STEP_SIZE, 0.00)
# changed for new moveit version
(plan, fraction) = self.move_group.compute_cartesian_path(processed_waypoints_list, self.CARTE_PLANNING_STEP_SIZE)
if fraction < 0.999:
rospy.logerr(f'The commander (move_to_multi_poses): planning failed due to collision ({fraction})')
self.commander_state, self.commander_state.message = GeneralCommanderStates.ABORTED, 'PLANNING_FAILED_DUE_TO_COLLISION'
Expand Down
Loading