ocs2安装

ocs2下载过程中,网络老是断开。

参考资料:

OCS2安装 - 知乎

OCS2安装以及Hunter双足机器人仿真环境配置 - 知乎

Installation — OCS2 1.0.0 documentation

1、学习到方法:

当前网络环境下,git clone老是出错,使用浏览器打开https://github/com/leggedrobotics/ocs2,使用download下载源码。

可以根据github网站的箭头观看文件夹包含其他链接,需要单独下载。有个箭头图标

2、使用github上的issues去查找编译的问题

3、   编译时如果ocs2_doc、ocs2_perceptive_anymal文件夹报错,可删除后再编译,有些东西实在编译不过,就删除源码(主要是doc、exam不是必须的。)否则,需要查看git 的版本。可能需要更新到最新。

一:创建工作空间并克隆OCS2

mkdir -p ~/ocs2_ws/src
cd ~/ocs2_ws/src
git clone https://github.com/leggedrobotics/ocs2.git

二:安装相关依赖包和依赖库

  • C++ compiler with C++11 support
  • Eigen (v3.3)
sudo apt-get update
sudo apt-get install libeigen3-dev
  • Boost C++ (v1.71)

1.从 Boost 的官方网站下载 1.71.0 版本的源代码压缩包,并解压到适当的目录

wget https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2
tar --bzip2 -xf boost_1_71_0.tar.bz2

2.进入解压后的目录,并开始准备构建 Boost

cd boost_1_71_0
./bootstrap.sh

3.安装 Boost

sudo ./b2 install
  • GLPK
sudo apt install libglpk-dev
  • catkin sudo apt-get install catkin
  • pybind11_catkin, ROS package, installable via sudo apt install ros-noetic-pybind11-catkin
  • catkin-pkg package for python3. Install with sudo apt install python3-catkin-tools
  • Doxygen for documentation. Install with sudo apt install doxygen doxygen-latex
  • rqt_multiplot. Install withsudo apt-get install ros-noetic-rqt-multiplot
  • Grid Map. Install with sudo apt install ros-noetic-grid-map
  • Pinocchio and HPP-FCL
cd ~/ocs2_ws/src
# Clone pinocchio
git clone --recurse-submodules https://github.com/leggedrobotics/pinocchio.git
# Clone hpp-fcl
git clone --recurse-submodules https://github.com/leggedrobotics/hpp-fcl.git
# install dependencies
sudo apt install liburdfdom-dev liboctomap-dev libassimp-dev
  • ocs2_robotic_assets
cd ~/ocs2_ws/src
# Clone ocs2_robotic_assets
git clone https://github.com/leggedrobotics/ocs2_robotic_assets.git

1.克隆RaiSim

cd ~/ocs2_ws/src
git clone https://github.com/raisimTech/raisimLib.git

2.将以下行添加到 ~/.bashrc 文件中

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/ocs2_ws/src/raisim/linux/lib
export PYTHONPATH=$PYTHONPATH:~/ocs2_ws/src/raisim/linux/lib
cd /tmp
wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
tar xf onnxruntime-linux-x64-1.7.0.tgz
mkdir -p ~/.local/bin ~/.local/include/onnxruntime ~/.local/lib ~/.local/share/cmake/onnxruntime
rsync -a /tmp/onnxruntime-linux-x64-1.7.0/include/ ~/.local/include/onnxruntime
rsync -a /tmp/onnxruntime-linux-x64-1.7.0/lib/ ~/.local/lib
rsync -a ~/ocs2_ws/src/ocs2/ocs2_mpcnet/ocs2_mpcnet_core/misc/onnxruntime/cmake/ ~/.local/share/cmake/onnxruntime

tips:暂时不需要Virtual environments

三:编译并测试

编译

cd ~/ocs2_ws
catkin init
catkin config --extend /opt/ros/noetic
catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo
catkin build

source环境

source ~/ocs2_ws/devel/setup.bash

测试

roslaunch ocs2_legged_robot_ros legged_robot_ddp.launch

Tips

  • 若编译过程中出现因网络原因下载失败的库,可自行下载后放在src文件夹中后再次编译
  • 编译时如果ocs2_doc、ocs2_perceptive_anymal文件夹报错,可删除后再编译

相关推荐

  1. ocs2安装

    2024-03-27 15:18:03       14 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-27 15:18:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-27 15:18:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-27 15:18:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-27 15:18:03       18 阅读

热门阅读

  1. LeetCode //C - 704. Binary Search

    2024-03-27 15:18:03       20 阅读
  2. 008-如何支持各种语言的项目

    2024-03-27 15:18:03       14 阅读
  3. unity中平台判断

    2024-03-27 15:18:03       14 阅读
  4. .NET Core教程:深入实践与实例解析

    2024-03-27 15:18:03       18 阅读
  5. Gartner发布2024年影响技术提供商的重大趋势

    2024-03-27 15:18:03       18 阅读
  6. Windows CMD命令大全(快速上手)

    2024-03-27 15:18:03       17 阅读
  7. 深入理解 C++ 中的 IO 流【iostream篇】

    2024-03-27 15:18:03       16 阅读
  8. Canathus 一个简单的React表单验证工具

    2024-03-27 15:18:03       15 阅读