convert-all-eusmodel.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 import sys
4 import os
5 import os.path
6 import commands
7 import re
8 
9 
11 
12  urdfmodel_dir_path = commands.getoutput('rospack find eusurdf') + "/models/"
13  eusmodel_dir_path = commands.getoutput('rospack find euslisp') + "/jskeus/eus/models/"
14  eusmodel_file_path_list = commands.getoutput('ls ' + eusmodel_dir_path + '*.l -1')
15 
16  for eusmodel_file_path in eusmodel_file_path_list.split('\n'):
17  eusmodel_file_name = os.path.basename(eusmodel_file_path)
18  print "[convert-all-eusmodel] converting %s" % eusmodel_file_name
19  regexp_search_res = re.compile("(.*)\-object\.l").search(eusmodel_file_name)
20  if regexp_search_res:
21  eusmodel_function_name = regexp_search_res.group(1)
22  os.system('rosrun roseus roseus "(progn (load \\"package://eusgazebo/euslisp/eusgazebo-util.l\\") (load \\"package://euslisp/jskeus/eus/models/%s\\") (irteus2urdf-for-gazebo (%s) :urdf-dir \\"%s\\") (exit))"' % (eusmodel_file_name, eusmodel_function_name, urdfmodel_dir_path))
23  os.system('rosrun roseus roseus "(progn (load \\"package://pr2eus_moveit/euslisp/eus2scene.l\\") (load \\"package://euslisp/jskeus/eus/models/%s\\") (generate-scene-file-from-eusobject (%s) \\"%s\\") (exit))"' % (eusmodel_file_name, eusmodel_function_name, urdfmodel_dir_path+eusmodel_function_name+"/model.scene"))
24 
25 if __name__ == '__main__':


eusurdf
Author(s): Kei Okada , Youhei Kakiuchi , Masaki Murooka
autogenerated on Thu Feb 14 2019 03:38:59