国内资料
知乎
https://zhuanlan.zhihu.com/p/79391139
舵机环境搭建
https://zhuanlan.zhihu.com/p/80686651
https://blog.csdn.net/diaodaa/article/details/104579537
项目地址
电机控制器硬件
https://github.com/bgkatz/3phase_integrated
电机控制器固件
BenKatz,之前我已经移植到STM32
https://os.mbed.com/users/benkatz/code/Hobbyking_Cheetah_Compact_DRV8323/
SPlne硬件
https://github.com/bgkatz/SPIne
SPlne软件
https://os.mbed.com/users/benkatz/code/SPIne/
运行时所有代码
https://github.com/mit-biomimetics/Cheetah-Software
手柄驱动
sudo apt-get install joystick
sudo apt-get install xboxdrv
插上手柄如下命令可看到js0
ls /dev/input/
尝试搭建环境
虚拟机
暂时选择的VirtualBox,系统使用Ubuntu18.04.5,最好取消网络连接安装,速度会快一些
安装完成后开启双向粘贴、双向拖动、安装增强功能,修改分辨率
安装git
首先更新软件包
sudo apt-get update -y
sudo apt-get upgrade -y
安装
sudo apt install git
安装依赖
在软件设置中需要打开允许更新,以下补充了PCM安装时的依赖
sudo apt install mesa-common-dev freeglut3-dev coinor-libipopt-dev libblas-dev liblapack-dev gfortran liblapack-dev coinor-libipopt-dev cmake gcc build-essential libglib2.0-dev build-essential autoconf automake autopoint libtool openjdk-8-jdk python-dev
少了一些依赖,既然少了,那我们就补充安装
这里更换命令安装aptitude,自动识别缺少以来进行安装
首先 sudo apt-get install aptitude
sudo aptitude install mesa-common-dev freeglut3-dev coinor-libipopt-dev libblas-dev liblapack-dev gfortran liblapack-dev coinor-libipopt-dev cmake gcc build-essential libglib2.0-dev
安装LCM1.3.1
LCM基础
补充到了上面
sudo apt-get install build-essential autoconf automake autopoint libglib2.0-dev libtool openjdk-8-jdk python-dev
如果提示缺少依赖项同样换命令使用aptitude
LCM
https://github.com/lcm-proj/lcm/releases
下载后进入文件夹
运行./configure,结果正常
make
sudo make install
完成后最好进行复制到/uer/include 中,确保其他用户正常使用
sudo cp -r /usr/local/include/lcm/ /usr/include/
安装QT >= 5.10.0
中国镜像下载qt
http://mirrors.ustc.edu.cn/qtproject/
放进虚拟机后更改运行权限
sudo chmod +x qt-opensource-linux-x64-5.14.0.run
然后运行开始安装
sudo ./qt-opensource-linux-x64-5.14.0.run
安装Eigen
https://gitlab.com/libeigen/eigen
完成后进入文件夹复制
sudo cp -r eigen-3.3.7/ /usr/local/include/eigen3/
过程
git clone https://github.com/mit-biomimetics/Cheetah-Software.git
cd Cheetah-Software
cd scripts # for now, you must actually go into this folder
./make_types.sh # you may see an error like `rm: cannot remove...` but this is okay
cd ..
mkdir build
cd build
cmake .. # there are still some warnings here
make -j
上面速度太慢,这里直接下载zip后移动进去
处理common
不能漏
cd scripts
./make_types.sh
运行cmake ..后出现卡住,显示的正在拷贝
正在克隆这个项目,没有科学上网鬼知道要克隆到什么时间,所以准备直接下载然后放进这个文件夹https://github.com/google/googletest,发现不行,他会删掉,然后我拖到其文件夹下准备单独安装,突然他完成了,不知道是不是检测到这个文件夹
经过测试是他自己克隆完成,这里就等他克隆完成
然后编译显示
把QT目录添加到sim/CmakeLists.txt,取消里面的自动查找,如下
然后编译通过
执行make -j 等待编译,多次验证后不能使用make -j,会导致卡死,建议根据CPU数量加个限制 make -j8
测试
./common/test-common
开始运行
./sim/sim
点击开始后
运行控制器,需要手柄
./user/MIT_Controller/mit_ctrl m s
设置
需要设置rc为0,control_mode为1是站立,4是踏步,此时可以手柄控制行走