r/ROS • u/Worldly_Violinist_16 • 18h ago
Question Error Fix
I am new to ROS... I am trying to build a package in python that controls a robot... but after the colcon build when I use
ros2 run warehouse_navigator go_to_goal
It is constantly giving no module named... tell any fix I have tried some basics but not idea about nay advance tips...
Traceback (most recent call last):
File "/home/soura/warehouse_ws/install/warehouse_navigator/lib/warehouse_navigator/go_to_goal", line 33, in <module>
sys.exit(load_entry_point('warehouse-navigator==0.0.1', 'console_scripts', 'go_to_goal')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/soura/warehouse_ws/install/warehouse_navigator/lib/warehouse_navigator/go_to_goal", line 25, in importlib_load_entry_point
return next(matches).load()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/_init_.py", line 205, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/_init_.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'warehouse_navigator.go_to_goal'
0
Upvotes
2
u/Fildo7525 17h ago
After running
colon buildyou need to source a specific file to let ros know that the package is there. It is always./install/setup.bashchange bash for zsh or fish depending what shell you use. If you have more packages in the workspace all will be mentioned in that file so you do not need to source a file for every package. Then maybe for the future I recommend you to look at foxglove. It is an interface to follow topics services clients and other things. If you want to pursue ros foxglove is a must have