gazebo安装。安装教程可以像张亚萍要。
建立一个工作空间文件夹,命名为catkin_ws。在之下建立一个src文件夹,用于存放catkin_ws/src/rr_robot模型文件夹和catkin_ws/src/CmakeLists.txt文件。
-
安装依赖
在 rr_robot_plugin/install/ 下,有armadillo,PQP,yaml三个库的打包文件,将相关压缩包分别解压后,在各自的文件夹下,打开terminal,输入以下命令进行安装:
$ mkdir build $ cd build $ cmake .. $ make -jx $ sudo make install
-
编译ros文件夹
返回ROS工作目录即本例中的catkin_ws目录,打开terminal,输入:
$ catkin_make
这个时候会多出两个文件夹,分别为devel文件夹和build文件夹。
ps:在 飞哥给我的电脑中,工作空间中还有backup文件夹,里面存放着强化学习仿真模型。
-
使用
在catkin_ws/src/rr_robot文件夹下面打开terminal输入以下命令进行启动。前者为zhongdayi版本,后者为dashixiong版本。
roslaunch rr_robot_gazebo kent6v2robot_control.launch#zhongdayi #或者 roslaunch rr_robot_gazebo kent6v2position_control.launch#dashixiong
- 增加的代码文件
在catkin_ws/src/rr_robot/rr_robot_plugin/pythonInterface/GazeboInterface下增加了visaulServo文件夹,包括如下文件,其中toolbox为视觉库。CamerCalibrationData.yaml为相机的参数...
-
使用
在gazebo的仿真环境已经打开的情况下,执行
python VisualServo.py
- Move from current to desired robot configuration
- Control feedback generated by computer vision techniques
Controlling Robots using visual information • Camera location: Eye-in-hand vs. fixed • Camera: mono vs. stereo • Control: image-based vs. position-based
Determine a error function
where
Note:
For insertion machine
-
if camera is fixed type:
$$f_d$$ : coordinates of holes.$$f$$ : coordinates of pins. -
if camera is eye-in-hand type:
$$f_d$$ : coordinates of pins$$f$$ : coordinates of holes
Let
where
Using (1) and (2)
If we ensure an exponential decoupled decrease of the error(
Note that
if
if
if
In our case
We use two eye-in-hand cameras, so
$$k=8 $$ , note that we use mask to filter some dimensions
Consider the robot end-effector moving in a workspace. In base coordinates, the motion is described by an angular velocity
Note: any objects rigidly attached to the end-effector share the same angular and translational velocity.
which can be written in vector notation as
This can be written concisely in matrix form by noting that the cross product can be represented in terms of the skew-symmetric matrix
allowing us to write
Together,
A point,
Suppose that the end-effector is moving with angular velocity
To simplify notation, let
Now, let
then we can get
Finally, we may rewrite these two equations in matrix form to obtain
which is an important result relating image-plane velocity of a point to the relative velocity of the point with respect to the camera.
Visual control by simply stacking the Jacobians for each pair of image point coordinates