samplerobot-terrain-walk.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 """
00004  this is example file for SampleRobot robot terrain walking
00005 
00006  for SlopeUpDown
00007  $ roslaunch hrpsys samplerobot-terrain-walk.launch MODEL:=SlopeUpDown
00008  $ rosrun hrpsys samplerobot-terrain-walk.py --SlopeUpDown
00009 
00010  for StairUp
00011  $ roslaunch hrpsys samplerobot-terrain-walk.launch MODEL:=StairUp
00012  $ rosrun hrpsys samplerobot-terrain-walk.py --StairUp
00013 
00014  for StairDown
00015  $ roslaunch hrpsys samplerobot-terrain-walk.launch MODEL:=StairDown
00016  $ rosrun hrpsys samplerobot-terrain-walk.py --StairDown
00017 
00018 """
00019 
00020 import imp, sys, os
00021 
00022 from subprocess import check_output
00023 sys.path.append(os.path.join(check_output(['pkg-config', 'hrpsys-base', '--variable=prefix']).rstrip(),'share/hrpsys/samples/SampleRobot/')) # set path to SampleRobot
00024 
00025 import samplerobot_terrain_walk
00026 
00027 if __name__ == '__main__':
00028     samplerobot_terrain_walk.demo()
00029     import sys
00030     if len(sys.argv) != 2:
00031         print "Usage:"
00032         print " ",sys.argv[0]," --StairUp or --StairDown or --SlopeUpDown"
00033     else:
00034         if sys.argv[1] == "--StairUp":
00035             samplerobot_terrain_walk.demoStairUp()
00036         elif sys.argv[1] == "--StairDown":
00037             samplerobot_terrain_walk.demoStairDown()
00038         elif sys.argv[1] == "--SlopeUpDown":
00039             samplerobot_terrain_walk.demoSlopeUpDown()
00040         else:
00041             print "Usage:"
00042             print " ",sys.argv[0]," --StairUp or --StairDown or --SlopeUpDown"
00043 
00044 
00045 ## IGNORE ME: this code used for rostest
00046 if [s for s in sys.argv if "--gtest_output=xml:" in s] :
00047     import unittest, rostest
00048     rostest.run('hrpsys', 'samplerobot_terrain_walk', unittest.TestCase, sys.argv)
00049 
00050 
00051 
00052 
00053 
00054 


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed May 15 2019 05:02:18