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

Revision history [back]

click to hide/show revision 1
initial version

I was able to successfully change the name of my ROS/Catkin package from "PackageA" to "PackageB" by changing the following:

  1. Folder name: /workspace/src/<package_name>
  2. Folder name: /workspace/src/<package_name>/include/<package_name>
  3. Every instance of "PackageA" in the following files located in /workspace/src/<package_name>:
  4. CMakeCache.txt
  5. CMakeLists.txt
  6. CMakeLists.txt.user
  7. package.xml
  8. Any instance of "PackageA" in any of your source files that include header files you've written. E.g. if your main.cpp has anything like #include <PackageA/my_custom_header.h> then you obviously need to replace this too.

Depending on your specific build environment, there may or may not be additional files with instances of "PackageA" that you need to change. But everything above should be at least the bare minimum that you have to change. After I change all of the above, I was able to run catkin_make and everything recompiled as if "PackageB" had been it's name all along.

As jilo and Martin Gunther already stated, running rospack profile enables roscd to handle the name change.

FYI: I would be very careful copy-pasting any packages, since I'd had problems with this before. Depending on your environment and what you're compiling, you make get cmake errors complaining about trying to link libraries to files that already existing in other packages.

I was able to successfully change the name of my ROS/Catkin package from "PackageA" to "PackageB" by changing the following:

  1. Folder name: /workspace/src/<package_name>
  2. Folder name: /workspace/src/<package_name>/include/<package_name>
  3. Every instance of "PackageA" in the following files located in /workspace/src/<package_name>:
  4. :
    • CMakeCache.txt
    • CMakeLists.txt
    • CMakeLists.txt.user
    • package.xml
  5. Any instance of "PackageA" in any of your source files that include header files you've written. E.g. if your main.cpp has anything like #include <PackageA/my_custom_header.h> then you obviously need to replace this too.

Depending on your specific build environment, there may or may not be additional files with instances of "PackageA" that you need to change. But everything above should be at least the bare minimum that you have to change. After I change all of the above, I was able to run catkin_make and everything recompiled as if "PackageB" had been it's name all along.

As jilo and Martin Gunther already stated, running rospack profile enables roscd to handle the name change.

FYI: I would be very careful copy-pasting any packages, since I'd had problems with this before. Depending on your environment and what you're compiling, you make get cmake errors complaining about trying to link libraries to files that already existing in other packages.

I was able to successfully change the name of my ROS/Catkin package from "PackageA" to "PackageB" by changing the following:

  1. Folder name: /workspace/src/<package_name>/workspace/src/PackageA
  2. Folder name: /workspace/src/<package_name>/include/<package_name>/workspace/src/PackageA/include/PackageA
  3. Every instance of "PackageA" in the following files located in /workspace/src/<package_name>/workspace/src/PackageA:
    • CMakeCache.txt
    • CMakeLists.txt
    • CMakeLists.txt.user
    • package.xml
  4. Any instance of "PackageA" in any of your source files that include header files you've written. E.g. if your main.cpp has anything like #include <PackageA/my_custom_header.h> then you obviously need to replace this too.

Depending on your specific build environment, there may or may not be additional files with instances of "PackageA" that you need to change. But everything above should be at least the bare minimum that you have to change. After I change all of the above, I was able to run catkin_make and everything recompiled as if "PackageB" had been it's name all along.

As jilo and Martin Gunther already stated, running rospack profile enables roscd to handle the name change.

FYI: I would be very careful copy-pasting any packages, since I'd had problems with this before. Depending on your environment and what you're compiling, you make get cmake errors complaining about trying to link libraries to files that already existing in other packages.

I was able to successfully change the name of my ROS/Catkin package from "PackageA" to "PackageB" by changing the following:

  1. Folder name: /workspace/src/PackageA
  2. Folder name: /workspace/src/PackageA/include/PackageA
  3. Every instance of "PackageA" in the following files located in /workspace/src/PackageA:
    • CMakeCache.txt
    • CMakeLists.txt
    • CMakeLists.txt.user
    • package.xml
  4. Any instance of "PackageA" in any of your source files that include header files you've written. E.g. if your main.cpp has anything like #include <PackageA/my_custom_header.h> then you obviously need to replace this too.

Depending on your specific build environment, there may or may not be additional files with instances of "PackageA" that you need to change. But everything above should be at least the bare minimum that you have to change. After I change all of the above, I was able to run catkin_make and everything recompiled as if "PackageB" had been it's name all along.

As jilo and Martin Gunther already stated, running rospack profile enables roscd to handle the name change.

FYI: I would be very careful copy-pasting any packages, since I'd had problems with this before. Depending on your environment and what you're compiling, you make get cmake errors complaining about trying to link libraries to files that already existing in other packages.