当前位置:网站首页>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?
边栏推荐
- Software recommendation - Mechanical Major
- TCP protocol debugging tool tcpengine v1.3.0 tutorial
- Jenkins CLI 命令详解
- Host PSQL connecting virtual machine Oracle
- Qt键盘事件(一)——检测按键输入
- [LeetCode]巧用位运算
- Codeworks round 693 (Div. 3) C. long jumps problem solution
- Meizu blood exchange: Alibaba quits? Zhuhai SASAC joins the Bureau, and Huang Zhang hands over the controlling stake! Li Nan is removed from the main staff!
- JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue
- Jia Yueting's Faraday will receive another financing of US $225million in the future, and ff91 will be mass produced soon!
猜你喜欢
随机推荐
Please talk about the financial products with a yield of more than 6%
如何防止跨站点脚本 (XSS) 攻击完整指南
Leetcode 220. duplicate element III exists
详解 Apache Hudi Schema Evolution(模式演进)
Creation and inheritance of JS class
2019q1 global smartphone shipments: Huawei vivo increased significantly, while Apple plummeted 30.2%!
287 finding duplicates
If this.$router Push the same address with different parameters, and the page does not refresh
Custom view - Custom button
【南京农业大学】考研初试复试资料分享
Jia Yueting's Faraday will receive another financing of US $225million in the future, and ff91 will be mass produced soon!
【LOJ3247】「USACO 2020.1 Platinum」Non-Decreasing Subsequences(DP,分治)
Getting started with ARP
How to choose the appropriate data type for fields in MySQL?
Solution to deepin taskbar disappearance
Meizu blood exchange: Alibaba quits? Zhuhai SASAC joins the Bureau, and Huang Zhang hands over the controlling stake! Li Nan is removed from the main staff!
Qt信号和槽连接失败原因及解决办法
What is the difference between cookies, localstorage and sessionstorage?
C TCP client form application asynchronous receiving mode
Qt设计仿真机器人控制器








