windows/Linux安装动力学仿真软件Frost并计算cassie机器人运动学和动力学

windows/Linux安装动力学仿真软件Frost并计算cassie机器人运动学和动力学

windows安装动力学仿真软件Frost

本文在Matlab2021b和Mathematica13.1环境下配置运行

1、安装matlab
2、安装mathematica
3、安装Frost

安装Frost

1、下载zip
方法一:git clone https://github.com/ayonga/frost-dev.git frost-dev
方法二:直接点击下载zip文件

2、安装 MEX 编译器
在matlab中安装MinGW,过程如下图所示
在这里插入图片描述
3、设置mathematica环境变量

<安装路径>\Wolfram Research\Mathematica\11.0\

4、复制下图这几个dll到math.mexw64文件所在目录,不然会报找不到指定模块错误

不同版本的matlab和mathematica软件下面几种dll可能不一样,用Dependency Walker 2.2软件查找即可(把math.mexw64拖进去,出现黄色问号的就是缺少的dll)
在这里插入图片描述在这里插入图片描述

5、如果上面一步操作成功会弹出下面的对话框,选择Mathematica路径下的math.exe文件即可

在这里插入图片描述

6、出现下面的黑框请不要关闭(mathematica在后台运行),此时会发现matlab中出现下图红框框中的结果,证明该软件安装成功

在这里插入图片描述
7、第一次运行时会出下下面报错,这个没关系,第二次运行就正常了

在这里插入图片描述

Linux安装动力学仿真软件Frost

本文在Matlab2021b和Mathematica13.0环境下配置运行

1、安装matlab

2、安装mathematica

3、安装Frost

安装Frost的过程与在windows环境下类似

1)下载压缩包

2)安装最新的g++编译器

3)运行frost_addpath.m文件,若出现以下错误:

>> frost_addpath
Invalid MEX-file '/usr0/home/rshu/matlab_ws/frost-dev/third/mathlink/math.mexa64': libWSTP64i4.so: cannot open shared object file: No such file or directory

Error in initialize_mathlink (line 8)
    math('$Version')

Error in frost_addpath (line 28)
    initialize_mathlink();

找到libWSTP64i4.so所在路径,将其添加到.bashrc文件中

先输入命令

  sudo gedit .bashrc

打开文件后在其中添加路径

LD_LIBRARY_PATH=<Mathematica安装路径>/Wolfram/Mathematica/13.0/SystemFiles/Libraries/Linux-x86-64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

或者直接使用命令行

export LD_LIBRARY_PATH=<Mathematica安装路径>/Wolfram/Mathematica/13.0/SystemFiles/Libraries/Linux-x86-64:$LD_LIBRARY_PATH

之后用命令行运行matlab(直接打开有可能没从.bashrc文件启动,同样会出现错误)

若遇到类似的问题,如:

>> frost_addpath
Invalid MEX-file '/usr0/home/rshu/matlab_ws/frost-dev/third/mathlink/math.mexa64': libML64i3.so: cannot open shared object file: No such file or directory

Error in initialize_mathlink (line 8)
    math('$Version')

Error in frost_addpath (line 28)
    initialize_mathlink();

同样的方法,找到该文件所在的路径,替换掉上面解决方案中的路径即可,这一错误也可参照官方的github中的issues模块

计算Cassie的动力学示例出错

运行步骤

下载Cassie计算案例

  1. Open the model_gen.m script in MATLAB.
  2. Modify FROST_PATH to reflect your FROST installation directory.
  3. Generate the Cassie FROST model by runnning the first block of code, ending at line
    cassie = Cassie('urdf/cassie.urdf').
  4. Run the rest of the script to generate and export various kinematic and dynamics functions.

运行后报错:

错误使用 RobotLinks/findBaseLink (第 30 行) Duplicated base links: left_pelvis_abduction and right_pelvis_abduction.

Duplicated base links: left_pelvis_abduction and right_pelvis_abduction.

暂时还未找到解决方法,如有同行遇到这个问题解决的希望可以私信交流


2022.10.11 感谢github上大佬的回复解决了这个问题

具体解决方案如下:
frost-dev\matlab\robotics\@RobotLinks\configure.m中的79-102行忽略了质量和惯性为零的链接,从而导致意外的错误。因此,可以直接重置到frost-dev的前一个版本,即cd frost-dev &&git reset 5e17cf8d9d2f --hard或者注释这些行。
在这里插入图片描述
生成的运动学和动力学文件在gen文件夹中

https://zhuanlan.zhihu.com/p/267330682
https://ayonga.github.io/frost-dev/pages/installation.html#setup-default-mex-compiler
https://ww2.mathworks.cn/help/matlab/matlab_external/invalid-mex-file-error.html
https://github.com/UMich-BipedLab/Cassie_Model
https://github.com/UMich-BipedLab/Cassie_Model/issues/5#issuecomment-1274028519

猜你喜欢

转载自blog.csdn.net/qq_43309940/article/details/127040054