-
Notifications
You must be signed in to change notification settings - Fork 947
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
towards python3 support #1054
towards python3 support #1054
Conversation
VERSION_GREATER_EQUAL was introduced in cmake 3.7. The minimum required version here is 2.8.12. That is why the CI fails. You can use |
If you write out the open issues and how to compile with python3, maybe someone could pursue this on WMD? |
60f7b08
to
6b51d72
Compare
Thanks for looking up the minimum version @timonegk . I changed it as you suggested. @felixvd That was the plan, feel free to look into it. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 after fixing __biltin__
vs __builtins__
@@ -10,6 +12,11 @@ | |||
import argparse | |||
from moveit_commander import MoveGroupCommandInterpreter, MoveGroupInfoLevel, roscpp_initialize, roscpp_shutdown | |||
|
|||
# compatibility with python3 | |||
# python2's input function is dangerous anyway | |||
if hasattr(__builtins__, 'raw_input'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__builtin__
https://stackoverflow.com/a/11181616
There is no need to hardcode python2 in here anymore. Instead rely on whatever ROS was configured to use. https://www.boost.org/doc/libs/1_68_0/libs/python/doc/html/rn.html#rn.version_1_67 Additionally current releases of boost use python27/python36 for the component.
Python3 requires these to be explicit.
6b51d72
to
8e0e087
Compare
Sorry for the delay.
I addressed your comment, @mlautman
|
* detect correct version of python/boost-python There is no need to hardcode python2 in here anymore. Instead rely on whatever ROS was configured to use. https://www.boost.org/doc/libs/1_68_0/libs/python/doc/html/rn.html#rn.version_1_67 Additionally current releases of boost use python27/python36 for the component. * moveitjoy: fix single print statement * moveit_commander: fix print function usage * moveit_commander: fix many implicit local includes Python3 requires these to be explicit. * moveit_commander: python3-compatible cli input
This reverts commit 8c62cf2. Breaks Python2 support
* detect correct version of python/boost-python There is no need to hardcode python2 in here anymore. Instead rely on whatever ROS was configured to use. https://www.boost.org/doc/libs/1_68_0/libs/python/doc/html/rn.html#rn.version_1_67 Additionally current releases of boost use python27/python36 for the component. * moveitjoy: fix single print statement * moveit_commander: fix print function usage * moveit_commander: fix many implicit local includes Python3 requires these to be explicit. * moveit_commander: python3-compatible cli input
This series of (hopefully backward-compatible) patches enables us to build MoveIt with python 3 if the underlying ROS distribution was compiled with python 3 too.
It also fixes a number of common python 2/3 compatibility issues.
Additionally it supports the new boost-style for the python component.
With this I can successfully build MoveIt in python3 and run the moveit_commander_cmdline.py to get a prompt.
There is still open issues (if you try to "use" a group, the shell dies...), but I will leave those to someone else.