Not found: "/home/user/ros2_ws/install/turtlebot3_node/share/turtlebot3_node/local_setup.bash"

I’m in the rosject launch trying to source the setup.bash file to run the simulation. it’s giving me the following error: not found: “/home/user/ros2_ws/install/turtlebot3_node/share/turtlebot3_node/local_setup.bash”

Same thing when I try to run the teleop keyboard.

It seems, this question is duplicate of question from another thread,

Dear @OmarZainA ,

If you’re having trouble sourcing the local_setup.bash file for the turtlebot3_node, here’s what you can do:

  1. Set Up ROS2 Correctly: Make sure you’ve sourced the ROS2 setup file properly. This is crucial for running ROS2 nodes.

  2. Build Your Workspace Again: If you’ve added new packages or changed something, rebuild your workspace with colcon build.

  3. Check the File Path: Sometimes the path might be different in The Construct’s environment. Double-check to make sure you’ve got the right path to the local_setup.bash file.

  4. Look for the File: Use the platform’s IDE or terminal to go to the folder and see if the file is actually there. A simple ls command should list all the files in the directory.

  5. Match ROS2 Distributions: Ensure that the version of ROS2 you’re using (like Foxy or Galactic) is the same as the one needed for turtlebot3_node.

  6. Follow Course Instructions: If you’re doing a specific course on The Construct, stick closely to the instructions they provide.

  7. Check the Simulation: Make sure the simulation and all graphical tools are running well. Problems here can affect running ROS nodes.

  8. Try Restarting: Sometimes, just restarting your project environment on The Construct can fix these kinds of issues.

Hope that helps,

Best regards
Naren

Hello there, looks like I can’t source any setup.bash file in any package. The setup.bash files do exist in the specified paths but for some reason when I run the source command in the terminal I get the no found error. You’re suggesting to colcon build the package before sourcing, but I thought we should source before anything. Thank you for your time.

Hello,
You should source ros (source /opt/ros//setup.bash) before anything if it’s not already added in the bashrc but the source install/setup.bash is dependant of the colcon build execution as all the files in install folder are generated during the compilation.
What you can try is to delete the folder generated by the compilation (all the folder in your ros2 workspace except src), colcon build again and try to source install/setup.bash again.

Hi @OmarZainA

This error implies that you are trying to source a workspace with an install setup that doesn’t exist, therefore there are missing install files (which are generated when the workspace is built) and you should colcon build your workspace before source install/setup.bash .

For future reference ,if you build and source, then set / change / unset any environment variable or make alterations that impact information stored in the CMakeCache.txt, and you need to build and source again.

Kind Regards,
Sarah

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.