Пример #1
0
                     color='black',
                     linestyle=':',
                     linewidth=4)
            plt.xlabel('x')
            plt.ylabel('y')
            plt.title('UGV Path')
            plt.show()

            sys.exit(1)

        previous_time = rospy.get_time()
        agents_publisher.publish(msg)
        rate.sleep()


if __name__ == '__main__':
    path = '../data/path.csv'
    df = pd.read_csv(path)
    coordinates = df.to_numpy()

    ideal_condition = 3
    ideal_bicycle = Bicycle(coordinates)
    ideal_bicycle.createPath()

    fault_condition = 1
    fault_bicycle = Bicycle(coordinates)
    fault_bicycle.createPath()

    driveClosedLoop(ideal_bicycle, fault_bicycle, ideal_condition,
                    fault_condition)
Пример #2
0
                    path.append(list(point.coordinate))
                else:
                    path = np.array(path)
                    print(path)
                    print("STOP")
                    stop = 1

    if stop and not target:
        # print(path)
        # f = open('/home/conor/catkin_ws/src/network_faults/data/path.csv', 'w')
        # np.savetxt(f, path, delimiter=",")
        trials = 100

        ideal_condition = 0
        ideal_bicycle = Bicycle(path)
        ideal_bicycle.createPath()

        healthy_fault_condition = 1
        healthy_fault_bicycle = Bicycle(path)
        healthy_fault_bicycle.createPath()
        healthy_fault_bicycle.readNoiseFunction()
        healthy_fault_bicycle.setNoiseFunction(healthy_fault_condition)
        healthy_fault_bicycle.driveOpenLoop(healthy_fault_condition, 'green')

        left_fault_condition = 2
        left_fault_bicycle = Bicycle(path)
        left_fault_bicycle.createPath()
        left_fault_bicycle.readNoiseFunction()
        left_fault_bicycle.setNoiseFunction(left_fault_condition)
        left_fault_bicycle.driveOpenLoop(left_fault_condition, 'red')