项目简介
本项目是用于用户与Interbotix WidowX机械臂进行高级通信的API。该机械臂由6个MX - 64T Dynamixel伺服电机和一个Arbotix - m微控制器组成。项目包含机械臂模拟、运动学计算和使用强化学习学习逆运动学(IK)的框架,虽在Linux操作系统上开发,但理论上具有跨平台性。目前项目中的python/和preesm/文件夹已临时移除,学习部分暂不可用,python/文件夹将很快恢复。
项目的主要特性和功能
- 支持与机械臂串行通信,实现用户与机械臂交互。
- 具备物理模拟功能,用于强化学习中的运动学计算。
- 可读取JSON文件,为项目提供数据支持。
- 支持多种学习算法,对机械臂模拟进行控制学习,并在真实机械臂上测试。
- 可进行坐标转换,包括位置转换为笛卡尔和圆柱坐标。
- 提供简单接口,通过笛卡尔坐标控制机械臂。
- 包含单元测试和测试覆盖率统计功能。
安装使用步骤
前提条件
确保安装以下依赖库:
- KDL库v1.4.0:http://www.orocos.org/kdl
- OpenMP库版本amd64/bionic 5.0.1 - 1:https://www.openmp.org/,通过sudo apt-get install libomp-dev
安装
- LCOV库:http://ltp.sourceforge.net/coverage/lcov.php,通过sudo apt-get install lcov
安装
- Python3及以下Python库:
- TensorFlow库v1.14.0:https://www.tensorflow.org/,通过pip install tensorflow
安装
- Keras库v2.2.4:https://keras.io,通过pip install keras
安装
- ScikitLearn库v0.21.2:https://scikit-learn.org/,通过pip install scikit-learn
安装
- GraphViz库v0.11:https://www.graphviz.org/,通过pip install graphviz
安装
- AnnVisualizer库v2.5:https://pypi.org/project/ann_visualizer/,通过pip install ann_visualizer
安装
- matplotlib库v3.0.3:https://matplotlib.org/,通过pip install matplotlib
安装
- tinyik库v1.2.0:https://pypi.org/project/tinyik/,通过pip install tinyik
安装
安装项目
bash
git clone https://gitlab.insa-rennes.fr/Gael.Gendron/WidowXArmLearning.git
cd build/
cmake ..
make
make install
若仅生成可执行文件而不安装库,执行:
bash
cd build/
cmake ..
运行示例和测试
运行示例
- 设置伺服电机ID示例:
bash cd examples/device_communication/example_id sudo ./example_id
- 控制伺服电机LED示例:
bash cd examples/device_communication/example_led sudo ./example_led
- 机械臂运动示例:
bash cd examples/device_communication/example_movement sudo ./example_movement
- 抓取示例:
bash cd examples/trajectories/example_grab sudo ./example_grab
- 计算有效坐标示例:
bash cd examples/computations/example_coordinates ./example_coordinates
- 坐标转换示例:
bash cd examples/computations/example_converters ./example_converters
- 笛卡尔模式控制示例:
bash cd examples/computations/example_cartesianMode sudo ./example_cartesianMode
- 强化学习模拟控制示例:
bash cd examples/learning/example_learn ./example_learn
- 强化学习模拟控制并在真实机械臂上测试示例:
bash cd examples/learning/example_learn_device sudo ./example_learn_device
运行单元测试
bash
cd tests/gtests
./test-main
生成测试覆盖率:
bash
lcov --capture --directory ./ --output-file coverage.info
genhtml coverage.info --output-directory coverage
运行Python学习测试
bash
cd ../python/
./multitester -h
./multitester
提取结果并可视化:
bash
./multitester
./resultextractor
运行Preesm(当前版本可能存在问题)
bash
../preesm/org.ietr.preesm.reinforcement_learning/Spider/correctCodegen.py ../preesm/org.ietr.preesm.reinforcement_learning/Spider/generated/pi_ddpg.cpp
cd Debug/
./reinforcement-learning
编译Preesm应用:
bash
cd preesm/org.ietr.preesm.reinforcement_learning/Spider/
make
注意事项
- 部分可执行文件运行时需
sudo
权限访问串行端口。 - Preesm应用当前版本(v3.41.1)可能无法正常工作,需等待新版本。
- 当参数值较大时,Preesm应用可能生成大量执行器,导致内存耗尽。
下载地址
点击下载 【提取码: 4003】【解压密码: www.makuang.net】