Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 import roslib; roslib.load_manifest('pal_blort')
00038 import re
00039 import subprocess
00040 from multiprocessing import Process
00041 from geometry_msgs.msg import Pose
00042 import sys
00043 from call_SingleShot import singleShotClient
00044 from pose_utils import *
00045
00046
00047 max_error = Pose()
00048 max_error.position.x = 0.3
00049 max_error.position.y = 0.3
00050 max_error.position.z = 0.3
00051 max_error.orientation.x = 0.2
00052 max_error.orientation.y = 0.2
00053 max_error.orientation.z = 0.2
00054 max_error.orientation.w = 0.2
00055
00056 if __name__ == "__main__":
00057 if len(sys.argv) < 3:
00058 print "First the path of the pose file to compare to, second parameter should be the number of tries!"
00059 exit(1)
00060 approxPose = readPose(sys.argv[1])
00061 print "'ve read approxPose : "
00062 print approxPose
00063
00064 nTries = int(sys.argv[2])
00065 nFails = 0
00066 nSuccs = 0
00067 resultPoses = []
00068
00069 for i in range(nTries):
00070 resultPose = singleShotClient()
00071 if resultPose == None:
00072 nFails += 1
00073 else:
00074 if poseValidate(approxPose, resultPose, max_error):
00075 nSuccs += 1
00076 resultPoses.append(resultPose)
00077 else:
00078 nFails += 1
00079 print '\nStatistics: nTries: '+ repr(nTries) + ', nFails: ' + repr(nFails) + ', nSuccs: ' + repr(nSuccs)
00080 if nSuccs > 0:
00081 print 'Average error:'
00082 print poseListAvgDiff(approxPose, resultPoses)
00083
00084 print "\nBig Kahuna Burger. That's that Hawaiian burger joint."
00085
00086