Reflect about a Feature Line

Hello. I am trying to reflect my TCP about a Line Feature using URScript.

image

For example, when I go to the Move Tab and choose my line “Reflection” as the Feature, and then just invert my RX value (in this case making it -0.132 rad) the robot does exactly what I want it to.

Can someone point me in the right direction as to what SCRIPT commands needs to be written to programmatically achieve this same behavior? I’ve tried several variations of what I think would have worked using pose_trans() but I can’t quite get this same behavior.

eric.
You just need to Multiply Rx by -1 to make 0.132 become -0.132.

so a line of script would be

Reflection[3] = Reflection[3]*-1

and to reverse it just run it again.

Thanks for the response. Yes I understand how to invert the coordinate, it’s getting the TCP to move with respect to that Feature line that was giving me a hard time. I think I eventually got it by doing

tcpRel = pose_trans(pose_inv(reflection), get_actual_tcp_pose())
mirrorPose = pose_trans(reflection, p[tcpRel[0], tcpRel[1], tcpRel[2], tcpRel[3], -tcpRel[4], tcpRel[5]])

but for certain TCP orientations it just didn’t work. At some point during my testing, typing in an offset into the Move Tab’s RY box didn’t even move the same way as jogging RY with the arrow key, despite both Features being the same. Think I’ll just scrap the idea for now anyway, as even when it sorta worked, and the TCP reflected around the axis, the rest of the end effector was oddly oriented, and I don’t know a good way to account for it.

Thanks again