Go to the documentation of this file.00001
00002
00003 import sys
00004
00005 import roslib; roslib.load_manifest("hrl_pr2_arms")
00006 import rospy
00007
00008 from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher
00009
00010 def main():
00011 rospy.init_node("carefree_switch_controller", sys.argv)
00012 if len(sys.argv) <= 1 or sys.argv[1] in ["-h", "--help"]:
00013 print "Usage: arm_side new_controller '[param_file]'"
00014 return
00015 cs = ControllerSwitcher()
00016 if len(sys.argv) >= 4:
00017 param_path = sys.argv[3]
00018 if 'find' not in param_path:
00019 param_path = "$(find hrl_pr2_arms)/params/" + param_path
00020 print cs.carefree_switch(sys.argv[1], sys.argv[2], param_path)
00021 else:
00022 print cs.carefree_switch(sys.argv[1], sys.argv[2])
00023
00024 if __name__ == "__main__":
00025 main()