Teach and store intermediate stop position in moving route to avoid collision