Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Processing Speeds
#7
Albert,


I created a side by side video of the same program being executed by the built-in GUI program instructions and the C++ api. The videos are synchronized to start when both robots begin moving. As you can see in the video, the GUI program simulation is finished well before the C++ api simulation is complete. Additionally, it appears the C++ program is so slow that it is skipping program steps, such as speed changes and move instructions.


Also, see attached code. The RDK file is too large to post (157 MB)

Code:
#include
#include
#include
#include
#include "UR10Simulate.h"


UR10Simulate::UR10Simulate(){
this->RDK = NULL;
}


//Method Name: UR10Simulate constructor
//Goals: Pass the current instance of RDK and configure variables for all station items
//used with this simulation
//Input: RoboDK_API::RoboDK* RDK_instance
//Output: None
//Steps: Initialize all members to default values
UR10Simulate::UR10Simulate(RoboDK_API::RoboDK* RDK_instance){
//Pointer to RoboDK
this->RDK = RDK_instance;

//Pointer to Active Robot
this->active_robot = RDK->getItem("UR10e");

//Pointer to Pick/Place objects
this->i_2084m61_blade = RDK->getItem("2084M61");
this->i_2084m61_cup = RDK->getItem("2084M61 VPA TOOL B 10-22-19");

//Pointer to Reference Frames
this->r_input_tray = RDK->getItem("M61 Input Tray");
this->r_input_tray_active = RDK->getItem("Active Input Bin");
this->r_output_tray = RDK->getItem("M61 Output Tray");
this->r_output_tray_active = RDK->getItem("Active Output Bin");
this->r_stationary_gripper = RDK->getItem("Stationary Gripper");

//Pointer to Standby Positions
this->p_home = RDK->getItem("Home");
this->p_input_cup_standby = RDK->getItem("Input Cup Standby");
this->p_input_blade_standby = RDK->getItem("Input Standby");
this->p_output_blade_standby = RDK->getItem("Output Standby");
this->p_stationary_cup_standby = RDK->getItem("Stationary Cup Standby");
this->p_stationary_blade_standby = RDK->getItem("Stationary Blade Standby");

//Pointer to Tray Cup Targets
this->p_tray_cup_0 = RDK->getItem("Cup Pick 0");
this->p_tray_cup_1 = RDK->getItem("Cup Pick 1");
this->p_tray_cup_2 = RDK->getItem("Cup Pick 2");

//Pointer to Tray Blade Targets
this->p_tray_blade_0 = RDK->getItem("Blade Pick 0");
this->p_tray_blade_1 = RDK->getItem("Blade Pick 1");
this->p_tray_blade_2 = RDK->getItem("Blade Pick 2");

//Pointer to Stationary Gripper Cup Targets
this->p_stationary_cup_0 = RDK->getItem("Stationary Cup 0");
this->p_stationary_cup_1 = RDK->getItem("Stationary Cup 1");
this->p_stationary_cup_2 = RDK->getItem("Statopmaru Cup 2");

//Pointer to Stationary Gripper Blade Targets
this->p_stationary_blade_0 = RDK->getItem("Stationary Blade 0");
this->p_stationary_blade_1 = RDK->getItem("Stationary Blade 1");
this->p_stationary_blade_2 = RDK->getItem("Stationary Blade 2");

//Pointer to Blast Joint targets
this->p_blast_position = RDK->getItem("Blast Position");
this->p_blast_position_finish = RDK->getItem("Blast Position Finish");

//Pointer to Display Tools
this->t_cup_closed_airfoil_closed = RDK->getItem("DGATC Cup Closed Airfoil Closed");
this->t_cup_closed_airfoil_open = RDK->getItem("DGATC Cup Closed Airfoil Open");
this->t_cup_open_airfoil_closed = RDK->getItem("DGATC Cup Open Airfoil Closed");
this->t_cup_open_airfoil_open = RDK->getItem("DGATC Cup Open Airfoil Open");
this->t_stationary_gripper_closed = RDK->getItem("Stationary Gripper Closed");
this->t_stationary_gripper_open = RDK->getItem("Stationary Gripper Open");

//Pointer to Active Tools
this->t_airfoil_tool = RDK->getItem("Airfoil Tool");
this->t_cup_tool = RDK->getItem("Cup Tool");

//Program Variables
this->current_part = 0;
this->part_count = 0;
this->part_count_x = 1;
this->part_count_y = 1;


}

UR10Simulate::~UR10Simulate(){

}

//Method Name: SetTraySize
//Goals: Establish Size of Tray
//Input: int x_size, int y_size, int count
//Output: None
//Steps: Set part_count_x, part_count_y, and part_count equal to inputs
void UR10Simulate::SetTraySize(int x_size, int y_size, int count){
this->part_count_x = x_size;
this->part_count_y = y_size;
this->part_count = count;
}


//Method Name:
//Goals:
//Input:
//Output:
//Steps:
void UR10Simulate::GenerateObjects(){

}


//Method Name:
//Goals:
//Input:
//Output:
//Steps:
void UR10Simulate::ClearObjects(){

}


//Method Name:
//Goals:
//Input:
//Output:
//Steps:
void UR10Simulate::MoveActiveReferenceFrames(){

}


//Method Name:
//Goals:
//Input:
//Output:
//Steps:
void UR10Simulate::RunProgram(){
if(RDK->Connected()){
RDK->setSimulationSpeed(1.0);
//Reset object displays and active tool
t_cup_open_airfoil_open.setVisible(true);
t_cup_closed_airfoil_open.setVisible(false);
t_cup_open_airfoil_closed.setVisible(false);
t_cup_closed_airfoil_closed.setVisible(false);
t_stationary_gripper_open.setVisible(true);
t_stationary_gripper_closed.setVisible(false);
active_robot.setPoseTool(t_cup_tool);

//Move Home
//active_robot.setSpeed(100, 1200, 30, 80);
active_robot.setRounding(20);
//active_robot.MoveJ(p_home);

//For each part, do the following
//while(current_part < part_count){


//Move to input area to pick cup-blade assembly
active_robot.setPoseTool(t_cup_tool);
active_robot.setPoseFrame(r_input_tray_active);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_input_blade_standby);
active_robot.MoveJ(p_input_cup_standby);
active_robot.MoveJ(p_tray_cup_2);
active_robot.setSpeed(100, 1200, 120, 80);
active_robot.MoveL(p_tray_cup_1);
//active_robot.setSpeed(100, 600, 60, 80);
active_robot.MoveL(p_tray_cup_0);

//Pick Cup-Blade assembly from input tray
active_robot.Pause(0.25);
t_cup_open_airfoil_open.setVisible(false);
t_cup_closed_airfoil_open.setVisible(true);
active_robot.Pause(0.25);

//Move back to Input Cup Standby area
active_robot.MoveL(p_tray_cup_1);
//active_robot.setSpeed(300, 600, 60, 80);
active_robot.MoveL(p_tray_cup_2);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_input_cup_standby);

//Move to Stationary gripper to transfer cup-blade assembly
active_robot.setPoseFrame(r_stationary_gripper);
active_robot.MoveJ(p_stationary_cup_standby);

active_robot.MoveJ(p_stationary_cup_2);
active_robot.setSpeed(100, 1200, 120, 80);
active_robot.MoveL(p_stationary_cup_1);

active_robot.MoveL(p_stationary_cup_0);

//Transfer Cup-Blade assembly to stationary gripper
active_robot.Pause(0.25);
t_cup_open_airfoil_open.setVisible(true);
t_cup_closed_airfoil_open.setVisible(false);
t_stationary_gripper_open.setVisible(false);
t_stationary_gripper_closed.setVisible(true);
active_robot.Pause(0.25);

//Move to stationary blade standby position
active_robot.MoveL(p_stationary_cup_1);
//active_robot.setSpeed(300, 600, 60, 80);
active_robot.MoveL(p_stationary_cup_2);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_stationary_cup_standby);

//Move to stationary blade picking position
active_robot.setPoseTool(t_airfoil_tool);
active_robot.MoveJ(p_stationary_blade_standby);
active_robot.MoveJ(p_stationary_blade_2);
active_robot.setSpeed(100, 1200, 120, 80);
active_robot.MoveL(p_stationary_blade_1);

active_robot.MoveL(p_stationary_blade_0);

//Pull Blade from Cup-Blade assembly
active_robot.Pause(0.25);
t_cup_open_airfoil_open.setVisible(false);
t_cup_open_airfoil_closed.setVisible(true);
active_robot.Pause(0.25);

//Move to stationary blade standby position
active_robot.MoveL(p_stationary_blade_1);
//active_robot.setSpeed(300, 600, 60, 80);
active_robot.MoveL(p_stationary_blade_2);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_stationary_blade_standby);

//Clean Blade
active_robot.setRounding(0);
active_robot.MoveJ(p_blast_position);
active_robot.Pause(1);
active_robot.setSpeed(300, 1200, 18, 80);
active_robot.MoveJ(p_blast_position_finish);
//active_robot.setRounding(20);

/ /回到静止叶片备用位置
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_stationary_blade_standby);

//Move to stationary cup position
active_robot.setPoseTool(t_cup_tool);
active_robot.MoveJ(p_stationary_cup_standby);

active_robot.MoveJ(p_stationary_cup_2);
active_robot.setSpeed(100, 1200, 120, 80);
active_robot.MoveL(p_stationary_cup_1);
active_robot.MoveL(p_stationary_cup_0);

//Pick cup from stationary gripper
active_robot.Pause(0.25);
t_cup_open_airfoil_closed.setVisible(false);
t_cup_closed_airfoil_closed.setVisible(true);
t_stationary_gripper_open.setVisible(true);
t_stationary_gripper_closed.setVisible(false);
active_robot.Pause(0.25);

//Move to stationary cup standby position
active_robot.MoveL(p_stationary_cup_1);
//active_robot.setSpeed(300, 600, 60, 80);
active_robot.MoveL(p_stationary_cup_2);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_stationary_cup_standby);


//Move to input tray cup position again to place cup back into input tray
active_robot.setPoseFrame(r_input_tray_active);
active_robot.MoveJ(p_input_cup_standby);
active_robot.MoveJ(p_tray_cup_2);
active_robot.setSpeed(100, 1200, 120, 80);
active_robot.MoveL(p_tray_cup_1);
active_robot.MoveL(p_tray_cup_0);

//Place cup in input tray
active_robot.Pause(0.25);
t_cup_closed_airfoil_closed.setVisible(false);
t_cup_open_airfoil_closed.setVisible(true);
active_robot.Pause(0.25);

//Move to input blade standby position
active_robot.MoveL(p_tray_cup_1);
//active_robot.setSpeed(300, 600, 60, 80);
active_robot.MoveL(p_tray_cup_2);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_input_cup_standby);
active_robot.MoveJ(p_input_blade_standby);


/ /移动到输出叶片步的地方n
active_robot.setPoseTool(t_airfoil_tool);
active_robot.setPoseFrame(r_output_tray_active);
active_robot.MoveJ(p_tray_blade_2);
active_robot.setSpeed(100, 1200, 120, 80);
active_robot.MoveL(p_tray_blade_1);
active_robot.MoveL(p_tray_blade_0);

//Place blade in output tray
active_robot.Pause(0.25);
t_cup_open_airfoil_closed.setVisible(false);
t_cup_open_airfoil_open.setVisible(true);
active_robot.Pause(0.25);

//Move to output blade standby postion
active_robot.MoveL(p_tray_blade_1);
//active_robot.setSpeed(300, 600, 60, 80);
active_robot.MoveL(p_tray_blade_2);
active_robot.setSpeed(600, 1200, 120, 80);
active_robot.MoveJ(p_output_blade_standby);

//}
//Move back to Home
//active_robot.setSpeed(100, 1200, 30, 80);
//active_robot.setRounding(20);
//active_robot.MoveJ(p_home);

}
}




//Method Name:
//Goals:
//Input:
//Output:
//Steps:


Messages In This Thread
Processing Speeds - byjccourtney- 12-17-2019, 06:46 PM
RE: Processing Speeds - byAlbert- 12-17-2019, 09:03 PM
RE: Processing Speeds - byjccourtney- 12-17-2019, 09:29 PM
RE: Processing Speeds - byAlbert- 12-17-2019, 10:23 PM
RE: Processing Speeds - byjccourtney- 12-18-2019, 11:35 PM
RE: Processing Speeds - byAlbert- 12-20-2019, 08:02 PM
RE: Processing Speeds - byjccourtney- 12-27-2019, 06:47 PM



Users browsing this thread:
1 Guest(s)