# Conveyor tracking update position problem

**URL:** <https://forum.universal-robots.com/t/conveyor-tracking-update-position-problem/17542>\
**Category:** Technical Questions\
**Created:** [November 11, 2021, 1:02pm UTC](https://forum.universal-robots.com/t/conveyor-tracking-update-position-problem/17542 "2021-11-11T13:02:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon74749792](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@anon74749792](https://forum.universal-robots.com/u/anon74749792)\
**Post date:** [November 11, 2021, 1:02pm UTC](https://forum.universal-robots.com/t/conveyor-tracking-update-position-problem/17542/1 "2021-11-11T13:02:01Z")

</div>

Hi:

We are trying to make a conveyor belt tracking routine where equidistant objects must be operated. Imagine a series of boxes running down the conveyor where the Tool must travel a certain distance across the box making contact with it. Our solution uses relative movements in order to achieve this, first we estimated the conveyor axis and we are using rotation matrix in order to define our relative movements.

 ![Rotation](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/0/095beb2380c9db65c2b0413968b8117ce02206b0.png)

For example in order to move relative to our O\_c axis. We do something like this.

- Obtain current position : act\_pose = get\_actual\_tcp\_pose()
- Define displacement : d\_c = R\_b\_c\*[dx, dy, dz]  
Where R\_b\_c is the rotation matrix which transform conveyor coordinates to base coordinates.
- Add it to our current position : pose\_add(act\_pose, p[d\_c[0], d\_c[1], d\_c[2], 0,0,0]).
- MoveL to that position.

[Figure 2]

Because this must be executed continously we have this runnning inside a loop.

While True:  
track\_conveyor\_linear()  
MoveL to next\_box  
MoveL relative\_to\_next\_box  
stop\_conveyor\_tracking()  
act\_pose = get\_actual\_tcp\_pose()

We are currently having troubles between boxes because the robots land further and further away from the expected point. I think it could be that we are starting and stopping the conveyor tracking and the conveyor is moving where the robot is not so there is a net displacement of the conveyor w.r.t the robot. First we thought that the TPM parameter was incorrect, but when the robot is moved along the object running in the conveyor with no relative displacement the robot ends at the same starting point but moved along

We are actually doing this:

track\_conveyor\_linear()  
While True:  
MoveL to next\_box  
MoveL relative\_to\_next\_box  
act\_pose = get\_actual\_tcp\_pose()  
stop\_conveyor\_tracking()

The first box is procesed correctly but in the at the end of the first cycle the robot moves to the second box in the conveyor and tries to move but relative to the first box (it seems like get\_actual\_tcp\_pose() is not updated).

[Figure 3]

In the previous image it would do this cycle (asume the names where out\_pose\_next box is inherit the same name e.g in\_pose = in\_pose\_next):

out\_pose → in\_pose → end\_pose → out\_pose → out\_pose\_next → in\_pose

---

<div class="post-metadata">

**Author:** ![anon74749792](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@anon74749792](https://forum.universal-robots.com/u/anon74749792)\
**Post date:** [November 11, 2021, 1:02pm UTC](https://forum.universal-robots.com/t/conveyor-tracking-update-position-problem/17542/2 "2021-11-11T13:02:34Z")

</div>

![dx](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/e/ebbb096f8ef0f3be57f37042d694c1d53f6261d4.png)

[Figure 2]

---

<div class="post-metadata">

**Author:** ![anon74749792](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@anon74749792](https://forum.universal-robots.com/u/anon74749792)\
**Post date:** [November 11, 2021, 1:03pm UTC](https://forum.universal-robots.com/t/conveyor-tracking-update-position-problem/17542/3 "2021-11-11T13:03:14Z")

</div>

![Process](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/9/93d7c286e6f81ad6ab903fd44f02ec8ce968481e.png)

[Figure 3]
