# Urscript move single joint angle of a specific angle instead of set coordinate position

**URL:** <https://forum.universal-robots.com/t/urscript-move-single-joint-angle-of-a-specific-angle-instead-of-set-coordinate-position/33061>\
**Category:** URScript\
**Created:** [March 1, 2024, 10:23am UTC](https://forum.universal-robots.com/t/urscript-move-single-joint-angle-of-a-specific-angle-instead-of-set-coordinate-position/33061 "2024-03-01T10:23:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://forum.universal-robots.com/u/denis)\
**Post date:** [March 1, 2024, 10:23am UTC](https://forum.universal-robots.com/t/urscript-move-single-joint-angle-of-a-specific-angle-instead-of-set-coordinate-position/33061/1 "2024-03-01T10:23:52Z")

</div>

Hi all,  
I would like write a script in ur16 to change joint angle instead of set x y x rx ry rz. it is possible? for example I would like rotate last wrist of 180°. it is possible using urscript?  
many thanks in advance  
best regards

---

<div class="post-metadata">

**Author:** ![dpeva](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@dpeva](https://forum.universal-robots.com/u/dpeva)\
**Post date:** [March 1, 2024, 5:21pm UTC](https://forum.universal-robots.com/t/urscript-move-single-joint-angle-of-a-specific-angle-instead-of-set-coordinate-position/33061/2 "2024-03-01T17:21:25Z")

</div>

Here’s a script I wrote a while ago for a UR5e – I’m assuming I tested it and it worked . . . . .

It lets you rotate a specified joint **TO** a specified angle:

def move\_joint(joint\_num, angle\_deg):

```
global move_pos= get_actual_joint_positions()
angle_rad = angle_deg*3.14159/180
move_pos[joint_num]=angle_rad
movej(move_pos, a=0.5, v=0.4)

```

end

By changing the angle definition slightly, this should let you change the angle of a specified joint **BY** a specified angle:

def move\_joint(joint\_num, angle\_deg):

```
global move_pos= get_actual_joint_positions()
angle_rad = move_pos[joint_num] + angle_deg*3.14159/180
move_pos[joint_num]=angle_rad
movej(move_pos, a=0.5, v=0.4)

```

end
