# orientation by Rapid

**URL:** <https://tech-community.robotics.abb.com/t/orientation-by-rapid/5791>\
**Category:** RobotStudio\
**Created:** [November 4, 2013, 10:23am UTC](https://tech-community.robotics.abb.com/t/orientation-by-rapid/5791 "2013-11-04T10:23:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BasT](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@BasT](https://tech-community.robotics.abb.com/u/BasT)\
**Post date:** [November 4, 2013, 10:23am UTC](https://tech-community.robotics.abb.com/t/orientation-by-rapid/5791/1 "2013-11-04T10:23:19Z")

</div>

Hello,

At this moment I am working on a project were I have to send every position to my Computer.

so now i use

VAR robtarget Target.

For i FROM 0 TO 1001 DO

Target.trans.y:=Target.trans.y-0.1;

MoveJ Target, v, z, tool;

Other than the xyz also the orientation has to be changed every run in the For-loop. because the robot has to move sort of circular. I know the algabra for the angles.But i dont konw how to use q1-q4.

anybody help?

greatings from Holland

---

<div class="post-metadata">

**Author:** ![kioog](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kioog](https://tech-community.robotics.abb.com/u/kioog)\
**Post date:** [November 5, 2013, 8:16am UTC](https://tech-community.robotics.abb.com/t/orientation-by-rapid/5791/2 "2013-11-05T08:16:06Z")

</div>

Hello,

you can use OrientZYX to calculate the quaternions from angles.

Target.rot := OrientZYX(anglez, angley, anglex)

BR

Peter

---

<div class="post-metadata">

**Author:** ![BasT](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@BasT](https://tech-community.robotics.abb.com/u/BasT)\
**Post date:** [November 6, 2013, 8:48am UTC](https://tech-community.robotics.abb.com/t/orientation-by-rapid/5791/3 "2013-11-06T08:48:57Z")

</div>

Hello Peter,

Thanks, we tried but now we face an another problem. We are simulating a code with some Target 's but those targets are not the same as in real time.

anybody help?

---

<div class="post-metadata">

**Author:** ![blind3rr](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@blind3rr](https://tech-community.robotics.abb.com/u/blind3rr)\
**Post date:** [November 6, 2013, 10:33am UTC](https://tech-community.robotics.abb.com/t/orientation-by-rapid/5791/4 "2013-11-06T10:33:44Z")

</div>

What do you exactly mean by ‘those targets are not the same as in real time’?
