|
|
@ -96,17 +96,16 @@ class CleanSurfaceNode(hm.HelloNode): |
|
|
|
|
|
|
|
def trigger_clean_surface_callback(self, request): |
|
|
|
|
|
|
|
tool_width_m = 0.06 |
|
|
|
tool_length_m = 0.06 |
|
|
|
min_extension_m = 0.01 |
|
|
|
max_extension_m = 0.5 |
|
|
|
|
|
|
|
self.look_at_surface() |
|
|
|
strokes, simple_plan, lift_to_surface_m = self.manipulation_view.get_surface_wiping_plan(self.tf2_buffer) |
|
|
|
strokes, simple_plan, lift_to_surface_m = self.manipulation_view.get_surface_wiping_plan(self.tf2_buffer, tool_width_m, tool_length_m) |
|
|
|
|
|
|
|
print('********* lift_to_surface_m = {0} **************'.format(lift_to_surface_m)) |
|
|
|
|
|
|
|
tool_width_m = 0.06 #0.03 |
|
|
|
#safety_from_edge = 0.06 #0.03 |
|
|
|
tool_length_m = 0.06 #0.03 |
|
|
|
min_extension_m = 0.01 |
|
|
|
max_extension_m = 0.5 |
|
|
|
|
|
|
|
if True and (strokes is not None) and (len(strokes) > 0): |
|
|
|
|
|
|
|
if (self.lift_position is not None) and (self.wrist_position is not None): |
|
|
@ -127,7 +126,8 @@ class CleanSurfaceNode(hm.HelloNode): |
|
|
|
initial_wrist_position = self.wrist_position |
|
|
|
extension_m = start['start_wrist_extension_m'] |
|
|
|
|
|
|
|
start_extension_m = initial_wrist_position + extension_m + (tool_length_m/2.0) |
|
|
|
#start_extension_m = initial_wrist_position + extension_m + (tool_length_m/2.0) |
|
|
|
start_extension_m = initial_wrist_position + extension_m |
|
|
|
pose = {'wrist_extension': start_extension_m} |
|
|
|
rospy.loginfo('Extend tool above surface.') |
|
|
|
self.move_to_pose(pose) |
|
|
@ -153,8 +153,8 @@ class CleanSurfaceNode(hm.HelloNode): |
|
|
|
rospy.sleep(0.2) # wait for new lift position |
|
|
|
|
|
|
|
extension_m = start['end_wrist_extension_m'] |
|
|
|
end_extension_m = initial_wrist_position + extension_m - (tool_length_m/2.0) |
|
|
|
#end_extension_m = initial_wrist_position + extension_m - (tool_length_m/2.0) - safety_from_edge |
|
|
|
#end_extension_m = initial_wrist_position + extension_m - (tool_length_m/2.0) |
|
|
|
end_extension_m = initial_wrist_position + extension_m |
|
|
|
pose = {'wrist_extension': end_extension_m} |
|
|
|
rospy.loginfo('Extend tool to end of surface.') |
|
|
|
self.move_to_pose(pose) |
|
|
@ -171,15 +171,16 @@ class CleanSurfaceNode(hm.HelloNode): |
|
|
|
self.move_to_pose(pose) |
|
|
|
|
|
|
|
extension_m = m['start_wrist_extension_m'] |
|
|
|
start_extension_m = initial_wrist_position + extension_m + (tool_length_m/2.0) |
|
|
|
#start_extension_m = initial_wrist_position + extension_m + (tool_length_m/2.0) |
|
|
|
start_extension_m = initial_wrist_position + extension_m |
|
|
|
start_extension_m = max(start_extension_m, min_extension_m) |
|
|
|
pose = {'wrist_extension': start_extension_m} |
|
|
|
rospy.loginfo('Extend tool above surface.') |
|
|
|
self.move_to_pose(pose) |
|
|
|
|
|
|
|
extension_m = m['end_wrist_extension_m'] |
|
|
|
#end_extension_m = initial_wrist_position + extension_m - (tool_length_m/2.0) - safety_from_edge |
|
|
|
end_extension_m = initial_wrist_position + extension_m - (tool_length_m/2.0) |
|
|
|
#end_extension_m = initial_wrist_position + extension_m - (tool_length_m/2.0) |
|
|
|
end_extension_m = initial_wrist_position + extension_m |
|
|
|
end_extension_m = min(end_extension_m, max_extension_m) |
|
|
|
pose = {'wrist_extension': end_extension_m} |
|
|
|
rospy.loginfo('Extend tool to end of surface.') |
|
|
|