Comments (6)
Just wondering if there was any progress on this. As you know, I've been working on the Gentoo installation for some time now. Desktop_Full is failing on package 182 of 230, tf2_py
, and this is the error I am getting. I'm almost 100% sure this is a python 3 compatibility issue (I'm running Python-3.3.6, and every single problem I've run into with compiling the source is python related... Am I supposed to be using 2.7?). @tfoote
<== Finished processing package [181 of 230]: 'smach_ros'
==> Processing catkin package: 'tf2_py'
==> Building with env: '/opt/ros/jade/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/home/allenh1/catkin_ws/build_isolated/tf2_py'
-- Using CATKIN_DEVEL_PREFIX: /home/allenh1/catkin_ws/devel_isolated/tf2_py
-- Using CMAKE_PREFIX_PATH: /opt/ros/jade
-- This workspace overlays: /opt/ros/jade
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using default Python package layout
-- Using empy: /usr/lib64/python3.3/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/allenh1/catkin_ws/build_isolated/tf2_py/test_results
-- Found gtest: gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-3.3
-- catkin 0.6.14
-- Using these message generators: gencpp;geneus;genlisp;genpy
-- Configuring done
CMake Warning (dev) at CMakeLists.txt:95 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "tf2_msgs_gencpp" of target "tf2_py" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/allenh1/catkin_ws/build_isolated/tf2_py
==> make -j8 -l8 in '/home/allenh1/catkin_ws/build_isolated/tf2_py'
Scanning dependencies of target tf2_py
[100%] Building CXX object CMakeFiles/tf2_py.dir/src/tf2_py.cpp.o
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:62:1: error: invalid conversion from ‘const char_’ to ‘Py_ssize_t {aka long int}’ [-fpermissive]
};
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp: In function ‘PyObject_ transform_converter(const TransformStamped_)’:
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:109:103error: ‘PyString_FromString’ was not declared in this scope
PyObject_SetAttrString(pheader, "frame_id", PyString_FromString((transform->header.frame_id).c_str()));
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp: In function ‘PyObject_ allFramesAsYAML(PyObject_, PyObject_)’:
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:186:59:error: ‘PyString_FromString’ was not declared in this scope
return PyString_FromString(bc->allFramesAsYAML().c_str());
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp: In function ‘PyObject* allFramesAsString(PyObject_, PyObject_)’:
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:192:61:error: ‘PyString_FromString’ was not declared in this scope
return PyString_FromString(bc->allFramesAsString().c_str());
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp: In function ‘PyObject* setTransform(PyObject_, PyObject_)’:
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:388:105error: ‘PyString_AsString’ was not declared in this scope
transform.child_frame_id = PyString_AsString(PyObject_BorrowAttrString(py_transform, "child_frame_id"));
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp: In function ‘PyObject* setTransformStatic(PyObject_, PyObject_)’:
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:419:105error: ‘PyString_AsString’ was not declared in this scope
transform.child_frame_id = PyString_AsString(PyObject_BorrowAttrString(py_transform, "child_frame_id"));
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp: In function ‘void init_tf2()’:
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:512:67:error: ‘PyString_FromString’ was not declared in this scope
pModulerospy = PyImport_Import(item= PyString_FromString("rospy")); Py_DECREF(item);
^
/home/allenh1/catkin_ws/src/geometry_experimental/tf2_py/src/tf2_py.cpp:529:43:error: ‘Py_InitModule’ was not declared in this scope
m = Py_InitModule("_tf2", module_methods);
^
CMakeFiles/tf2_py.dir/build.make:54: recipe for target 'CMakeFiles/tf2_py.dir/src/tf2_py.cpp.o' failed
make[2]: *** [CMakeFiles/tf2_py.dir/src/tf2_py.cpp.o] Error 1
CMakeFiles/Makefile2:711: recipe for target 'CMakeFiles/tf2_py.dir/all' failed
make[1]: *** [CMakeFiles/tf2_py.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'tf2_py':
Command '['/opt/ros/jade/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/allenh1/catkin_ws/build_isolated/tf2_py && /opt/ros/jade/env.sh make -j8 -l8
Command failed, exiting.
from geometry2.
Update: everything builds if I use Python-2.7.
from geometry2.
We still need to fix this though.
from geometry2.
Ya - that would be good. Let me know if I can do anything.
from geometry2.
So I checked, and indeed, tf2_py.cpp
is using the Python 2 C API, which is incompatible with Python 3. From there, there are two choices:
- Making the code compatible with Python 3, for instance by using py3c.
- Rewriting the extension in cython, which would make it easier to understand and maintain, and immediately compatible with both versions of Python.
I don't know enough about the ins and outs of this extension to know which way is better. Anyone knowledgeable has any input on this?
from geometry2.
Thanks to @de-vri-es I just merged #173 which adds python3 compatibility. From his testing this is fixed. If anyone else has time to test this before I make the next release that would be appreciated.
from geometry2.
Related Issues (20)
- Including tf2_geometry_msgs in a catkin package includes two versions of Eigen HOT 1
- Pose and Transform messages are redundant HOT 1
- ROS wiki tf2 tutorial page has errors
- sleep_duration of can_transform takes too much time HOT 1
- New release for Noetic HOT 13
- Wrong warning TF_REPEATED_DATA if 2 different transforms (with different frames) but same timestamp HOT 1
- tf_py.BufferCore not respecting cache_time argument HOT 2
- dotransform TransformStamped datatype not process child_frame_id HOT 2
- rostime_converter loses nanosecond precision
- Failing when Building for Humble with catkin errors
- Error while compiling using catkin for python3.8 HOT 1
- Using AngleShortestPath or getAngleShortestPath in python HOT 2
- Python tf2 buffer does not Detect Jumps in Time HOT 2
- Error in tf2 tutorial
- the parameter "time" not used in canTransform? HOT 1
- Treating a frame and a transform as the same is unclear without digging into source code
- ROS tf2 tutorial misleading content
- lookup_transform error when interpolating in the past HOT 1
- tf2 lookuptransform failed to get target_frame in rosbag play
- [bug] [tf2_ros::Message_filter] `transformReadyCallback()` continue to execute after the destruction of `Message_filter`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geometry2.