testarmik.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 from __future__ import with_statement # for python 2.5
00003 __author__ = 'Rosen Diankov'
00004 __license__ = 'Apache License, Version 2.0'
00005 
00006 import roslib; roslib.load_manifest('orrosplanning')
00007 import rospy, time
00008 import orrosplanning.srv
00009 import geometry_msgs.msg
00010 import kinematics_msgs.srv
00011 from numpy import *
00012 
00013 if __name__=='__main__':
00014     rospy.init_node('armik_test')
00015     rospy.wait_for_service('IK')
00016     IKFn = rospy.ServiceProxy('IK',orrosplanning.srv.IK)
00017     req = orrosplanning.srv.IKRequest()
00018     req.pose_stamped.pose.position = geometry_msgs.msg.Point(0.6,0.189,0.7)
00019     req.pose_stamped.pose.orientation = geometry_msgs.msg.Quaternion(0,0.707,0,0.707)
00020     req.pose_stamped.header.frame_id = 'base_footprint'
00021     req.manip_name = 'leftarm'
00022     req.filteroptions = orrosplanning.srv.IKRequest.RETURN_CLOSEST_SOLUTION
00023     res=IKFn(req)
00024     print res
00025 
00026     # test the second service
00027     GetPositionIKFn = rospy.ServiceProxy('GetPositionIK',kinematics_msgs.srv.GetPositionIK)
00028     req = kinematics_msgs.srv.GetPositionIKRequest()
00029     req.ik_request.pose_stamped.pose.position = geometry_msgs.msg.Point(0.6,0.189,0.7)
00030     req.ik_request.pose_stamped.pose.orientation = geometry_msgs.msg.Quaternion(0,0.707,0,0.707)
00031     req.ik_request.pose_stamped.header.frame_id = 'base_footprint'
00032     req.ik_request.ik_link_name = 'l_gripper_palm_link'
00033     res=GetPositionIKFn(req)
00034     print res
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


orrosplanning
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 22:32:59