setup.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # MIT License
00004 #
00005 # Copyright (c) <2015> <Ikergune, Etxetar>
00006 #
00007 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
00008 # (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
00009 # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
00010 # subject to the following conditions:
00011 #
00012 # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00013 #
00014 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00015 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
00016 # FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00017 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00018 
00019 
00020 # ROSPY LOGS
00021 # logdebug
00022 # logerr
00023 # logfatal
00024 # loginfo
00025 # logout
00026 # logwarn
00027 
00028 # Import required Python code.
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 # Main function.
00062 if __name__ == '__main__':
00063     # Initialize the node and name it.
00064     rospy.init_node('firos_setup')
00065     launchSetup(True)


firos
Author(s): IƱigo Gonzalez, igonzalez@ikergune.com
autogenerated on Thu Jun 6 2019 17:51:04