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 import os
00030 import sys
00031 import rospy
00032 import traceback
00033 import genmsg.msg_loader
00034 from include.genpy import generator
00035 from include.genpy import genpy_firos
00036 from include import confManager
00037 from include.logger import Log
00038
00039
00040 def launchSetup(main=False):
00041 retcode = 0
00042
00043 Log("INFO", "\nStarting Firos setup...")
00044 Log("INFO", "---------------------------------\n")
00045 Log("INFO", "\nGenerating Message Description Files\n")
00046
00047 try:
00048 robots = confManager.getRobots(True, True)
00049 current_path = os.path.dirname(os.path.abspath(__file__))
00050 outdir = os.path.join(current_path, "include/ros/")
00051 retcode = genpy_firos.genmain(robots, generator.MsgGenerator(genmsg.msg_loader.load_msg_from_string), outdir)
00052 Log("INFO", "\nSuccesfully generated\n")
00053 if main:
00054 sys.exit(retcode or 0)
00055 except Exception as e:
00056 rospy.logerr("\nSomething wrong happened\n")
00057 traceback.print_exc()
00058 Log("ERROR", e)
00059 sys.exit(retcode or 0)
00060
00061
00062 if __name__ == '__main__':
00063
00064 rospy.init_node('firos_setup')
00065 launchSetup(True)