Offset custom plane in PolyscopeX

Hi everyone. I am acquainted with programming on PolyscopeX. It has many changes compared to Polyscope5 so I could not find what function/command could offset plane. I tried use urscript but it return: Type error: Must be a pose, not ‘Const String’. Please help me.


The only thing I can think of is your camera variable. It is a pose, right? p[x,y,z,rx,ry,rz].

Yes, It is a plane that was created by wizard and named ‘Camera’.

If ‘Camera’ is created by a wizard, I assume you made a frame.
If you then want to move the frame you can use this move_frame function. You will then have to compute the offset yourself first using the get_pose and some pose math to get the new pose.
Or you might be able to just offset the frame using only the move_frame, but having the frame it self as ref_frame.

move_frame(name, pose, ref_name)

Arguments:

name: the name of the frame to move

pose : the new placement

ref_name: the coordinate frame that pose is expressed in. The default value is the robot’s “base” frame.

Example Commands:

move_frame(“frame1”, p[0.2, 0.3, 0.1, 0, 0, 3.14])

move_frame(“frame1”, p[0.2, 0.3, 0.1, 0, 0, 3.14], ref_name=“frame2”)

get_pose(name, rel_frame=“base”, ref_frame=rel_frame)

Get the pose of the name frame relative to the rel_frame frame but expressed in the coordinates of the ref_frame frame. If ref_frame is not provided, then this returns the pose of the name frame relative to and expressed in the same frame as rel_frame.

This will fail if any arguments are not an existing frame.

If being used with the part positioner product, all three arguments can also be the names of external axes or axis groups.

Arguments

name: name of the frame to query.

rel_frame: short for “relative frame” is the frame where the pose is computed relative to

ref_frame: short for “reference frame” is the frame to express the coordinates of resulting relative pose in. If this is not provided, then it will default to match the value of rel_frame.

Return

The pose of the frame expressed in the ref_frame coordinates.

It work! Thank you so much. Can you tell me what document have these function? I searched in the Script Manual for Polyscopex but didn’t see it.

move_frame() is part of the “world model” API that is currently documented on a separate page:
https://docs.universal-robots.com/motionplus/mp1.2/worldmodel/worldmodel-urscript-intro.html#move-frame
“world model” is only available on PolyscopeX.

Intention is to bring it together in one script manual in the future.

1 Like