def publishTimeIndexedTrajectory(traj, Ts, problem, once=False):
    if (len(traj) == 0):
        print('Trajectory has zero elements')
        raise
    signal.signal(signal.SIGINT, sigIntHandler)
    print(((('Playing back trajectory ' + str(len(Ts))) + ' states in ') + str(Ts[(len(Ts) - 1)])))
    idx = 0
    while True:
        try:
            for i in range(1, (len(Ts) - 1)):
                publishPose(traj[i], problem, Ts[i])
                sleep((Ts[i] - Ts[(i - 1)]))
            if once:
                break
        except KeyboardInterrupt:
            return False
    return True
def publishTimeIndexedTrajectory(traj, Ts, problem, once=False):
    if (len(traj) == 0):
        print('Trajectory has zero elements')
        raise
    signal.signal(signal.SIGINT, sigIntHandler)
    print(((('Playing back trajectory ' + str(len(Ts))) + ' states in ') + str(Ts[(len(Ts) - 1)])))
    idx = 0
    while True:
        try:
            for i in range(1, (len(Ts) - 1)):
                publishPose(traj[i], problem, Ts[i])
                sleep((Ts[i] - Ts[(i - 1)]))
            if once:
                break
        except KeyboardInterrupt:
            return False
    return True