Ejemplo n.º 1
0
def main():
    arg_fmt = argparse.RawDescriptionHelpFormatter
    parser = argparse.ArgumentParser(formatter_class=arg_fmt,
                                     description=main.__doc__)
    required = parser.add_argument_group('required arguments')

    required.add_argument('-p',
                          '--position',
                          dest='position',
                          nargs=3,
                          type=float,
                          required=True,
                          help='the x, y, z position of the end-effector')

    parser.add_argument(
        '-o',
        '--orientation',
        dest='orientation',
        nargs=4,
        type=float,
        required=True,
        help='the x, y, z, w quaternion orientation of the end-effector')
    args = parser.parse_args(rospy.myargv()[1:])
    print(args.position)
    """ Create the moveit_interface """
    moveit_interface = SawyerMoveitInterface()
    moveit_interface.set_velocity_scaling(.55)
    moveit_interface.set_acceleration_scaling(.55)
    pose = convert_data_to_pose(position=args.position,
                                orientation=args.orientation)
    moveit_interface.set_pose_target(pose)
    moveit_interface.execute(moveit_interface.plan())
Ejemplo n.º 2
0
 def _move_to_start_configuration(self):
     """ Create the moveit_interface """
     if self.start_configuration is not None:
         moveit_interface = SawyerMoveitInterface()
         moveit_interface.set_velocity_scaling(.35)
         moveit_interface.set_acceleration_scaling(.25)
         moveit_interface.set_joint_target(self.start_configuration)
         moveit_interface.execute(moveit_interface.plan())
     else:
         rospy.logwarn("No start configuration provided in your config.json file.")
     self._clear_command()