generate_model_database.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 
00003 import os
00004 import commands
00005 
00006 
00007 def generate_model_database ():
00008 
00009     manifest_dir_path = commands.getoutput('rospack find hrpsys_gazebo_tutorials') + '/environment_models/'
00010     manifest_path = manifest_dir_path + 'manifest.xml'
00011     f = open(manifest_path, 'w')
00012 
00013     f.write("<!-- automatically generated -->\n<?xml version=\"1.0\" ?>\n<database>\n  <name>hrpsys_gazebo</name>\n  <license>Creative Commons Attribution 3.0 Unported</license>\n\n  <models>\n")
00014 
00015     model_name_list = commands.getoutput("ls -F -1 %s | grep / | sed \"s@/@@g\"" % manifest_dir_path).splitlines()
00016     for model_name in model_name_list:
00017         f.write("    <uri>file://%s</uri>\n" % model_name)
00018 
00019     f.write("  </models>\n</database>\n")
00020 
00021     f.close()
00022 
00023 
00024 if __name__ == '__main__':
00025     generate_model_database()


hrpsys_gazebo_tutorials
Author(s): Yohei Kakiuchi
autogenerated on Tue Oct 7 2014 12:01:15