ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
This might be of some help: ROS2 Foxy, Creating a Workspace, 'Overlay'
You might try removing all of the build artifacts and rebuilding.
cd ~/ros2_ws
rm -rf ./build/ ./install/ ./log/
setup.bash
: source /opt/ros/foxy/setup.bash # In Bash, "source" is the same as '.' which corresponds to the "SH" shell (its predecessor)
colcon build
ls
should show... build/ install/ log/ src/
.source ./install/setup.bash
. For information on this see my link above.ros2 run my_pkg node_in_pkg
Be sure to run that project-specific setup.bash
!
When you source the base setup script (source /opt/ros/foxy/setup.bash
) your current terminal session only knows about the pre-installed ROS2 packages and such located in /opt/ros/foxy/<blah>
.
You need to make it aware of your package for you to be able to make use of it. That is done by sourcing your own setup script (source ros2_ws/install/setup.bash
).