当前位置:网站首页>QT design simulation robot controller
QT design simulation robot controller
2022-07-24 16:25:00 【User 6557940】
introduction
this paper Jungle Simply implement a 6 Degree of freedom industrial robot simulation controller , Users can use the interface 6 The sliding bar of each axis controls the posture of the robot .
01
Platform and robot model
Platform——vs2008,Qt4.8.6,Coin3D3.1.3
Robot model——KUKA KR16 robot, Model files can be downloaded on the official website (https://www.kuka.com/)
02
UI Design
03
About Robot
This article chooses KUKA KR16 Robots, for example . Check the manual and schematic diagram of the robot to know the length of each rod of the robot , Parameters such as the motion range of each axis .
Robot size
The length and other dimensions of the robot are used to determine the size of the robot DH Parameters ( Related to robot kinematics ):
Axis motion range
The range of motion of each axis needs to be limited in the program :
UI The slider of the interface uses Qt Provided QSlider, So each QSlider The maximum and minimum values of are set as follows :
this->ui.horizontalSlider_Axis1->setRange(-185,185);
this->ui.horizontalSlider_Axis2->setRange(-35,155);
this->ui.horizontalSlider_Axis3->setRange(-130,154);
this->ui.horizontalSlider_Axis4->setRange(-350,350);
this->ui.horizontalSlider_Axis5->setRange(-130,130);
this->ui.horizontalSlider_Axis6->setRange(-350,350);04
About implementation
The implementation process related to the interface is as follows : Drag the mouse to slide the slider of any axis , Rotate the robot axis to the specified angle . What we use here is QSlider One of the signal:valueChanged(int), This signal is emitted every time you drag .
It is mainly implemented in the corresponding slot function :
(1) Get this moment 6 The value of the slider , Let each axis of the robot rotate to its corresponding angle ;
(2) The angle number is displayed in real time in the text box on the left of each slider .
The code of this part is as follows :
void Robot::initUiRobotAxis()
{
this->ui.horizontalSlider_Axis1->setRange(-185,185);
this->ui.horizontalSlider_Axis2->setRange(-35,155);
this->ui.horizontalSlider_Axis3->setRange(-130,154);
this->ui.horizontalSlider_Axis4->setRange(-350,350);
this->ui.horizontalSlider_Axis5->setRange(-130,130);
this->ui.horizontalSlider_Axis6->setRange(-350,350);
connect(ui.horizontalSlider_Axis1,SIGNAL(valueChanged(int)),this,SLOT(setRobotPose()));
connect(ui.horizontalSlider_Axis2,SIGNAL(valueChanged(int)),this,SLOT(setRobotPose()));
connect(ui.horizontalSlider_Axis3,SIGNAL(valueChanged(int)),this,SLOT(setRobotPose()));
connect(ui.horizontalSlider_Axis4,SIGNAL(valueChanged(int)),this,SLOT(setRobotPose()));
connect(ui.horizontalSlider_Axis5,SIGNAL(valueChanged(int)),this,SLOT(setRobotPose()));
connect(ui.horizontalSlider_Axis6,SIGNAL(valueChanged(int)),this,SLOT(setRobotPose()));
}Slot function setRobotPose The implementation is as follows :
void Robot::setRobotPose()
{
double input_Joint[6] = {0,0,0,0,0,0};
input_Joint[0] = 0.01*ui.horizontalSlider_Axis1->value();
input_Joint[1] = 0.01*ui.horizontalSlider_Axis2->value();
input_Joint[2] = 0.01*ui.horizontalSlider_Axis3->value();
input_Joint[3] = 0.01*ui.horizontalSlider_Axis4->value();
input_Joint[4] = 0.01*ui.horizontalSlider_Axis5->value();
input_Joint[5] = 0.01*ui.horizontalSlider_Axis6->value();
ui.lineEdit_Axis1->setText(QString::number(input_Joint[0]));
ui.lineEdit_Axis2->setText(QString::number(input_Joint[1]));
ui.lineEdit_Axis3->setText(QString::number(input_Joint[2]));
ui.lineEdit_Axis4->setText(QString::number(input_Joint[3]));
ui.lineEdit_Axis5->setText(QString::number(input_Joint[4]));
ui.lineEdit_Axis6->setText(QString::number(input_Joint[5]));
this->setAxis(input_Joint);
}05
effect
http://mpvideo.qpic.cn/0af2an66ym4vycqoambaeaqkb4gvzuntan2gjkuha4ba2cipa4aa.f10002.mp4?
边栏推荐
- Using native JS to realize magnifying glass function
- 如何防止跨站点脚本 (XSS) 攻击完整指南
- Solve the timeliness problem caused by Eureka's default cache configuration
- The 3D sensing market is accelerating. Who will be better, TOF or structured light?
- LaneATT
- 20. Shell programming variables
- Replace the image source of Debian full version with Alibaba cloud image source
- Servlet框架(servlet+jsp)+Mysql实现的增删改查+分页(功能包学生信息录入、学生信息增删改查、分页等)
- Introduction to bermudagrass
- 狗牙根植物介绍
猜你喜欢
随机推荐
Replace the image source of Debian full version with Alibaba cloud image source
leetcode:162. 寻找峰值【二分寻找峰值】
如何防止跨站点脚本 (XSS) 攻击完整指南
Quickly view the version of redis in the server
Using native JS to realize magnifying glass function
Multithreading (basic)
简单使用 MySQL 索引
20. Shell programming variables
Is it safe for Anxin securities to open an account on mobile phone?
[leetcode]75. color classification - problem solving (execution time beat 90%, memory consumption beat 78%)
【LOJ3247】「USACO 2020.1 Platinum」Non-Decreasing Subsequences(DP,分治)
Princeton calculus reader 02 Chapter 1 -- composition of functions, odd and even functions, function images
Code shoe set - mt2093 · palindrome digit
Vscode common shortcut keys
deepin任务栏消失解决方法
Codeforces round 690 (Div. 3) C. unique number conventional solution
机器学习笔记 - 构建推荐系统(5) 前馈神经网络用于协同过滤
Huawei Kirin 985 mass production in the third quarter: TSMC 7Nm EUV process, integrated 5g baseband!
[LeetCode]巧用位运算
文件浏览器?Qt也可以实现!









