def METHOD_NAME(cx, cy, cyaw, speed_profile, goal):
    state = unicycle_model.State(x=-0.0, y=-0.0, yaw=0.0, v=0.0)
    #  lastIndex = len(cx) - 1
    time = 0.0
    x = [state.x]
    y = [state.y]
    yaw = [state.yaw]
    v = [state.v]
    t = [0.0]
    a = [0.0]
    d = [0.0]
    target_ind, mindis = calc_target_index(state, cx, cy)
    find_goal = False
    maxdis = 0.5
    while T >= time:
        di, target_ind, dis = pure_pursuit_control(state, cx, cy, target_ind)
        target_speed = speed_profile[target_ind]
        target_speed = target_speed * \
            (maxdis - min(dis, maxdis - 0.1)) / maxdis
        ai = PIDControl(target_speed, state.v)
        state = unicycle_model.update(state, ai, di)
        if abs(state.v) <= stop_speed and target_ind <= len(cx) - 2:
            target_ind += 1
        time = time + unicycle_model.dt
        # check goal
        dx = state.x - goal[0]
        dy = state.y - goal[1]
        if math.hypot(dx, dy) <= goal_dis:
            find_goal = True
            break
        x.append(state.x)
        y.append(state.y)
        yaw.append(state.yaw)
        v.append(state.v)
        t.append(time)
        a.append(ai)
        d.append(di)
        if target_ind % 1 == 0 and animation:  # pragma: no cover
            plt.cla()
            # for stopping simulation with the esc key.
            plt.gcf().canvas.mpl_connect('key_release_event',
                    lambda event: [exit(0) if event.key == 'escape' else None])
            plt.plot(cx, cy, "-r", label="course")
            plt.plot(x, y, "ob", label="trajectory")
            plt.plot(cx[target_ind], cy[target_ind], "xg", label="target")
            plt.axis("equal")
            plt.grid(True)
            plt.title("speed:" + str(round(state.v, 2))
                      + "tind:" + str(target_ind))
            plt.pause(0.0001)
    else:
        print("Time out!!")
    return t, x, y, yaw, v, a, d, find_goal