Cloning the urdf_tutorial for ROS2 galactic

asked 2021-11-02 18:06:11 -0500

KhalidOwlWalid gravatar image

I am currently reading the ros2 galactic documentation here:

https://docs.ros.org/en/galactic/Tuto...

Also, I was trying to clone the repository from the ros2 branch:

https://github.com/ros/urdf_tutorial/...

So what I did was use the command:

git clone -b <branch-name> <URL>

I then followed the tutorial and try to use the command

ros2 launch urdf_tutorial display.launch.py model:=urdf/01-myfirst.urdf

But I am receiving this error:

  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 127, in execute
  launch_description = self.__launch_description_source.get_launch_description(context)
 File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in 
get_launch_description
self._get_launch_description(self.__expanded_location)
File "/opt/ros/galactic/lib/python3.8/site- 
packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
return get_launch_description_from_any_launch_file(location)
File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 
56, in get_launch_description_from_any_launch_file
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: 'PosixPath' 
object is not iterable

Am I missing any dependencies?

p/s : I have tried resourcing my workspace and still the same.

edit retag flag offensive close merge delete

Comments

Please review prior question with similar issue: https://answers.ros.org/question/3691...

osilva gravatar image osilva  ( 2021-11-02 18:34:31 -0500 )edit

For that question, I believe its because he didnt have the generate_launch_description() but I've checked mine and I have already defined it in my launch.py file

KhalidOwlWalid gravatar image KhalidOwlWalid  ( 2021-11-02 19:30:50 -0500 )edit

The error is flagging an issue with the file path. If your file is present make sure it’s pointing to the right path. https://docs.python.org/3/library/pat...

osilva gravatar image osilva  ( 2021-11-03 05:21:59 -0500 )edit