colcon build --packages-select -build my package with this instruction.
trying to run a publisher node
ros2 run [package_name] talker
ERROR: package not found
Originally posted by rd112 on ROS Answers with karma: 41 on 2020-04-01
Post score: 4
Original comments
Comment by marguedas on 2020-04-01:
This is very limited information.
How is composed your package? Is it a python or cmake package? Does it install an executable named talker ? if yes to what location ?
Please consider profiding more information and relevant bits of code like your CMakeLists or setup.py/cfg
Comment by jacobperron on 2020-04-01:
Did you source the setup file generated by the colcon build command? e.g. install/setup.bash
Comment by sabin on 2021-02-02:
Getting the same error, followed the tutorial step by step, using Python package on Windows. When I run ros2 run my_package my_node I get Package 'my_package' not found
Comment by sabin on 2021-02-02:
The issue was that I called install/local_setup.bat
(as indicated in the tutorial). Calling '.\install\setup.ps1' fixies the issue.
Comment by fabbro on 2022-03-08:
Everytime you build a package, always remember to do (from your ROS2 workspace): source install/setup.bash
and source /opt/ros/foxy/setup.bash
Comment by misty on 2022-04-04:
@fabbro, why do I need to source two setup.bash files? i.e.,
source install/setup.bash and source /opt/ros/foxy/setup.bash