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

roscd/roslaunch cannot find the package that be built recently

asked 2017-10-12 07:14:47 -0500

tengfei gravatar image

Hi.everyone.I put some packages in my workspace ~/catkin_ws/src recently and then executed the conmmand catkin_make in ~/catkin_ws as usual.But I cannot use roscd to open the new build packages while old packages works. In my ~/.bashrc. I put source /opt/ros/indigo/setup.bash and source /home/shantengfei/catkin_ws/devel/setup.bash in the end.Iguess if I donot put the last setup.bash I cannot roscd any packages in ~/catkin_ws. What makes me confused is that some packages can be opened using roscd while the new one cannot. Could any one please give me a solution?

edit retag flag offensive close merge delete

Comments

did you try running source "~/catkin_ws/devel/setup.bash" in your current terminal? Otherwise try to close everything and open a new consol.

phil333 gravatar image phil333  ( 2017-10-12 10:28:29 -0500 )edit

Thanks for your reply.I put source /home/shantengfei/catkin_ws/devel/setup.bash in my ~/.bashrc, so I guess when I open a new terminal it can source automatically,right? I tried your suggestion but it still does'nt work.

tengfei gravatar image tengfei  ( 2017-10-12 20:47:24 -0500 )edit

whenever you open a new terminal, the code in your ~/.bashrc file is executed. My bashrc file contains source /opt/ros/indigo/setup.bash and source /home/username/catkin_ws/devel/setup.sh Did your run catkin_make before opening a new consol. Is ther a CATKIN_IGNORE in your node maybe?

phil333 gravatar image phil333  ( 2017-10-13 03:31:38 -0500 )edit

After running source /home/shantengfei/catkin_ws/devel/setup.bash, try to run rospack profile, maybe this will solve your problem.

If you just type roscd && pwd, what is the output?

Is your package printed if you run rospack list| grep YOUR_PACKAGE_NAME_HERE?

Ruben Alves gravatar image Ruben Alves  ( 2017-10-13 17:49:22 -0500 )edit

Hi Ruben.Sorry to reply you solate. After trying the command rospack profile it worked.But if I create new package, should I execute the command rospack profile every time?

tengfei gravatar image tengfei  ( 2017-10-24 04:14:02 -0500 )edit

Hi @tengfei, I've added as an answer because the comments are limited in size. In summary, YES, every time I create a new package, I run rospack profile to make sure it will be find.

Ruben Alves gravatar image Ruben Alves  ( 2017-10-24 07:00:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-10-24 06:58:49 -0500

Hi @tengfei

Even if you add source ~/catkin_ws/devel/setup.bash to your ~/.bashrc file, it only will be automatically executed when you open a shell.

If you create new packages, the setup.bash won't be automatically executed on the shell that is already open, then, what I do is to run the following commands every time I create a new ROS Package:

source ~/catkin_ws/devel/setup.bash
rospack profile

Probably only one of then would work, but I always run both commands to make sure it will find my recent created packages, messages, etc.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-10-12 07:14:47 -0500

Seen: 1,460 times

Last updated: Oct 24 '17