drake是由mitcsail實驗室開發的c++ toolbox,整合了機械人動力學分析工具和控制系統搭建工具,特別是注重於基於優化的設計和分析。
drake不像很多的黑箱**工具,它注重於展示出那些機械人複雜動力學**中的方程。同時drake也提供了高階語言的介面(matlab,python,julia)。
drake支援的版本
ubuntu 版本
python版本
drake 版本
16.04
python2.7
xenial
18.04
python3.6
bionic
curl -o drake.tar.gz .tar.gz
比如,我的是18.04,安裝的版本就是下面的:
curl -o drake.tar.gz bionic.tar.gz
記得要把python的版本換成對應的版本,否則也會報下面的第乙個錯。
conda create -n py36 python=3.6
依賴環境,不對會報下面的第二個錯:
sudo apt install -y coinor-lib*-dev libnlopt-dev libyaml-cpp-dev libamd2 libtbb-dev
測試**:
$ python3 -c 'import pydrake; print(pydrake.__file__)'
# 執行結果如下
~/programs/drake/lib/python3.6/site-packages/pydrake/__init__.py
後面執行複雜一點的測試**:
from pydrake.common import findresourceorthrow
from pydrake.multibody.parsing import parser
from pydrake.multibody.plant import addmultibodyplantscenegraph
from pydrake.systems.analysis import simulator
from pydrake.systems.framework import diagrambuilder
builder = diagrambuilder(
)plant, _ = addmultibodyplantscenegraph(builder)
parser(plant)
.addmodelfromfile(
findresourceorthrow(
"drake/examples/pendulum/pendulum.urdf"))
plant.finalize(
)diagram = builder.build(
)simulator = simulator(diagram)
出現了問題3,解決方法:
知道是環境問題,但是由於沒有指明,所以非常尷尬,然後準備編譯源**,提示差庫,然後安裝了下面這些,總算沒問題了。
sudo apt install libjpeg-dev libtiff-dev libtinyxml-dev libjsoncpp-dev liblz4-dev
錯誤1[解決]:
traceback (most recent call last):
file "", line 1, in file "/home/hocker/disks/diska/programs/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 29, in from . import common
file "/home/hocker/disks/diska/programs/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 1, in from ._module_py import *
importerror: python version mismatch: module was compiled for python 3.6, but the interpreter version is incompatible: 3.7.3 (default, mar 27 2019, 22:11:17)
[gcc 7.3.0].
錯誤2[解決]:
traceback (most recent call last):
file "", line 1, in file "/home/hocker/disks/diska/programs/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 29, in from . import common
file "/home/hocker/disks/diska/programs/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 1, in from ._module_py import *
importerror: libamd.so.2: cannot open shared object file: no such file or directory
錯誤3[解決]:
terminate called after throwing an instance of 'pybind11::error_already_set'
what(
): systemerror: returned a result with an error set
aborted (core dumped)
參考: LAMP環境搭建 php環境搭建
yum groupinstall development tools y yum groupinstall desktop platform development y yum install cmake pcre devel ncurses devel openssl devel libcurl ...
環境搭建 二 Python環境搭建
工欲善其事,必先利其器 要想玩轉python,我們首先需要搭建一套可使用且方便的環境。對於初學者,笨飯糰建議使用 anaconda anaconda 簡介anaconda是python的乙個科學計算發行版,內建了數百個python經常會使用的庫,包括做機器學習或資料探勘的庫。anaconda提供了乙...
環境 lamp環境搭建
以下命令全部使用root執行,如果不用root記得sudo apt update 更新一下可用軟體包列表 apt upgrade 更新已安裝的軟體包 apt install apache2 安裝apache2 systemctl start apache2 啟動apache apt install ...