Duplicate package name on course project 2

I am working on course project 2 (turtlebot race). The setup for common file which was referred to course project 1 never works. Could you please send to me a good procedure for setting a common file shared by different package. The error message I got is the following

The three packages used are:

Can you tell me what is wrong in my code and setup? Thanks

Hi @stevenma,

The problem is that the two packages highlighted here have the same name in package.xml. It seems you created the my_turtlebot_topics package by copying over the folder of my_turtlebot_actions and then modifying it.

It will probably work if you correct the package.xml of my_turtlebot_topics, but I would recommend that you recreate packages separately (as many as you didn’t create using the catkin_create_pkg ... command), as this guarantees that the package will be properly created. If you are recreating an existing package, you can

  • Temporarily rename the package folder of the package you want to recreate. It has now become the ‘old’ package.
  • Create the new package using catkin_create_pkg ...
  • Move over important files/folders from the old package into the new package. IMPORTANT: Please don’t move in package.xml and CMakeLists.txt from the old package!
  • Delete the old package folder.

I hope this helps. Please let us know if you need further assistance.

1 Like

Hi @stevenma,
always use

cd ~/catkin_ws/src
catkin_create_pkg "pkg-name" rospy

to create a new package. You can then copy scripts and other files. Oh and dont forget to run

cd ~/catkin_ws
source ~/catkin_ws/devel/setup.bash

so that you can use commands like roslaunch

1 Like