ros-industrial / universal_robot

ROS-Industrial Universal Robots support (https://wiki.ros.org/universal_robot)
1.05k stars 1.03k forks source link

Use xacro.load_yaml instead of plain load_yaml #593

Closed Hugal31 closed 1 year ago

Hugal31 commented 2 years ago

A direct call to the load_yaml function is deprecated. Use the namespaced variant xacro.load_yaml.

Otherwise, with xacro 1.14.10, we get

Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead
jakobbak commented 2 years ago

Using the ur_description package with ROS Noetic install on Windows breaks with this change. See output from command prompt below.

ROS Noetic on Windows 10 uses xacro v1.14.5. Would it be worth waiting with this change until relevant distros have upgraded to xacro v1.14.10?

C:\code\ros\thp_ws>roslaunch ur5_moveit_config demo.launch
... logging to C:\Users\jakob\.ros\log\1fc34124-3d4c-11ec-980c-c858c0f21b5a\roslaunch-Fairlight-4288.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
name 'xacro' is not defined
when evaluating expression 'xacro.load_yaml(joint_limits_parameters_file)'
when evaluating expression 'config_joint_limit_parameters['joint_limits']'
when evaluating expression 'sec_limits['shoulder_pan']['min_position']'
when instantiating macro: read_model_data (C:\code\ros\thp_ws\src\universal_robot\ur_description/urdf/inc/ur_common.xacro)
instantiated from: ur_robot (C:\code\ros\thp_ws\src\universal_robot\ur_description/urdf/inc/ur_macro.xacro)
instantiated from: ur5_robot (C:\code\ros\thp_ws\src\universal_robot\ur_description/urdf/inc/ur5_macro.xacro)
in file: C:\code\ros\thp_ws\src\universal_robot\ur_description\urdf\ur5.xacro
RLException: while processing C:\code\ros\thp_ws\src\universal_robot\ur5_moveit_config\launch\move_group.launch:
while processing C:\code\ros\thp_ws\src\universal_robot\ur5_moveit_config\launch\planning_context.launch:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [['xacro', 'C:\\code\\ros\\thp_ws\\src\\universal_robot\\ur_description\\urdf\\ur5.xacro']] returned with code [2].

Param xml is <param if="$(arg load_robot_description)" name="$(arg robot_description)" command="xacro  '$(find ur_description)/urdf/ur5.xacro'"/>
The traceback for the exception was written to the log file
Hugal31 commented 2 years ago

Yes, it is worth waiting for everyone to update.

fmauch commented 2 years ago

I just checked on ROS melodic with xacro 1.13.17-1bionic.20220214.135922 where it also complains about load_yaml. @jakobbak I don't really think this is a versioning problem?

fmauch commented 1 year ago

This looks like it has been implemented in #602. Sorry @Hugal31 I didn't remember this one when creating it.