samplerobot-terrain-walk.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 """
4  this is example file for SampleRobot robot terrain walking
5 
6  for SlopeUpDown
7  $ roslaunch hrpsys samplerobot-terrain-walk.launch MODEL:=SlopeUpDown
8  $ rosrun hrpsys samplerobot-terrain-walk.py --SlopeUpDown
9 
10  for StairUp
11  $ roslaunch hrpsys samplerobot-terrain-walk.launch MODEL:=StairUp
12  $ rosrun hrpsys samplerobot-terrain-walk.py --StairUp
13 
14  for StairDown
15  $ roslaunch hrpsys samplerobot-terrain-walk.launch MODEL:=StairDown
16  $ rosrun hrpsys samplerobot-terrain-walk.py --StairDown
17 
18 """
19 
20 import imp, sys, os
21 
22 from subprocess import check_output
23 sys.path.append(os.path.join(check_output(['pkg-config', 'hrpsys-base', '--variable=prefix']).rstrip(),'share/hrpsys/samples/SampleRobot/')) # set path to SampleRobot
24 
25 import samplerobot_terrain_walk
26 
27 if __name__ == '__main__':
29  import sys
30  if len(sys.argv) != 2:
31  print "Usage:"
32  print " ",sys.argv[0]," --StairUp or --StairDown or --SlopeUpDown"
33  else:
34  if sys.argv[1] == "--StairUp":
36  elif sys.argv[1] == "--StairDown":
38  elif sys.argv[1] == "--SlopeUpDown":
40  else:
41  print "Usage:"
42  print " ",sys.argv[0]," --StairUp or --StairDown or --SlopeUpDown"
43 
44 
45 ## IGNORE ME: this code used for rostest
46 if [s for s in sys.argv if "--gtest_output=xml:" in s] :
47  import unittest, rostest
48  rostest.run('hrpsys', 'samplerobot_terrain_walk', unittest.TestCase, sys.argv)
49 
50 
51 
52 
53 
54 


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51