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

run sample error #62

Open
chongjeelee opened this issue Sep 27, 2021 · 9 comments
Open

run sample error #62

chongjeelee opened this issue Sep 27, 2021 · 9 comments

Comments

@chongjeelee
Copy link

when i run it ,error occured:
kitti2bag -t 2011_09_26 -r 0002 raw_synced .
Traceback (most recent call last):
File "/home/lizj/.local/bin/kitti2bag", line 12, in
import tf
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/init.py", line 30, in
from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/init.py", line 38, in
from tf2_py import *
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/init.py", line 38, in
from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)

@chongjeelee
Copy link
Author

i try many times ,failed finally!
but i can convert raw data to bag file with another method ,kitti_to_bag
i suggest change it ,if you have occured the same problem!

@matigolias
Copy link

I had the same error and fixed it by running:
-> pip uninstall kitti2bag
-> pip2.7 install kitti2bag
Then the "kitti2bag -t 2011_09_26 -r 0002 raw_synced ." command ran fine :)

@Magic-wei
Copy link

I just fixed some bugs and ran kitti2bag -t 2011_09_26 -r 0005 raw_synced . successfully.

Solution: Create a new Python 3 virtual environment (I'm using Python 3.9) and run

# in case you already have ROS installed and sourced
unset PYTHONPATH 

# Install OpenCV Python
pip install opencv-python

# Install ROS Python packages
pip install --extra-index-url https://rospypi.github.io/simple/ rosbag rospy tf tf2_ros tf2_msgs actionlib_msgs geometry_msgs sensor_msgs cv_bridge roslz4

@chongjeelee @matigolias

@ajay1606
Copy link

ajay1606 commented Sep 7, 2022

@Magic-wei After running the command still getting error like the below;

image

Any suggestions, please !!

Python Version: 3.9
Ubuntu 18.04 ROS Melodic

@Magic-wei
Copy link

Magic-wei commented Sep 7, 2022

Hi @ajay1606, I tested on Ubuntu 16.04 LTS and Python 3.9 in an Anaconda environment. Every time I work with kitti2bag, I will first run unset PYTHONPATH (to remove ROS Kinetic path which use Python 2.7 instead) and everything works well.

So I think there are two things for you to double check:

  1. Did you execute unset PYTHONPATH before you pip install packages and run kitti2bag? This command will get rid of the influence from ROS Python environment since it is Python 2.7 for ROS Kinetic and Melodic other than Python 3.x for kitti2bag (one of its dependencies pykitti needs Python 3).
  2. Can you check tf version by pip list | grep tf on your machine? Make sure don't pip install tf directly since it will install a wrong package tf=1.0.0 which is not the tf package we need for ROS and thus get errors. I have tf 1.12.1.post3 installed on my machine.

@ajay1606
Copy link

ajay1606 commented Sep 7, 2022

@Magic-wei Thank you so much for your quick response. by the way after the following command how can we install kitti2bag package?

# in case you already have ROS installed and sourced
unset PYTHONPATH 

# Install OpenCV Python
pip install opencv-python

# Install ROS Python packages
pip install --extra-index-url https://rospypi.github.io/simple/ rosbag rospy tf tf2_ros tf2_msgs actionlib_msgs geometry_msgs sensor_msgs cv_bridge roslz4

Should i run this command ?

pip install kitti2bag

@ajay1606
Copy link

ajay1606 commented Sep 7, 2022

@Magic-wei Thank you its working well now

@Magic-wei
Copy link

@ajay1606 Awesome, good to know it works for you. 😄

@zhongncku
Copy link

@Magic-wei hope u have a good day. I have this problem, could u pls help me! Thank u in advance
#68 (comment)

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

No branches or pull requests

5 participants