4 PKG =
'hironx_ros_bridge' 8 import hironx_ros_bridge
10 import roslib; roslib.load_manifest(PKG)
11 import hironx_ros_bridge
13 from hironx_ros_bridge
import hironx_client
as hironx
15 from hrpsys
import rtm
26 from rtm
import connectPorts, disconnectPorts
32 modelfile = rospy.get_param(
"hironx/collada_model_filepath")
33 rtm.nshost =
'hiro014' 34 robotname =
"RobotHardware0" 37 cls.robot.init(robotname=robotname, url=modelfile)
45 av_r = [-0.6, -90, -100, 15.2, 9.4, 3.2]
46 av_l = [0.6, -90, -100, -15.2, 9.4,-3.2]
48 self.robot.goInitial()
49 self.robot.log_svc.maxLength(200*15*3)
52 self.robot.setJointAnglesOfGroup(
"rarm" , av_r, 5)
53 self.robot.waitInterpolationOfGroup(
"rarm")
54 self.robot.setJointAnglesOfGroup(
"larm" , av_l, 5)
55 self.robot.waitInterpolationOfGroup(
"larm")
56 self.robot.goInitial(tm=5)
57 self.robot.saveLog(
"/tmp/test_hironx_log")
58 self.robot.goOffPose()
62 if __name__ ==
'__main__':
64 rostest.rosrun(PKG,
'test_hronx_log', TestHiro)
65 print(
"===================================================")
66 print(
"# Please consult test result with following process")
67 print(
"sh /tmp/check-test_hironx_log.sh")
68 command =
"scp hiro@hiro014:/tmp/test_hironx_log.* /tmp/;" 69 command +=
"gnuplot -e 'set style line 1 pointsize 1; plot " 70 for i
in [5,6,7,8,9,10, 11,12,13,14,15,16]:
71 command +=
'"/tmp/test_hironx_log.RobotHardware0_q" using 1:%d with point pointtype %d, '%(i, i-4)
72 command +=
'"/tmp/test_hironx_log.sh_qOut" using 1:%d with linespoints pointtype %d, '%(i, i-4)
73 command +=
"0; pause -1'" 74 with open(
"/tmp/check-test_hironx_log.sh",
"w")
as f: