RobotStudio event

Best way to switch working direction for robot (mirroring)

Hello,

I would like to ask you what you would think is the best way to solve my current problem.

Scenario:
Imagine a rectangular cube. The coordinate system (wobj) is at one of the corners, so that along one side is the x axis and along the other side of the cube (or rectangle) is the y axis. Right now the robot works only at one side, e.g. coming from the y-direction and working along the x-side. The things it has to do are sent by a PLC. Until now it was not necessary to work on the y-side, but things changed.

So, I got the program and all the commands for working on the x-side, e.g. moving the robot back and forth in y-direction. Now, I have to do the same for the y-side, so that y-movements on the x-side become x-movements on the y-side.

I would like to write my working routine for both sides just one time, so that if there are changes one would just have to change one working routine. I wouldn't like to create an additional routine just for working on the y-side that basically does the same thing as the existing one for the x-side.

Are there commands that somehow switch x and y coordinates so that the robot does (nearly) the same things at a different axis? The coordinate system (wobj) should stay at the same place.

I hope I described the scenario well enough. Your help would really be appreciated because I like to write efficient code with as less redundancy as possible. I would be good if there is something else then:

IF y-side THEN
   MoveL ...
ELSE
   MoveL ...
...

Thank you very much!

Comments

  • Is your question only about flipping the x-axis and y-axis? Or are there any orientation involved? 

    The best way is to update the workobject. Is there a specific reason that you do not want to change the wobj?

    A different approach can be to define a function which updates the robtargets. In this function you can switch the x and y positions. For example you can use the function posevect, with a 180 degrees rotation around the vector [1,1,0]. This rotation can be defined with the quaternion [0,0.707107,0.707107,0].