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

Safely rename catkin_ws to fix typo

asked 2020-09-10 19:27:20 -0600

pitosalas gravatar image

This is dumb question maybe but before I mess up my environment I want to ask it.

First of all I know that the name of the directory doesn't really matter. But because I am using shared bash scripts it matters to me.

I accidentally type caktin_ws and have been living with this typo. But now it's causing problems. If I rename caktin_ws to catkin_ws, what else do I need to do?

I think I delete catkin_ws/build and then do a catkin_make it should clean everything up again. But before I try I thought I would ask here!

Also even if that's a technique, is there a better, quicker way than recompiling everything?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-09-10 20:42:47 -0600

Looking at the contents of catkin_ws/devel there seems to be absolute paths everywhere. You can try to sed 's/caktin_ws/catkin_ws/g' on every file inside your workspace's build and devel folders but I think there is no better option than recompiling everything.

I would recommend you to do the following on a terminal where you haven't sourced caktin_ws/devel/setup.bash

mv caktin_ws catkin_ws
cd catkin_ws
rm -rf build devel
catkin_make
source devel/setup.bash
rospack profile

Don't forget to add the correct source ~/catkin_ws/devel/setup.bash to your ~/.bashrc file if you don't want to source the workspace manually every time you open a console.

edit flag offensive delete link more

Comments

1

Just an observation: the suggested steps are essentially the steps you'd do to rebuild a Catkin workspace.

As far as the build tools are concerned, renaming your workspace root directory essentially just means you've created "a new workspace", and consequently you should perform the same steps.

And if you happen to also have an install space, be sure to remove that as well.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-11 00:46:59 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-09-10 19:27:20 -0600

Seen: 967 times

Last updated: Sep 10 '20