Skip to content

pathOffsetSet Interface Script Usage Example ​

Function ​

Create a thread, and cyclically change the value passed to pathOffsetSet within the thread. In this example, the Z-axis offset is cyclically changed to achieve curved motion from waypoint 0 to waypoint 1.

Script ​

--pathOffsetSet example
offset_z1 = { 0, 0, 0.1, 0, 0, 0 };
offset_z2 = { 0, 0, -0.1, 0, 0, 0 };
local cur_index = 0;
handler_thread_pathOffsetSet_0=thread(function()
        while true do
            if cur_index % 2 == 0 then
                pathOffsetSet(offset_z1,0)
             else 
                pathOffsetSet(offset_z2,0)
             end
            cur_index=cur_index+1
        end
    end, "thread_pathOffsetSet_0")
run(handler_thread_pathOffsetSet_0)

Example Figures ​