"ros2: command not found" after I source install/local_setup.bash
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!
It succeeded after I tried $ source /opt/ros/foxy/setup.bash or $ source ~/ros2_foxy/ros2-linux/setup.bash first.