Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

python3 can't import tf #293

@Acmece

Description

@Acmece

Refer to #259
Follow by @randoms , I start from scratch

mkdir catkin_ws
cd catkin_ws
mkdir src
cd src 
git clone https://github.com/ros/geometry
git clone https://github.com/ros/geometry2
cd ..
virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
pip install catkin_pkg pyyaml empy rospkg numpy
catkin_make
source devel/setup.bash

However:
1) It clones from melodic-devel and I ran into some build errors:

[ 75%] [ 77%] [ 79%] Building CXX object geometry2/tf2/CMakeFiles/tf2.dir/src/cache.cpp.o
Building CXX object geometry2/tf2/CMakeFiles/tf2.dir/src/buffer_core.cpp.o
Building CXX object geometry2/tf2/CMakeFiles/tf2.dir/src/static_cache.cpp.o
/home/acmece/test/src/geometry2/tf2/src/buffer_core.cpp: In member function ‘bool tf2::BufferCore::warnFrameId(const char*, const string&) const’:
/home/acmece/test/src/geometry2/tf2/src/buffer_core.cpp:126:49: error: ‘CONSOLE_BRIDGE_logWarn’ was not declared in this scope
     CONSOLE_BRIDGE_logWarn("%s",ss.str().c_str());
........
.......
make[2]: *** [geometry2/tf2/CMakeFiles/tf2.dir/src/buffer_core.cpp.o] Error 1
make[1]: *** [geometry2/tf2/CMakeFiles/tf2.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

(actually, I change to clone indigo-devel and it can be successfully built)

2) Alough I built indigo-devel and set up an python3 virtual environment, I still cannot import tf with python3

-- Found PythonInterp: /home/acmece/catkin_ws/venv/bin/python (found version "3.4.3") 
-- Using PYTHON_EXECUTABLE: /home/acmece/catkin_ws/venv/bin/python
......
......
-- +++ processing catkin package: 'tf2_py'
-- ==> add_subdirectory(geometry2/tf2_py)
-- Using these message generators: gencpp;genlisp;genpy
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.6", minimum required is "2") 

It seem that I have to use /opt/ros/indigo/lib/python2.7 as long as I source /opt/ros/indigo/setup.bash in order to use catkin_make

I am a freshman of this feild. Any help will be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions