Esempio n. 1
0
save_length = 0
total_data = 0
write_list = []

file = open('training_data.txt', 'a')

#caminfo = 88.0000991821289, -449.00006103515625, 5.179999828338623, (0.26104751229286194, 0.9333941340446472, 13.440003395080566)
# yaw, pitch, dist, target
#def test():
#    print(p.getDebugVisualizerCamera())
#
#t = Timer(15.0, test)
#t.start()

nn_direction, nn_velocity = TrainData.get_train_weights(100)

print()

while 1:

    sensors_list = np.transpose(
        np.array([robot.get_output_sensor_for_near_road_points(road)[1:5]]))

    if sensors_list.shape[0] == 4:
        output_sensor_direction = np.transpose(
            nn_direction.model_output(sensors_list))[0]
        output_sensor_velocity = np.transpose(
            nn_velocity.model_output(sensors_list))[0]

        if output_sensor_direction[0] > output_sensor_direction[1]:
Esempio n. 2
0
save_length = 0
total_data = 0
write_list = []

file = open('training_data.txt', 'a')

#caminfo = 88.0000991821289, -449.00006103515625, 5.179999828338623, (0.26104751229286194, 0.9333941340446472, 13.440003395080566)
# yaw, pitch, dist, target
#def test():
#    print(p.getDebugVisualizerCamera())
#
#t = Timer(15.0, test)
#t.start()

nn = TrainData.get_train_weights()

print()

while 1:

    sensors_list = robot.get_output_sensor_for_near_road_points(road)
    output_sensor = np.transpose(
        nn.model_output(
            np.transpose(
                np.array(
                    robot.get_output_sensor_for_near_road_points(road)[1:5]))))

    is_right = 0
    is_left = 0
    is_forward = 0