gazebo_launcher.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import os
00004 import concert_service_utilities
00005 import rospy
00006 import rocon_python_utils
00007 
00008 from concert_service_gazebo import GazeboRobotManager
00009 
00010 def loginfo(msg):
00011     rospy.loginfo('Gazebo Launcher : %s'%str(msg))
00012 
00013 if __name__ == '__main__':
00014     rospy.init_node('gazebo_launcher')
00015     (service_name, unused_service_description, unused_service_id, unused_key) = concert_service_utilities.get_service_info()
00016     world_file = rospy.get_param('world_file', [])
00017     world_name = rospy.get_param('~world', 'world')
00018     gazebo_binary = rospy.get_param('~gazebo_binary', 'gzserver')
00019     env = os.environ.copy()
00020     
00021     world_file_unpacked = rocon_python_utils.ros.find_resource_from_string(world_file)
00022 
00023     loginfo('Start')
00024     loginfo('World File : %s'%world_file_unpacked) 
00025     loginfo('World Name : %s'%world_name) 
00026     loginfo('Binary     : %s'%gazebo_binary) 
00027 
00028     command_args = ['rosrun', 'gazebo_ros', gazebo_binary, world_file_unpacked, '_name:=' + world_name]
00029     loginfo(str(command_args))
00030     process = rocon_python_utils.system.Popen(command_args, env=env)
00031     rospy.spin()
00032     process.terminate()
00033     loginfo('ByeBye')


concert_service_gazebo
Author(s): Daniel Stonier, Piyush Khandelwal
autogenerated on Thu Jun 6 2019 21:35:16