Change tool orientation on path

Hello

I have developed a urcap inside which my robot is able to follow s square wave trajectory given some input points as in the below picture.

image

I want to get the same tool inclination in both the long segments of my square wave pattern.

I can get the tool inclination thanks to a waypoint that identifies the starting point of my glue dispensing path.

Suppose to have a glue dispenser end-effector: i want to pull the glue in the ascending part of my square wave and i want to pull the glue even in the descending part of the square wave,

I need to find a way to automatically modify the setup of the glue dispender so that i can pull the glue on both side on the square wave pattern. (up to now i find myself pulling the glue on one side and pushing the glue on the other).

does someone have any hints about this?

Are you using path_offset() commands to produce the square wave motion? I would think you’d be able to simply substitute the rx, ry, and rz values of your waypoints to match whatever tool angle you were using on the rising edge.

hello!

Unfortunately i am not using path_offset() in order to produce the square wave: the operator stores a line of point, I intake them and make some math on them in order to produce a square wave. The correct orientation could be the one of the first point.

In some cases i cannot even stop the glue dispensing while changing this orientation. Do you have any hints?