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

tf2_py compilation error with Python 3.5 #274

Closed
nwaniek opened this issue Dec 5, 2017 · 4 comments
Closed

tf2_py compilation error with Python 3.5 #274

nwaniek opened this issue Dec 5, 2017 · 4 comments

Comments

@nwaniek
Copy link

nwaniek commented Dec 5, 2017

The function static PyObject *_allFramesAsDot in tf2_py.cpp is incompatible with Python 3.5, as it invokes PyString_FromString. You can find a (trivial) patch at https://gist.github.com/rochus/aa6d274a349c6aaff692a82fa45af450

@nwaniek nwaniek changed the title tf2_py does not compile for Python 3.5 tf2_py compilation error with Python 3.5 Dec 5, 2017
@astoeckel
Copy link

Can confirm, just ran into this issue while compiling ROS on Fedora 27 in a Python 3 venv. The linked patch fixes the problem for me.

@jacknlliu
Copy link

Did anyone run into the issue #259 even with this patch?

@tfoote
Copy link
Member

tfoote commented Dec 29, 2017

This same logic appears to be exactly the same as the contents of the method stringToPython which you're removing: https://github.com/ros/geometry2/blob/indigo-devel/tf2_py/src/python_compat.h#L17-L24 which is designed to specifically to provide this abstraction between python versions.

inline PyObject *stringToPython(const char *input)
{
#if PY_MAJOR_VERSION >= 3
  return PyUnicode_FromString(input);
#else
  return PyString_FromString(input);
#endif
}

I'd like to see that function updated appropriately if there is an issue with it.

@tfoote
Copy link
Member

tfoote commented Jan 19, 2018

Since the proposed patch appears redundant and with the help of @allenh1, tf2_py is confirmed to be building with python 3.5 https://gist.github.com/allenh1/3e81e2a6fb28b728dc24416826e99af9 I'm going to close this until there's a reproducible issue.

@tfoote tfoote closed this as completed Jan 19, 2018
seanyen pushed a commit to ms-iot/geometry2 that referenced this issue Dec 25, 2020
* Generate callbacks after updating message_

Signed-off-by: ymd-stella <world.applepie@gmail.com>

* Add test for multithread TransformListener to test_message_filter

Signed-off-by: ymd-stella <world.applepie@gmail.com>

Co-authored-by: ymd-stella <7959916+ymd-stella@users.noreply.github.com>
seanyen pushed a commit to ms-iot/geometry2 that referenced this issue Mar 22, 2021
* Generate callbacks after updating message_

Signed-off-by: ymd-stella <world.applepie@gmail.com>

* Add test for multithread TransformListener to test_message_filter

Signed-off-by: ymd-stella <world.applepie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants