SoildWorks模型导入MATLAB(Simmechanics/URDF)

时间:2024-05-18 20:34:44

一、Simmechanics

到MALTAB官网下载simlink

 https://cn.mathworks.com/products/simmechanics/download_smlink.html

按照步骤安装,然后在 SolidWorks 工具-插件里勾选simscape multibody link选项

SoildWorks模型导入MATLAB(Simmechanics/URDF)

在工具栏可以看到simscape multibody link,选择export,选择第一个(不要选第二个first generation,因为MATLAB快不支持第一代了),完成以上步骤后就会自动生成xml文件了(中文名零件名可能会影响导出)。

 

二、SolidWorks生成URDF文件

URDF (Unified Robot Description File)

 

  • Briefly URDF is used to describe a robot and run in ROS (Gazebo or Rviz)

  • More details check the link http://wiki.ros.org/urdf

 

Generate URDF from SolidWorks

 

Download sw_urdf_exporter plugin

 

Prepare The Assembly SolidWorks Model

    • Create the reference frames of each joints respectively according to the DH model
    • Create the reference axis of each joints respectively (basically along with each z axis)

SoildWorks模型导入MATLAB(Simmechanics/URDF)SoildWorks模型导入MATLAB(Simmechanics/URDF)

Using Plugin to export URDF

    • tools ---> file ---> export as urdf

SoildWorks模型导入MATLAB(Simmechanics/URDF)

    • Define the link relationship

SoildWorks模型导入MATLAB(Simmechanics/URDF)

    • Input the parameters
  • please input the joint limit otherwise there will have some errors
  • Check the origin blocks for each joint since the MH has experienced the wrong transformation generated by the plugin

SoildWorks模型导入MATLAB(Simmechanics/URDF)

 

Conclusion

  • Be caution about the direction of frame and axis
  • Be caution about the frame transformation