ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I had a similar experience. It was caused by running the ros2 create in the wrong folder and just generally doing several things in the wrong folder. Then I found this tutorial which may not be very relevant to whot your are trying to code, but this tutorial explicitly tells you where to run create and colcon commands. Your first line line looks suspicious where you had ...
source ~/ros2_foxy/install/setup.bash
Mine typically looks like ....
source /opt/ros/foxy/setup.bash
I use the default installed file instead of copying to several places. So try this tutorial on a new project, paying attention to the folders used in each step. https://index.ros.org/doc/ros2/Tutorials/Custom-ROS2-Interfaces/