# 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:** 1\
**Showing post:** 2

<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

---

_[View the full topic](https://forum.universal-robots.com/t/urscript-move-single-joint-angle-of-a-specific-angle-instead-of-set-coordinate-position/33061)._
