# 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:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![engineer](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@engineer](https://forum.universal-robots.com/u/engineer)\
**Post date:** [June 17, 2021, 4:11am UTC](https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942/1 "2021-06-17T04:11:02Z")

</div>

Hi,  
I know that I can get joint angles of each joint.  
How to get joint coordinates(x,y,z) of each joint?

---

<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 17, 2021, 9:19am UTC](https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942/3 "2021-06-17T09:19:33Z")

</div>

Hi @engineer,

Welcome to the UR community!

they are not directly accessible, the content of the configuration files, described [here](https://forum.universal-robots.com/t/moment-of-inertia-ur3-ur5-ur10/1745)

> [@Moment of inertia UR3 UR5 UR10](https://forum.universal-robots.com/t/moment-of-inertia-ur3-ur5-ur10/1745):
>
> I am building a robot mobility platform and I need to understand the maximum moment of inertia for all three robots. I thought I would ask here first and if the information is unavailable, then I will calculate and hope that my calculations are correct. Thanks, Jerry Stokely

Will provide you with the information to make the forward kinematic calculations.

Can you elaborate on your use case?

Best regards  
Ebbe

---

<div class="post-metadata">

**Author:** ![engineer](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@engineer](https://forum.universal-robots.com/u/engineer)\
**Post date:** [June 21, 2021, 7:22am UTC](https://forum.universal-robots.com/t/how-to-get-joint-coordinates-of-each-joint/14942/4 "2021-06-21T07:22:03Z")

</div>

Hi @Ebbe , thanks for your reply

I use depth camera to catch robotic arm’s point cloud,want to get joint coordinates to match it.  
That way I can know the position of the robotic arm in the point cloud to make obstacle avoidance function.

Is there any other way to get the coordinates of each joint, or can do something similar to the following video?

[![](https://img.youtube.com/vi/IbANxXaXnZ8/maxresdefault.jpg "Robot Safety research at Fontys Engineering") ](https://www.youtube.com/watch?v=IbANxXaXnZ8)

---

<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

```
