URDF Parsers
Parse URDF to general_robotics_toolbox.Robot structure. These parser utilize rospkg and xacro ROS
packages. It may be necessary to build a activate a ROS workspace to find resources like meshes in the file system.
The urdf option should be installed with the package.
pip install general_robotics_toolbox[urdf]
general_robotics_toolbox.urdf
- general_robotics_toolbox.urdf.robot_from_parameter_server(key='robot_description', root_link=None, tip_link=None)
Loads a Robot class from the ROS parameter server. The joints, dimensions, and various limits will be extracted from the URDF data. Inertial properties and other URDF concepts are not currently supported. Use the root_link and tip_link to specify the root and tip of a robot if more than one robot is in the file.
- Parameters:
key (str) – The ROS parameter server key. Defaults to ‘robot_description’. Optional
root_link (str) – The name of the root link (base link) of the robot. If None, this will be determined automatically. Optional
- Return type:
- Returns:
The populated Robot class
- general_robotics_toolbox.urdf.robot_from_xacro_file(fname, package=None, root_link=None, tip_link=None)
Loads a Robot class from a xacro file containing a robot described in URDF XML format. The xacro file will be executed into URDF XML format automatically. The joints, dimensions, and various limits will be extracted from the URDF data. Inertial properties and other URDF concepts are not currently supported. Use the root_link and tip_link to specify the root and tip of a robot if more than one robot is in the file.
- Parameters:
fname (str) – The filename to load. If using the package parameter, this should be relative to the root of the package.
package (str) – The name of a ROS package containing the file. If specified, fname will be relative to this package. Optional
root_link (str) – The name of the root link (base link) of the robot. If None, this will be determined automatically. Optional
- Return type:
- Returns:
The populated Robot class
- general_robotics_toolbox.urdf.robot_from_xml_file(fname, package=None, root_link=None, tip_link=None)
Loads a Robot class from a file containing a robot described in URDF XML format. The joints, dimensions, and various limits will be extracted from the URDF data. Inertial properties and other URDF concepts are not currently supported. Use the root_link and tip_link to specify the root and tip of a robot if more than one robot is in the file.
- Parameters:
fname (str) – The filename to load. If using the package parameter, this should be relative to the root of the package.
package (str) – The name of a ROS package containing the file. If specified, fname will be relative to this package. Optional
root_link (str) – The name of the root link (base link) of the robot. If None, this will be determined automatically. Optional
- Return type:
- Returns:
The populated Robot class
- general_robotics_toolbox.urdf.robot_from_xml_string(xml_string, root_link=None, tip_link=None)
Loads a Robot class from a string containing a robot described in URDF XML format. The joints, dimensions, and various limits will be extracted from the URDF data. Inertial properties and other URDF concepts are not currently supported. Use the root_link and tip_link to specify the root and tip of a robot if more than one robot is in the file.
- Parameters:
xml_string (str) – The URDF XML data in a string
root_link (str) – The name of the root link (base link) of the robot. If None, this will be determined automatically. Optional
- Return type:
- Returns:
The populated Robot class