ROS2 Navigation Rosject - How to reproduce the build, log, install folders in ros2_ws of Rosject Navigation if deleted

I accidentally delete the build, log, install folders in rosject and I cannot build any other package anymore.

image

Unlike in the Units, I cannot build any other packages if deleted build, log, install folders

Is there any way to reproduce them (The prebuilt ones from the initial version before I added packages to the Rosject)?
From the error, I can see that build, log, install folders must have something sourced previously for the simulation and later packages added to be built.

Hi @PhongNguyen ,

Deleting the build, log and install folders should not cause you any problem.
You can re-create those folders by building your workspace from scratch, that is, colcon build.

If any of the package goes undetected, try re-creating the package from scratch again and copy the old package contents into the new one.

Doing these should fix your problem. Let me know if you still have issues.

Regards,
Girish

Hi @girishkumar.kannan,

As you can see in the picture, colcon build won’t work. The build, log, install folders already have some pre-built package inside those before for the simulation (making later added package buildable).

So my question is how to recreate it, for example, build and source “turtlebot_3” package the correct way, I do see the different packages default in ros2_ws/src. Try deleting build, log, install folders and you will meet the same error as mine.

Hi @PhongNguyen ,

Your colcon build actually works fine. I do not see any issues there.

For the error: package init file 'project_localization/__init__.py' not found (or not a regular file)
Just create a __init__.py file inside ~/ros2_ws/src/project_localization/project_localization.

You can ignore those warnings. They are not errors.

If you still face issues, please provide the error output as text code-block.

Regards,
Girish