This is the discussion topic for the video and blog post linked above. Please keep all replies relevant to the content, otherwise create a new topic.
This is especially true for ROS2 Humble Hawksbill users. I believe the .py extension still works for the ROS2 Foxy Fitzroy users.
I used humble, and after entering this command , i find this error!
command:
[ros2 run robot_state_publisher robot_state_publisher --ros-args -p robot_description:=“$(xacro path/to/my/xacro/file.urdf.xacro)”]
The error:
Traceback (most recent call last):
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1012, in parse
inp = f = open(filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘path/to/my/xacro/file.urdf.xacro’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1119, in _process
doc = process_file(input_file_name, **opts)
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1096, in process_file
doc = parse(None, input_file_name)
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1016, in parse
raise XacroException(e.strerror + ": " + e.filename, exc=e)
xacro.XacroException: No such file or directory: path/to/my/xacro/file.urdf.xacro [Errno 2] No such file or directory: ‘path/to/my/xacro/file.urdf.xacro’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/opt/ros/humble/bin/xacro”, line 33, in
sys.exit(load_entry_point(‘xacro==2.0.8’, ‘console_scripts’, ‘xacro’)())
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1171, in main
_process(input_file_name, vars(opts))
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1124, in _process
except xml.parsers.expat.ExpatError as e:
AttributeError: module ‘xml’ has no attribute ‘parsers’
[ERROR] [1728228236.185390349] [rcl]: Failed to parse global arguments
terminate called after throwing an instance of ‘rclcpp::exceptions::RCLInvalidROSArgsError’
what(): failed to initialize rcl: Couldn’t parse parameter override rule: ‘-p robot_description:=’. Error: error not set, at ./src/rcl/arguments.c:343
[ros2run]: Aborted
please help me in this regrde.