using BSplines

function gen_traj(t, via_points; order=3, basis=nothing)
    @assert length(t) == size(points)[1]
    x = via_points[:,1]
    y = via_points[:,2]
    z = via_points[:,3]

    if basis === nothing
        basis = averagebasis(order, t)
    end
    xspline = BSplines.interpolate(basis, t, x)
    yspline = BSplines.interpolate(basis, t, y)
    zspline = BSplines.interpolate(basis, t, z)

    xspline, yspline, zspline
end
