error "from tf2_msgs.srv ImportError: No module named srv "
Hello
I am getting the following error:
Traceback (most recent call last):
File "/home/pi/catkin_ws/src/auto_docking/scripts/autoDocking.py", line 17, in <module>
from tf.transformations import quaternion_from_euler
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/__init__.py", line 30, in <module>
from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 40, in <module>
from .buffer import *
File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/buffer.py", line 34, in <module>
from tf2_msgs.srv import FrameGraph, FrameGraphResponse
ImportError: No module named srv
It seems that my ros has lost some tf2 library but I don't know how to reinstall it. I'm wearing a pi with raspibian and Ros Melodic
the problem appears to have arisen after I copied this package (https://github.com/ros/geometry2) to my catkin workspace and run "catkin make" which resulted in failure. Or the problem arose after I ran the command "sudo apt-get install ros-tf2-msgs" and then "sudo apt-get purge ros-tf2-msgs". It was the only different things I did
any suggestion?
thanks
Have you tried
sudo apt install --reinstall ros-melodic-tf2-msgs
?the command "sudo apt install --reinstall ros-melodic-tf2-msgs" resulted in "Unable to locate package ros-melodic-tf2-msgs". So I ran the command "sudo apt install --reinstall ros-tf2-msgs" but the problem persisted.
that package does exists, I just verified it the command in a Docker container. How did you install Melodic?
That package is not part of ROS Melodic, and you really don't want to start mixing these with a regular ROS install.
See wikiUpstreamPackages.
I installed ROS some time ago and I don't remember. Everything was working and I did something wrong. I remember I had difficulty installing ROS MELODIC on the raspibian Buster. I think I followed this installation tutorial: "https://www.hackster.io/dmitrywat/ros..."