# Smooth trajectory script servoj()

**URL:** https://forum.universal-robots.com/t/smooth-trajectory-script-servoj/1207
**Category:** URScript
**Created:** [September 25, 2017, 11:49am UTC](https://forum.universal-robots.com/t/smooth-trajectory-script-servoj/1207 "2017-09-25T11:49:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![anon47499781](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon47499781](https://forum.universal-robots.com/u/anon47499781)
#### Post date: [September 25, 2017, 11:49am UTC](https://forum.universal-robots.com/t/smooth-trajectory-script-servoj/1207/1 "2017-09-25T11:49:54Z")

</div>

Hello!  
I want to drive robot waypoint smoothly and used script servoj()  
command string by c++ from PC as follow  
"servoj ( p[0.1 , 0.1 , 0.1 ,0.0.0], t=0.05, lookahead\_time=0.1, gain=300)\n"  
but robot not move smoothly ,someyhing got wrong?

---

<div class="post-metadata">

### Author: ![SonglinCai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/songlincai/32/478_2.png) [@SonglinCai](https://forum.universal-robots.com/u/SonglinCai)
#### Post date: [September 26, 2017, 3:33am UTC](https://forum.universal-robots.com/t/smooth-trajectory-script-servoj/1207/2 "2017-09-26T03:33:22Z")

</div>

Hi,

Within servoj, the t means when should the robot move to the target position, if your current position is “too far” away, which will lead to sudden starting movement while lookahead\_time is the parameter determing how far away the robot looks ahead before executing, so you need to supply a string of servoj command at one time rather than one by one.

Regarding how to send a string of script command, enclose all commands with def and end. Please take care of the newline charater and indentation.

---

<div class="post-metadata">

### Author: ![anon50359232](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@anon50359232](https://forum.universal-robots.com/u/anon50359232)
#### Post date: [October 17, 2018, 12:29am UTC](https://forum.universal-robots.com/t/smooth-trajectory-script-servoj/1207/3 "2018-10-17T00:29:15Z")

</div>

> [@SonglinCai](#):
>
> Regarding how to send a string of script command, enclose all commands with def and end. Please take care of the newline charater and indentation.

Did you solve this issue? I just come to it.
