OSC_ROS2/ros_osc/joint_info/test.py
2025-02-06 10:19:51 +01:00

10 lines
252 B
Python

import os
import roboticstoolbox as rtb
# Get the URDF from ROS 2
os.system("ros2 param get /robot_state_publisher robot_description > urdf.xml")
# Load the URDF using roboticstoolbox
robot = rtb.ERobot.URDF("urdf.xml")
print("Robot loaded:", robot)