The pickup action

Once we have the grasping poses, we can use the MoveIt! /pickup action server to send a goal passing all of them. As before, we will create an action client:

# Create move group 'pickup' action client: 
self._pickup_ac = SimpleActionClient('/pickup', PickupAction) 
if not self._pickup_ac.wait_for_server(rospy.Duration(5.0)): 
    rospy.logerr('Pick up action client not available!') 
    rospy.signal_shutdown('Pick up action client not available!') 
    return 

Then, we will try to pick up the can of Coke as many times as needed until we finally do it:

# Pick Coke can object: 
while not self._pickup(self._arm_group, self._grasp_object_name,  self._grasp_object_width): 
    rospy.logwarn('Pick up failed! Retrying ...') 
    rospy.sleep(1.0) 

Inside the ...

Get ROS Programming: Building Powerful Robots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.