# Getting the wrong feature

**URL:** <https://forum.universal-robots.com/t/getting-the-wrong-feature/22755>\
**Category:** URCap Development\
**Created:** [July 19, 2022, 10:05am UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755 "2022-07-19T10:05:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoehermans.1996](https://avatars.discourse-cdn.com/v4/letter/z/4bbf92/32.png) [@zoehermans.1996](https://forum.universal-robots.com/u/zoehermans.1996)\
**Post date:** [July 19, 2022, 10:05am UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755/1 "2022-07-19T10:05:36Z")

</div>

Hello all,

I am running into the following problem.  
When i retrieve a plane with a standard movej waypoint, i get a different p[…] than when i retrieve this plane with my own script code.

for example, if I use plane\_1 with a default moveJ waypointNode, then I see the script give a different p p[…] than when I retrieve this plane with this code:

![feature.1](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/d86e8008fc9c47cc5571b527a3c3f3414c6b3185.png)

I get the pose from the selected feature with .getPose() and then put it in a moveJ scriptline  
This is obviously the wrong p[…] which makes my own waypoints not work when using any feature other than base (i tried it without getPose as well ofcourse) and i checked the value of it in a System.out.println() which is not the same as in the scriptline from the normal moveJ

I don’t really see how this can go wrong…

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [July 21, 2022, 10:23am UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755/2 "2022-07-21T10:23:52Z")

</div>

Can you share the result of the MoveJ command and the fully built command you are building and writing to the robot?

---

<div class="post-metadata">

**Author:** ![zoehermans.1996](https://avatars.discourse-cdn.com/v4/letter/z/4bbf92/32.png) [@zoehermans.1996](https://forum.universal-robots.com/u/zoehermans.1996)\
**Post date:** [July 26, 2022, 10:59am UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755/3 "2022-07-26T10:59:44Z")

</div>

Hello Eric,  
This is what i get back from a standard moveJ with Plane\_1 as feature

 ![Screenshot from 2022-07-26 12-44-11](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/daa1457cf686d4ac280bc83ace3dc2af5274d860.png)

This is what i get back from my custom moveNode with Plane\_1 as feature

 ![Screenshot from 2022-07-26 12-45-44](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/7/77e53131534be8da5bc90f6e0807532fee8eabe7.png)

and this is wat i get back if i println the feature.getPose()

 ![Screenshot from 2022-07-26 12-52-05](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/d7954a57bb7909331798cb22fa1585871377d2ee.png)

So the values of the plane\_1 are different… (i am looking at the second trans\_pose(p[…] )

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [July 26, 2022, 2:00pm UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755/4 "2022-07-26T14:00:01Z")

</div>

They are the same values just in the opposite direction…I feel like I’ve seen that before somewhere, but can’t remember what I did to fix it. I’ll think about it some more

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [July 27, 2022, 9:15pm UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755/5 "2022-07-27T21:15:31Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/7/74ee739304c5a3cb633aee253a6d503d3980decb.png)

So this is where I remember seeing this type of thing. The waypoint generated in Polyscope has opposite values to what gets used in the actual moveJ. Not sure if that means anything to you. However, looking back at the script I write for our CAP, I think you may be missing a pose\_inv() call.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/f/f87b85dffc7572ad5e1ea95fdf8a724a82f51383.png)

Maybe try adding that? I think you need to take the pose\_inv(Plane\_1.getPose()) and make that the first argument to the second pose\_trans(). At least, looks like that’s what we were doing when we wrote this like 2 years ago lol

---

<div class="post-metadata">

**Author:** ![zoehermans.1996](https://avatars.discourse-cdn.com/v4/letter/z/4bbf92/32.png) [@zoehermans.1996](https://forum.universal-robots.com/u/zoehermans.1996)\
**Post date:** [July 28, 2022, 5:44am UTC](https://forum.universal-robots.com/t/getting-the-wrong-feature/22755/6 "2022-07-28T05:44:00Z")

</div>

Hello Eric,

Thankyou for sharing! it is working perfectly right now!

Kind regards.

Zoë
