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
Originally posted by mateusguilherme on ROS Answers with karma: 125 on 2021-01-31
Post score: 0
Original comments
Comment by gvdhoorn on 2021-02-01:
Have you tried sudo apt install --reinstall ros-melodic-tf2-msgs
?
Comment by mateusguilherme on 2021-02-01:
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.
Comment by gvdhoorn on 2021-02-01:\
the command "sudo apt install --reinstall ros-melodic-tf2-msgs" resulted in "Unable to locate package ros-melodic-tf2-msgs"
that package does exists, I just verified it the command in a Docker container. How did you install Melodic?
So I ran the command "sudo apt install --reinstall ros-tf2-msgs" but the problem persisted.
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.
Comment by mateusguilherme on 2021-02-01:
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-melodic-on-raspberry-pi-4-debian-buster-rplidar-a1m8-0d63d1"