# robot_sim
**Repository Path**: dinglide/robot_sim
## Basic Information
- **Project Name**: robot_sim
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 1
- **Created**: 2021-06-10
- **Last Updated**: 2024-11-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# A ROS based Open Source Simulation Environment for Robotics Beginners
基于ROS搭建的机器人仿真环境。其中设计了机器人研究过程中需要预先进行的几个重要实验如各种标定(相机标定,深度图配准,手眼标定),还在仿真环境中实现了两种抓取算法的仿真,一种是传统方法(几何方法)一种是机器学习的方法(GPD),最后一个实验是模拟机械臂采集数据的场景。
视频链接-->[Bilibili](https://www.bilibili.com/video/BV19f4y1h73E)&[YouTube](https://youtu.be/Ky5vFTKUd1w)
| Author | 苏一休 |
| ------ | ----------------- |
| E-mail | 2270678755@qq.com |
## 目录
- [搭建](#搭建)
- [在仿真环境中进行相机标定](#在仿真环境中进行相机标定)
- [在仿真环境中进行深度图配准](#在仿真环境中进行深度图配准)
- [在仿真环境中进行手眼标定](#在仿真环境中进行手眼标定)
- [在仿真环境中抓取](#在仿真环境中抓取)
- [基于几何方法的抓取](#基于几何方法的抓取)
- [基于机器学习方法的抓取](#基于机器学习方法的抓取)
- [在仿真环境中进行数据采集](#在仿真环境中进行数据采集)
## 搭建
此功能包在**Ubuntu16.04**上经过测试,应该适用于其他Linux版本。在你的Catkin工作空间中需要有
* 负责计算aruco二维码位姿态的[aruco_ros](https://github.com/pal-robotics/aruco_ros/tree/kinetic-devel);
* 使用点云的基于深度学习的抓取位姿检测[gpd_ros](https://github.com/atenpas/gpd_ros/)(这个包还需要编译安装[GPD library](https://github.com/atenpas/gpd));
* 手眼标定功能包[easy_handeye](https://github.com/IFL-CAMP/easy_handeye);
* UR机械臂的ROS功能包[universal_robot](https://github.com/ros-industrial/universal_robot/tree/kinetic-devel);
* 此外在`robot_sim/package`中有一些需要用到的但我在上面进行过一些修改的包,如解决gazebo中抓取物体会莫名抖动的包[gazebo-pkgs](https://github.com/JenniferBuehler/gazebo-pkgs),大寰机器人二指抓手AG-95的ROS功能包[dh_gripper_ros](https://github.com/DH-Robotics/dh_gripper_ros)以及其他依赖等。
* 非常感谢以上作者的无私奉献。
以下是如何安装和搭建本ROS功能包
```
cd ~/catkin_ws/src
git clone -b kinetic-devel https://github.com/pal-robotics/aruco_ros #aruco_ros
git clone https://github.com/atenpas/gpd_ros/ #gpd_ros
git clone https://github.com/IFL-CAMP/easy_handeye #easy_handeye
cd easy_handeye
git reset --hard 64b8b88 #使用的是这个版本
cd ..
git clone -b kinetic-devel https://github.com/ros-industrial/universal_robot.git #universal_robot
git clone https://github.com/Suyixiu/robot_sim #本功能包
rosdep install --from-paths src --ignore-src --rosdistro=kinetic #安装依赖
catkin_make
cp -r ./src/robot_sim/experiment/hand_eye_calibration/urdf/aruco/ ~/.gazebo/models #复制aruco模型到gazebo默认模型文件夹中
```
## 在仿真环境中进行相机标定
首先是将相机模型还有标定板模型load进来
```
cd ~/your_catkin_ws/
roslaunch robot_sim camera_calibration.launch
```
之后便可以看到RealSense D435i RGBD相机与标定板,其中这里使用的是7x6内角点,块块大小0.01m的标定板。若想使用其他尺寸的标定板可更改`experiment/camera_calibration/urdf/create_chessboard.py`脚本中的标定板参数后运行以在`experiment/camera_calibration/urdf`目录下生成你所需要的标定板,随后修改`camera_calibration.launch`要load的标定板即可。
其中相机的URDF文件中使用的相机插件设置的相机视角是57°,图像分辨率是1280x720,所以根据相机内参各个参数的的定义算出该相机模型的内参真实值。这个计算与`camera_info`这个topic中的信息一致。