
Distance measurement and extracting data

nihm20
✭
Hi, I'm new to programming in rapid. I have a question about distance measurement.
I have created targets for my robot, and then I want to record the position of the TCP after it has moved to each target. Here is a snippet of my code:
I have created targets for my robot, and then I want to record the position of the TCP after it has moved to each target. Here is a snippet of my code:
MoveL Target_200,v1000,fine,EndEffector3\WObj:=Workobject_1;
TCPPos1 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);
dist2 := Distance(TCPPos1, measurementPoint);
MoveL Target_210,v1000,fine,EndEffector3\WObj:=Workobject_1;
TCPPos2 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);
dist3 := Distance(TCPPos2, measurementPoint);
MoveL Target_220,v1000,fine,EndEffector3\WObj:=Workobject_1;
TCPPos3 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);
dist3 := Distance(TCPPos2, measurementPoint);
MoveL Target_230,v1000,fine,EndEffector3\WObj:=Workobject_1;
TCPPos4 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);
dist4 := Distance(TCPPos2, measurementPoint);
for dist1,..,4 I get the same distance as in the first one, even though I can see in the flexpendant that TCPPos1,...,4 are different, so it should be different distances as well.
Thas is my first concern. My second concern is if there is a way to extract the data TCPPo1,...,4 in any way from RobotStudio for analysing the data?
for dist1,..,4 I get the same distance as in the first one, even though I can see in the flexpendant that TCPPos1,...,4 are different, so it should be different distances as well.
Thas is my first concern. My second concern is if there is a way to extract the data TCPPo1,...,4 in any way from RobotStudio for analysing the data?
Tagged:
0
Best Answer
-
nihm20 said:Hi, I'm new to programming in rapid. I have a question about distance measurement.
I have created targets for my robot, and then I want to record the position of the TCP after it has moved to each target. Here is a snippet of my code:MoveL Target_200,v1000,fine,EndEffector3\WObj:=Workobject_1;TCPPos1 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);dist2 := Distance(TCPPos1, measurementPoint);MoveL Target_210,v1000,fine,EndEffector3\WObj:=Workobject_1;TCPPos2 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);dist3 := Distance(TCPPos2, measurementPoint);MoveL Target_220,v1000,fine,EndEffector3\WObj:=Workobject_1;TCPPos3 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);dist3 := Distance(TCPPos2, measurementPoint);MoveL Target_230,v1000,fine,EndEffector3\WObj:=Workobject_1;TCPPos4 := CPos(\Tool := EndEffector3 \WObj := Workobject_1);dist4 := Distance(TCPPos2, measurementPoint);
for dist1,..,4 I get the same distance as in the first one, even though I can see in the flexpendant that TCPPos1,...,4 are different, so it should be different distances as well.
Thas is my first concern. My second concern is if there is a way to extract the data TCPPo1,...,4 in any way from RobotStudio for analysing the data?Hi...There are some inconsistencies in your code...Having a look, that might be the problem.
??? dist3 := Distance(TCPPos2, measurementPoint) === dist4 := Distance(TCPPos2, measurementPoint);
Good Work.0
Answers
-
I realised this when working with the program, I think the syncronization messed up my code. Thank you for your answer.0
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings