Reputation: 21
I am using Untuntu 22.04 in WSL trying to install ROS2 Humble.
After following the tutorial in ROS2 website, I am stuck with the step
source /opt/ros/humble/setup.bash
I have installed ROS2 but am unable to run it with the command ros2
even after I have sourced setup.bash
.
I have double checked I am using Bash shell.
Found no solutions on the internet.
My last resort was ChatGPT, it said "ros2 executable is not present in the /opt/ros/humble/bin directory
"
Anyone know what's the issue and how to solve it.
Greatly appreciated!
Upvotes: 0
Views: 2473
Reputation: 146
First possibility is that you may not have installed it in the right place. Please check if there is such a directory /opt/ros/humble
.
ls /opt/ros/humble
If your output is like this No such file or directory
, it means you did not install it correctly.
It may be installed in another location on the computer, so search the system with this command sudo find / -name humble
. If you do not get any output, it means that the installation has not been done.
Follow this page again
Upvotes: 0
Reputation: 1
I think that Ros2 isn't installed in your PC. You need to check the directory
Upvotes: 0
Reputation: 21
Guys I used the source installation https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html instead of binary and successful. It should be ~/ros2_humble/install/local_setup.bash
instead when setting up the environment.
But if you open a new terminal and run ros2
you will still get ros2 command not found
. You will have to do the following:
nano ~/.bashrc
, it opens a text editorsource /<path to ros2>/install/setup.bash
source ~/.bashrc
ros2
againLet me know if the above works for you or I have any mistakes.
Hope it helps!
Upvotes: 0