Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes related to issue #47 #55

Merged
merged 4 commits into from
Jan 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion simtrans/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def main():
m = nm

if len(m.links) == 0:
logging.error("cannot read links at all (probably the model refers to another model by <include> tag)")
logging.error("cannot read links at all (probably the model refers to another model by <include> tag or <link> tag contains no <inertial> or <visual> or <collision> item and reduced by simulation optimization process of gz command used inside simtrans)")
return 1

if meshoutput:
Expand Down
5 changes: 4 additions & 1 deletion simtrans/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def read(self, fname, assethandler=None, options=None):

def read2(self, fname, assethandler=None, options=None):
"""Read URDF model data given the model file


** [Deprecated] This function is currently broken but kept for historical reason **
** (might be fixed if "gz sdf" command not work in some situation) **

:param fname: path of the file to read
:param assethandler: asset handler (optional)
:returns: model data
Expand Down
5 changes: 5 additions & 0 deletions simtrans/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def resolveFile(f):
'''
logger.debug('resolveFile from %s' % f)
try:
if f.count('file://') > 0:
ff = os.path.expanduser(f.replace('file://', ''))
if os.path.exists(ff):
logger.debug('resolveFile resolved to %s' % ff)
return ff
if f.count('model://') > 0:
fn = f.replace('model://', '')
paths = ['.', '~/.gazebo/models']
Expand Down