anqixu / tello_driver

ROS driver for DJI/Ryze Tello drones
Apache License 2.0
98 stars 97 forks source link

Module import error when launching the node #4

Closed diegomrt closed 5 years ago

diegomrt commented 5 years ago

Hi, (just edited to update the error, the previous was trivial)

Thanks for this great work! I've installed the package following your instructions but I'm getting this argument error when launching the driver_node. How could it be solved?

Thanx in advance!

Argument error

Traceback (most recent call last): File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 306, in main() File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 300, in main robot = TelloNode() File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 74, in init log = RospyLogger('Tello') File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 27, in init super(RospyLogger, self).init(header) TypeError: super() argument 1 must be type, not classobj

Full message

roslaunch tello_driver tello_node.launch ... logging to /home/diego/.ros/log/0c55d44e-2471-11e9-b41c-b88a60e76c65/roslaunch-MAXWELL-409.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://MAXWELL:46255/

SUMMARY

PARAMETERS

NODES /tello/ image_compressed (image_transport/republish) tello (tello_driver/tello_driver_node.py)

ROS_MASTER_URI=http://localhost:11311

process[tello/tello-1]: started with pid [426] process[tello/image_compressed-2]: started with pid [427] Traceback (most recent call last): File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 306, in main() File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 300, in main robot = TelloNode() File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 74, in init log = RospyLogger('Tello') File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 27, in init super(RospyLogger, self).init(header) TypeError: super() argument 1 must be type, not classobj [tello/tello-1] process has died [pid 426, exit code 1, cmd /home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py name:=tello log:=/home/diego/.ros/log/0c55d44e-2471-11e9-b41c-b88a60e76c65/tello-tello-1.log]. log file: /home/diego/.ros/log/0c55d44e-2471-11e9-b41c-b88a60e76c65/tello-tello-1*.log ^C[tello/image_compressed-2] killing on exit shutting down processing monitor... ... shutting down processing monitor complete

anqixu commented 5 years ago

That's weird. What's your Linux distro and OS version? It looks like it might be related to an issue with the version of your Python interpreter. You can find out by first sourceing your ROS's setup.bash, then python2 --version.

For the time being, consider following this solution, by changing to super().init(...) and changing tellopy._internal.logger to inherit from Python's object class.

diegomrt commented 5 years ago

I'm using Ubuntu 16.04 and ROS Kinetic. My python version is Python 2.7.15 :: Anaconda, Inc (it was easier for me to install PyAV using conda)

I managed to solve the former error, but I'm getting a this new one:

ImportError: /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_highgui3.so.3.3: undefined symbol: _ZN20QFutureInterfaceBase13setThreadPoolEP11QThreadPool

Here the complete output:

Full output

$ roslaunch tello_driver tello_node.launch ... logging to /home/diego/.ros/log/54c5329e-2a5a-11e9-91c6-b88a60e76c65/roslaunch-MAXWELL-4141.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://MAXWELL:34553/

SUMMARY

PARAMETERS

NODES /tello/ image_compressed (image_transport/republish) tello (tello_driver/tello_driver_node.py)

ROS_MASTER_URI=http://localhost:11311

process[tello/tello-1]: started with pid [4158] process[tello/image_compressed-2]: started with pid [4159] Traceback (most recent call last): File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 306, in main() File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 300, in main robot = TelloNode() File "/home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py", line 70, in init self.bridge = CvBridge() File "/opt/ros/kinetic/lib/python2.7/dist-packages/cv_bridge/core.py", line 67, in init import cv2 ImportError: /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_highgui3.so.3.3: undefined symbol: _ZN20QFutureInterfaceBase13setThreadPoolEP11QThreadPool [tello/tello-1] process has died [pid 4158, exit code 1, cmd /home/diego/catkin_ws/src/tello_driver/src/tello_driver_node.py name:=tello log:=/home/diego/.ros/log/54c5329e-2a5a-11e9-91c6-b88a60e76c65/tello-tello-1.log]. log file: /home/diego/.ros/log/54c5329e-2a5a-11e9-91c6-b88a60e76c65/tello-tello-1*.log

anqixu commented 5 years ago

This is not a ROS or tello_driver problem, but a problem with either your Python 2 interpreter and/or your installed version of ROS Kinetic's libopencv. I've not used Anaconda with ROS myself, but generally I think it's a bad idea to switch your /usr/bin/env python2 interpreter away from the default Ubuntu one, which is the library version that all your ROS packages from apt are built against.

To fix this issue, you need to make sure that whaterver your /usr/bin/env python2 points to, can import cv2, and that it's the version distributed by your ROS kinetic package. Temporarily removing your Anaconda install from your environmental path might work, and maybe you will need to reinstall the OpenCV package that came with ROS Kinetic.

For more support, check out OpenCV Answers and/or ROS Answers.