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

[hrpsys_choreonoid/add_objects.py] fix for python3 (convert bytes to str. comment out OpenRTMPlugin) #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion hrpsys_choreonoid/launch/add_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from cnoid.Base import *
from cnoid.BodyPlugin import *
from cnoid.OpenRTMPlugin import *
#from cnoid.OpenRTMPlugin import *
from cnoid.PythonSimScriptPlugin import *
import cnoid.Body

Expand Down Expand Up @@ -46,6 +46,9 @@ def parse_filename(filestr):
pkgname = ret.group(1)
#packagepath = commands.getoutput('rospack find %s'%(pkgname))
packagepath = subprocess.check_output(['rospack', 'find', pkgname])
# From python3, bytes needs to be converted to str manually.
if not isinstance(packagepath, str):
packagepath = packagepath.decode()
packagepath = packagepath.rstrip('\n')
filestr = filestr[:ret.start(0)] + packagepath + filestr[ret.end(0):]

Expand Down