Universal Robots Forum

Set Robot Joint Angles before start

Is it possible to set the state of the simulator?
I would like to set the positions of joints before executing automated tests. This is a requirement to achieve repeatable testing.

1 Like

What we do is to define a joint setting such as:

# home joint position in radians
global hj_rad = [d2r(-40.6), d2r(-103), d2r(-148), d2r(-19), d2r(90), d2r(48)]

in a script loaded in the “Before Start” section.

Then, near the beginning of Robot Program section for the tests, we have an instruction:

move to home position

movej(hj_rad, a=1.2, v=0.25, t=0, r=0)