# How to get joint coordinates of each joint?

**URL:** <https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942>\
**Category:** Technical Questions\
**Created:** [June 17, 2021, 4:11am UTC](https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942 "2021-06-17T04:11:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [June 21, 2021, 10:02am UTC](https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942/5 "2021-06-21T10:02:45Z")

</div>

Hi @engineer

Thanks for your insight!

I have just written a URScript function that built upon @sba’s great work

> [@Robot theory and how to use it in UR robots](https://forum.universal-robots.com/t/robot-theory-and-how-to-use-it-in-ur-robots/3863):
>
> This is the theoretical explanation on general robot manipulators and how to use it for the advanced applications with UR robots. Attached the URScript sample is written for the purpose of better understanding. However, it has not been tested so that it is possible to have errors. Looking forward to your awesome development with this! [Robotics in UR Robots\_March 2019.pdf](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/d4588fd696b452e4b6566f4f44ada81d9f6e6fe6.pdf) (1.5 MB) [robotics.zip](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/a/ace3805217576f15b30c4f93253de3b0af5473b1.zip) (3.1 KB)

I hope that you will help you reach your goal!

```python

####
# get the pose for the joint index(0-5)
##
#### input arguments
# joint index
# joint positions
# robot_gen: the generation of the robot
# 3: CB3
# 5: e-Series
# robot_model: the robot model
# 3: UR3/UR3e
# 5: UR5/UR5e
# 10: UR10/UR10e
##
#### return values
# position: X, Y, Z coordinates of wrist 1 origin
##
####
def get_joint_pose(joint_index, joint_positions= get_target_joint_positions(), robot_model =3, robot_gen=5):
	local n=1
	local pose = p[0,0,0,0,0,0]
	while n <= joint_index+1:
		local t = get_transformation_pose_frame(robot_gen, robot_model, n, joint_positions) 
		pose = pose_trans(pose, t)
		n=n+1
	end
	return pose
end

```

---

_[View the full topic](https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942)._
