Robotics-Nav2-SLAM-Example icon indicating copy to clipboard operation
Robotics-Nav2-SLAM-Example copied to clipboard

"ros2: command not found" after I source install/local_setup.bash

Open ShienF opened this issue 3 years ago • 1 comments

Hi,

I'm ruuning the Nav2 + slam_toolbox Example, and I'm at "Start RViz in the Docker container" - "(Optional) Launching ROS2 components manually" stage.

After I $ source ros2_docker/colcon_ws/install/local_setup.bash(or $ source ros2_docker/colcon_ws/iinstall/local_setup.sh or $ source ros2_docker/colcon_ws/iinstall/setup.bash), and try $ ros2 launch unity_slam_example unity_slam_example.py, the terminal shows: "ros2: command not found".

Or after I $ colcon build in the directory: ros2_docker/colcon_ws, and try $ ros2 launch unity_slam_example unity_slam_example.py, the terminal also shows: "ros2: command not found".

My environment: Ubuntu 20.04, Ros2-foxy

Anyone could help me with this?

Thank you so much!

ShienF avatar Feb 16 '22 07:02 ShienF

It succeeded after I tried $ source /opt/ros/foxy/setup.bash or $ source ~/ros2_foxy/ros2-linux/setup.bash first.

ShienF avatar Mar 16 '22 11:03 ShienF