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

towards python3 support #1054

Merged
merged 5 commits into from
Sep 19, 2018
Merged

Conversation

v4hn
Copy link
Contributor

@v4hn v4hn commented Sep 8, 2018

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.

@timonegk
Copy link
Contributor

timonegk commented Sep 8, 2018

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(NOT (Boost_VERSION LESS 106700)) instead. (Or swap if and else and drop the NOT.)

@felixvd
Copy link
Contributor

felixvd commented Sep 9, 2018

If you write out the open issues and how to compile with python3, maybe someone could pursue this on WMD?

@v4hn
Copy link
Contributor Author

v4hn commented Sep 11, 2018

Thanks for looking up the minimum version @timonegk .
I didn't think (1) the VERSION conditionals were that new and (2) ubuntu xenial only provides cmake 3.5.
The problem is not so much the minimum_required version but the one installed on the system...

I changed it as you suggested.

@felixvd That was the plan, feel free to look into it. :)
It's quite a bit of compile time/work though to setup a full ROS python3 ROS workspace,
so as a WMD task this has to be somewhat prepared I guess.

Copy link
Contributor

@mlautman mlautman left a 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'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@v4hn
Copy link
Contributor Author

v4hn commented Sep 16, 2018 via email

@mlautman mlautman merged commit 8c62cf2 into moveit:kinetic-devel Sep 19, 2018
v4hn added a commit that referenced this pull request Sep 23, 2018
* 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
v4hn pushed a commit to v4hn/moveit that referenced this pull request Sep 27, 2018
This reverts commit 8c62cf2.

Breaks Python2 support
rhaschke pushed a commit that referenced this pull request Oct 21, 2018
rhaschke pushed a commit to ubi-agni/moveit that referenced this pull request Oct 21, 2018
pull bot pushed a commit to shadow-robot/moveit that referenced this pull request Sep 3, 2020
* 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
pull bot pushed a commit to shadow-robot/moveit that referenced this pull request Sep 3, 2020
sjahr pushed a commit to sjahr/moveit that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants