Unable to run a slam node (Foxy, Ubuntu 20.04)
I work with a VirtualBox Ubuntu 20.04.4, Turtlebot3 burger with ros2-foxy.
I followed all the instructions from [here](https://emanual.robotis.com/docs/en/platform/turtlebot3/slam/#run-slam-node)
everything works fine, but when I try to launch a slam node:
ros2 launch turtlebot3_cartographer cartographer.launch.py
I get the following error log.
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2022-09-07-23-34-38-836113-user-vm-4655 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future:
exception=InvalidLaunchFileError('py')> Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescriptionsources/anylaunchfileutilities.py", line 53, in getlaunchdescriptionfromanylaunchfile return loader(launchfilepath) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescriptionsources/pythonlaunchfileutilities.py", line 62, in getlaunchdescriptionfrompythonlaunchfile launchfilemodule = loadpythonlaunchfileasmodule(pythonlaunchfilepath) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescriptionsources/pythonlaunchfileutilities.py", line 37, in loadpythonlaunchfileasmodule loader.execmodule(mod) File "<frozen importlib.bootstrapexternal>", line 844, in execmodule File "", line 980, in getcode File "<frozen importlib.bootstrapexternal>", line 1037, in getdata FileNotFoundError: [Errno 2] No such file or directory: '/home/user/turtlebot3ws/install/turtlebot3cartographer/share/turtlebot3_cartographer/launch/cartographer.launch.py' The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchservice.py", line 228, in _processoneevent await self.processevent(nextevent)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchservice.py", line 248, in processevent visitallentitiesandcollectfutures(entity, self.context)) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visitallentitiesandcollectfuturesimpl.py", line 45, in visitallentitiesandcollectfutures futurestoreturn += visitallentitiesandcollectfutures(subentity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visitallentitiesandcollectfuturesimpl.py", line 45, in visitallentitiesandcollectfutures futurestoreturn += visitallentitiesandcollectfutures(subentity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visitallentitiesandcollectfuturesimpl.py", line 38, in visitallentitiesandcollectfutures subentities = entity.visit(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit return self.execute(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/includelaunchdescription.py", line 130, in execute launchdescription = self.launchdescriptionsource.getlaunchdescription(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescriptionsource.py", line 84, in getlaunchdescription self.getlaunchdescription(self._expandedlocation) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescriptionsources/anylaunchdescriptionsource.py", line 53, in _getlaunchdescription return getlaunchdescriptionfromanylaunchfile(location) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launchdescriptionsources/anylaunchfileutilities.py", line 56, in getlaunchdescriptionfromanylaunchfile raise InvalidLaunchFileError(extension, likelyerrors=exceptions) launch.invalidlaunchfileerror.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: [Errno 2] No such file or directory: '/home/user/turtlebot3ws/install/turtlebot3cartographer/share/turtlebot3_cartographer/launch/cartographer.launch.py'
Can anyone spot what I have been doing wrong? Thanks.
Asked by townes-paycheck on 2022-09-07 16:41:45 UTC
Comments
Probably, an installation issue!
Asked by ravijoshi on 2022-09-07 22:44:31 UTC
It looks like that. As the file already exists in that path, it is rather strange.
What I have done to solve the issue is to remove all the TurtleBot3 packages, and also remove the turtlebot3_ws folder manually. This time I did not build the TurtleBot3 package from source. And everything works fine now.
Asked by townes-paycheck on 2022-09-08 01:25:59 UTC
Glad it works!
Asked by ravijoshi on 2022-09-08 01:36:56 UTC