Add Cartesian Coords


#1

I’d like to add two points together without having to make the robot move. I have a point and will add different offsets to the Z depending on which device the robot picks up. I can’t move to the base point or a crash will occur,.


#2

How about something like this?

–Get the actual coordinates
local ActualPosition = GetPose()

–Set new coordinates
–The coordinates are: [1] - pos.X, [2] - pos.Y, [3] - pos.Z, [4] - rotation in cartesian grid
–change the axis coordinates as needed; watch the correctness of the coordinates or the robot might go outside working area

local NewPosition = {coordinate = {ActualPosition.coordinate[1], ActualPosition.coordinate[2], ActualPosition.coordinate[2], ActualPosition.coordinate[4]}, tool = ActualPosition.tool, user = ActualPosition.user}
Sync()

–Move the robot to new position
MovL(NewPosition)
Sync()

OR

local RequestedPosition1 = Pos1 in your Point list (i.e. P1)
local RequestedPosition2 = Pos2 in your Point list (i.e. P10)
local NewPosition = {coordinate = {RequestedPosition1 .coordinate[1] + RequestedPosition2.coordinate[2] , RequestedPosition1.coordinate[2], RequestedPosition2.coordinate[2], RequestedPosition1.coordinate[4]}, tool = ActualPosition.tool, user = ActualPosition.user}
Sync()

–Move the robot to new position
MovL(NewPosition)
Sync()

You may combine coordinates into the new position as needed.


#3

Tried your second suggestion, Used all as RequestedPosition1.coordinate[1], etc, removed addition, for trial the point would be the same as P1 and it doesn’t work, no robot movement. I also placed it at the top of the script with the 10sec wait. Here’s the script:

local ReqPosn1 = P3 – in your Point list (i.e. P1)
local NewPosition = {coordinate = {ReqPosn1.coordinate[1] , ReqPosn1.coordinate[2], ReqPosn1.coordinate[3], ReqPosn1.coordinate[4]}, tool = ActualPosition.tool, user = ActualPosition.user}
MoveL(NewPosition)
Sync()
Wait(10000)

What I’m looking for is this, where I add a Z height to the coordinate[3]:

local ReqPosn1 = P3 – in your Point list (i.e. P1)
local NewPosition = {coordinate = {ReqPosn1.coordinate[1] , ReqPosn1.coordinate[2], ReqPosn1.coordinate[3]+DwellHeight, ReqPosn1.coordinate[4]}, tool = ActualPosition.tool, user = ActualPosition.user}
MoveL(NewPosition)
Sync()
Wait(10000)


#4

Ok, for some reason it didn’t like everything after the first end curly bracket, i.e. , tool = ActualPosition.tool, user = ActualPosition.user}. I just added the end curly bracket and it ran fine. Any idea’s on the wrong syntax for Tool & User.

Here’s working script:

local ReqPosn1 = P1 – in your Point list (i.e. P1)
local NewDwellPosn = {coordinate = {ReqPosn1.coordinate[1] , ReqPosn1.coordinate[2], ReqPosn1.coordinate[3] + DwellHeight, ReqPosn1.coordinate[4]}}
MovL(NewDwellPosn)


#5

Ok, why doesn’t this point diff calculation work and the second one does?? syntax?? The first calculates an offset between phones and the second allows for a selectable dimension. Thanks.

local BasePosn1 = P11 -- AvidTouch point is the baseline centerline of the module
local RxModPosn = P17  --iPhone 13 module center location
local RxOffset = {coordinate = {RxModPosn.coordinate[1] - BasePosn1.coordinate[1], 
 RxModPosn.coordinate[2] - BasePosn1.coordinate[2], 
 RxModPosn.coordinate[3] - BasePosn1.coordinate[3] + DwellHeight, 
 RxModPosn.coordinate[4] - BasePosn1.coordinate[4]}}
  MovJ(P15)  -- Move to Mid pt
  X = EffPlot(RxOffset)

function EffPlot(RxOffset)
SpeedL(PickSpd)
local ReqPosn1 = P3 – StartP1 point, corner of box
local NewDwellPosn = {coordinate = {ReqPosn1.coordinate[1],
ReqPosn1.coordinate[2],
ReqPosn1.coordinate[3] + DwellHeight + RxOffsetSpace,
ReqPosn1.coordinate[4]}}
MovL(NewDwellPosn) – Move to StartP1 start point of box corner
Sync()
Wait(PauseTime)
RelMovL(RxOffset) – Corrects for any Offset for Rx / Phone


#6

You have to watch the type of move used (MovJ or MovL) according to the location of the robot arm. You move might easily step off the working space of the robot and you get an error (I don’t exactly remember the message, it was something about a point plan outside the allowed workspace). The robot in that case does not start moving.