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')
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)
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"))
25 if __name__ ==
'__main__':
def convert_all_eusmodel()