1
#include "formrobotpilot.h"
2
#include "ui_formrobotpilot.h"
4FormRobotPilot::FormRobotPilot(
RoboDK*rdk, QWidget *parent) : QWidget(parent),
15setAttribute(Qt::WA_DeleteOnClose);
18setWindowFlags(windowFlags() | Qt::Window);
21ui->radCartesianTool->click();
27FormRobotPilot::~FormRobotPilot(){
37
if(all_robots.length() == 0){
38ui->lblRobot->setText(
"Load a robot");
39
RDK->
ShowMessage(
"Select File-Open to load a robot or a RoboDK station",
false);
46
boolrobot_is_selected = (
Robot!=
nullptr);
47
if(robot_is_selected) {
48ui->lblRobot->setText(
"Selected robot:\n"+
Robot->
Name());
50ui->lblRobot->setText(
"Robot not selected");
52
returnrobot_is_selected;
58ui->btnTXn->setText(
"J1-");
59ui->btnTXp->setText(
"J1+");
60ui->btnTYn->setText(
"J2-");
61ui->btnTYp->setText(
"J2+");
62ui->btnTZn->setText(
"J3-");
63ui->btnTZp->setText(
"J3+");
64ui->btnRXn->setText(
"J4-");
65ui->btnRXp->setText(
"J4+");
66ui->btnRYn->setText(
"J5-");
67ui->btnRYp->setText(
"J5+");
68ui->btnRZn->setText(
"J6-");
69ui->btnRZp->setText(
"J6+");
72ui->btnTXn->setText(
"Tx-");
73ui->btnTXp->setText(
"Tx+");
74ui->btnTYn->setText(
"Ty-");
75ui->btnTYp->setText(
"Ty+");
76ui->btnTZn->setText(
"Tz-");
77ui->btnTZp->setText(
"Tz+");
78ui->btnRXn->setText(
"Rx-");
79ui->btnRXp->setText(
"Rx+");
80ui->btnRYn->setText(
"Ry-");
81ui->btnRYp->setText(
"Ry+");
82ui->btnRZn->setText(
"Rz-");
83ui->btnRZp->setText(
"Rz+");
85
无效FormRobotPilot::on_radCartesianReference_clicked(){
89
无效FormRobotPilot::on_radCartesianTool_clicked()
94
无效FormRobotPilot::on_radJoints_clicked()
118
doublestep = sense * ui->spnStep->value();
121
boolis_joint_move = ui->radJoints->isChecked();
125qDebug() <<
"Internal problem: Invalid joint ID";
128joints.
Data()[id] = joints.
Data()[id] + step;
131
RDK->
ShowMessage(tr(
"The robot can't move to this location"),
false);
135
if(id < 0 || id >= 6){
136qDebug()<<
"Internal problem: Invalid id provided for an incremental move";
142
for(
inti=0; i<6; i++){
155
boolis_tcp_relative_move = ui->radCartesianTool->isChecked();
156
if(is_tcp_relative_move){
159pose_robot_new = pose_robot * pose_increment;
166
Mattransformation_axes(pose_robot);
167transformation_axes.
setPos(0, 0, 0);
168
Matmovement_pose_aligned = transformation_axes.
inv() * pose_increment * transformation_axes;
169pose_robot_new = pose_robot * movement_pose_aligned;
174
RDK->
ShowMessage(tr(
"The robot can't move to this location"),
false);
188
无效FormRobotPilot::on_chkRunOnRobot_clicked(
boolchecked){
192用户界面- > chkRunOnRobot - > setChecked(
false);
20.3
RDK->
ShowMessage(tr(
"Run Mode set to run the real robot. Make sure you are properly connected to the robot (select Connect-Connect Robot)"),
false);
@ ITEM_TYPE_ROBOT
Item of type robot (.robot file)
virtual QString Name()=0
Returns the name of an item. The name of the item is always displayed in the RoboDK station tree
virtual bool MoveJ(const Item &itemtarget)=0
Add a joint move to a program or move a robot to a target item ("Move Joint" mode)....
virtual Mat Pose()=0
Returns the local position (pose) of an object, target or reference frame. For example,...
virtual bool Connect(const QString &robot_ip="")=0
Connect to a real robot using the corresponding robot driver.
virtual tJoints Joints()=0
Returns the current joints of a robot or the joints of a target. If the item is a cartesian target,...
This class is the iterface to the RoboDK API. With the RoboDK API you can automate certain tasks and ...
virtual Item ItemUserPick(const QString &message="Pick one item", int itemtype=-1)=0
Shows a RoboDK popup to select one object from the open RoboDK station. An item type can be specified...
virtual void ShowMessage(const QString &message, bool popup=true)=0
Show a message in RoboDK (it can be blocking or non blocking in the status bar)
virtual void setRunMode(int run_mode=1)=0
Sets the behavior of the RoboDK API. By default, RoboDK shows the path simulation for movement instru...
virtual QList< Item > getItemList(int filter=-1)=0
Returns a list of items (list of names or pointers) of all available items in the currently open stat...
@ RUNMODE_RUN_ROBOT
Moves the real robot from the PC (PC is the client, the robot behaves like a server).
@ RUNMODE_SIMULATE
Performs the simulation moving the robot (default)
virtual void Render(int flags=RenderComplete)=0
Update the scene.
The Mat class represents a 4x4 pose matrix. The main purpose of this object is to represent a pose in...
无效FromXYZRPW(tXYZWPR xyzwpr)
Calculates the pose from the position and euler angles ([x,y,z,r,p,w] vector) The result is the same ...
Mat inv() const
Invert the pose (homogeneous matrix assumed)
无效setPos(double x, double y, double z)
Set the position (T position) in mm.
The tJoints class represents a joint position of a robot (robot axes).
int Length() const
Number of joint axes of the robot (or degrees of freedom)