ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

roscd: No such package/stack

asked 2023-06-14 11:21:27 -0500

fbliman gravatar image

updated 2023-06-17 13:54:32 -0500

Mike Scheutzow gravatar image

hi, I am new to ROS and following the tutorials. I am having this problem in the tf2 tutorial step 2

I created a new ws:

$ source /opt/ros/noetic/setup.bash 
$ mkdir -p ~/tutorial_ws/src 
$ cd ~/tutorial_ws 
$ catkin_init_workspace src 
$ catkin_make

Then created the package within the ws:

 ~/Cursos/tutorial_ws
$ catkin_create_pkg learning_tf2 tf2 tf2_ros roscpp rospy turtlesim

redid catkin make and sourced setup.bash

still roscd not finding the package

any help??

Thanks!

edit retag flag offensive close merge delete

Comments

Did you source /opt/ros/noetic/setup.bash or ~/Cursos/tutorial_ws/devel/setup.bash after building?

ngolombek gravatar image ngolombek  ( 2023-06-14 13:44:06 -0500 )edit

Both of them

fbliman gravatar image fbliman  ( 2023-06-14 14:00:10 -0500 )edit

It's a bit hard to know exactly what is going on without being on your computer, but I would suggest sourcing only the local one (tutorial_ws) since it should be an overlay of the main one. Sourcing both can make a mess of your environment. If that doesn't work check the build folders to see if the package was actually build with the correct configuration / binary.

ngolombek gravatar image ngolombek  ( 2023-06-14 14:05:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-17 14:17:01 -0500

Mike Scheutzow gravatar image

updated 2023-06-17 14:27:17 -0500

You have a couple issues:

  1. The commands you show us are not consistent about the path to tutorial_ws/ directory (~/Cursos/tutorial_ws/ is not the same as ~/tutorial_ws/)
  2. You must cd to tutorial_ws/src/ before you run the catkin_create_pkg command. After you run the command, the directory tutorial_ws/src/learning_tf2/ should exist.
  3. catkin_make must be re-run from tutorial_ws/ directory after you create or modify any files below tutorial_ws/src/
  4. The catkin_init_workspace command is unnecessary. I'm not sure what it does and I've never had to use it.

So your problems are caused by inconsistent path names and using wrong directory for package create.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-06-14 11:21:27 -0500

Seen: 76 times

Last updated: Jun 17 '23