Unable to import tf2_sensor_msgs eventhough it is present at /usr/lib/python3/dist-packages/tf2_sensor_msgs and installation of PyKDL ?

asked 2023-01-20 12:13:36 -0500

neurodisk23 gravatar image

Hi, I am trying to import tf2_sensor_msgs for trying a repository, when runnung the launch file I am getting the following error :

File "/home/harshal/heetesh_ws/src/lidar_camera_calibration/scripts/calibrate_camera_lidar.py", line 71, in <module>
from tf2_sensor_msgs.tf2_sensor_msgs import do_transform_cloud

ModuleNotFoundError: No module named 'tf2_sensor_msgs'

I searched and was instructed to install by sudo apt-get install ros-noetic-geometry-msgs

I have the file not in my location /usr/lib/python3/dist-packages/tf2_sensor_msgs but I am not able to import it, also there is one more folder by the name of tf2_msgs but I am able to import it .

Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tf2_msgs
>>>

I am not getting what's the problem I am facing, also I saw that at the end I have to install PyKDL, I am taking the instructions form https://answers.ros.org/question/3801... but unable to do so. My file name is a bit different, rather than PyKDL.so it is PyKDL.cpython-38-x86_64-linux-gnu.so.

System Configuration:
ROS_VERSION=1
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/home/harshal/heetesh_ws/src:/opt/ros/noetic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/harshal/heetesh_ws/devel/share/common-lisp
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic

Note: This is my first question, please let me know of any improvement .

edit retag flag offensive close merge delete