基于ROS系统的机械臂仿真,模拟运动控制卡的实现方式进行NURBS等插补算法仿真。基于launch文件以及xml语言进行相关定义以及开发,通过moveit!作为配置器,同时通过python脚本实现自定轨迹开发。
1)正运动学模型
X=l1sin(theta1)+l2sin(theta1+theta2);
Y=-l1cos(theta1)-l2cos(theta1+theta2);
Z=theta05(导程为5)+d基准坐标距离
Beta=arcsin( (cos(theta4)+1)/2);
Arpha=arctan((g2sin(theta4))/(1-cos(theta4)))-theta1-theta2-theta3(g2是根号2)
2)逆运动学模型
Theta0=(z-d)/5;
Theta1=arctan(y/x)-arctan((l2sin(theta2))/(l2cos(theta2)+l1))
Theta2=arccos((x^2+y^2-l1^2-l2^2)/(2l1l2))
Theta3=Arpha+theta1+theta2-arctan((g2sin(theta4))/(1-cos(theta4)))
Theta4=arccos(2sin(beta)-1)
3)空间限制
1.主臂碰撞限制:
对于末端的xy位置得到后:|kx-y|/(sqrt(k^2+1)) > 2.758theta2-478.55
即 260sin(theta2)-2.758*theta2+128.55>0 单位都是角度单位,同时k是tan(theta1)
2.y>0:
轨迹规划的目标:建立两条曲线,因为一开始是与水平面夹角为90度,所以可以向左或者向右旋转,经过点的话则是趋向性,由负变到正这样。
具体可见src文件夹:
(1)moveit!设置:存在于mingmoveit_config文件夹,相关子结构图可以见设计说明;
(2)urdf模型设置:存在于mingurdf文件夹,可以实现gazebo下的仿真;
(3)运动仿真:存在于myrobot_control文件夹,可通过myrobot_trajectory.launch文件内部进行运动轨迹自定义;
(4)ros_control配置:存在于roscontrol文件夹下,关于运动参数的设置。
(1)简单使用:编译并刷新环境变量后运行:roslaunch mingurdf gazebo.launch
(2)自定义轨迹:
1.moveit!配置:src\mingmoveit_config文件夹下可以对yaml(系统参数)和launch(运行参数)进行相关修改;
2.运动轨迹导入:src\myrobot_control\launch文件夹下有关轨迹的python连接脚本,可以直接运行相关脚本;