Ask Your Question
0

[rospack] Error: package 'robot_setup_tf' not found

asked 2020-08-04 04:35:21 -0500

Rahulwashere gravatar image

Hello, I am a beginner at ROS and currently at this tutorial "Setting up your robot using tf"( http://wiki.ros.org/navigation/Tutori... ). I am using ros kinetic. i started out by first configuring my ROS environment like below

printenv | grep ROS

source /opt/ros/kinetic/setup.bash

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws/

/catkin_ws$ catkin_make

so after doing "catkin_make" which works. i create the robot_setup_tf package using

catkin_create_pkg robot_setup_tf roscpp tf geometry_msgs

i then create tf_broadcaster & tf listener in the 'src' folder and copy the code given in the template.

gedit src/tf_broadcaster.cpp

gedit src/tf_listener.cpp

catkin_make

source devel/setup.bash

However when i try to run the following command in a new terminal. (Note that i start roscore in a separate terminal & do source devel/setup,bash in my new terminal too).

rosrun robot_setup_tf tf_broadcaster

in get the following error:

[rospack] Error: package 'robot_setup_tf' not found

I have gone through several answers on ros answers. But i am not able to resolve the issue. Can anyone help ? thanks

edit retag flag offensive close merge delete

Comments

What does echo $ROS_PACKAGE_PATH return? The package robot_setup_tf should be included in this path.

rfn123 gravatar image rfn123  ( 2020-08-04 07:31:51 -0500 )edit

in which terminal should i execute the above command you mentioned? in the same terminal where i created all the packages ? if yes then i executed it but it only returns

/home/rahul/catkin_ws/src:/opt/ros/kinetic/share

No, robot_setup_tf is not shown. note that i executed this command while i was in catkin_ws directory

Rahulwashere gravatar image Rahulwashere  ( 2020-08-04 08:55:25 -0500 )edit

@Rahulwashere in the terminal were you have the error. I see your catkin_ws is in the package path, so this is fine. You should just make sure the "robot_setup_tf" package is in the src directory of your catkin_ws

rfn123 gravatar image rfn123  ( 2020-08-04 16:41:38 -0500 )edit

Hello thank you, i was able to do it, turns out i was setting up my robot_setup_tf package outside src directory, plus i used this command "source ~/catkin_ws/devel/setup.bash

Rahulwashere gravatar image Rahulwashere  ( 2020-08-05 08:46:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-05 09:17:22 -0500

rfn123 gravatar image

In general, when ROS complains that it can't find a package, I would check the package path in the same terminal with

echo $ROS_PACKAGE_PATH

If it's a custom package created by yourself, it should be found within the src folder in one of the workspaces included in the path.

If the workspace the package is in is not in the package path, you have to source the workspace in the terminal you are in. To avoid sourcing everytime you create a new terminal, it's recommended to add the line source path_to_your_workspace/catkin_ws/devel/setup.bash in your ~/.bashrc file

edit flag offensive delete link more

Comments

Thanks it helped.

Rahulwashere gravatar image Rahulwashere  ( 2020-08-05 09:27:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-08-04 04:35:21 -0500

Seen: 957 times

Last updated: Aug 05 '20