Exemplo n.º 1
0
def course_pool():
    stop()

    # Uターン地点まで行く(海上)
    led_red()
    go_yaw_onoff_iki(set_speed=30, set_rot=400, set_diving=80)
    # go_yaw_onoff_iki(set_speed=30, set_rot=200, set_diving=5)
    led_off()

    # Uターン地点まで行く(潜水)
    # led_blue()
    # go_yaw_onoff_iki(set_speed=30, set_rot=200, set_diving=60)
    # led_off()

    # 浮上
    stop()
    led_green()
    up_down(60)
    time.sleep(5)
    stop()
    led_off()

    # 設定地点まで自動で移動
    waypoint_data = {1:{'lat': 26.377735, 'lng': 127.822441667}}
    waypoint(waypoint_data = waypoint_data)
    print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")

    # # Uターン
    # # yaw(100, set_diving=False)
    # led_purple()
    # yaw_rot(set_rot=30, set_diving=True)
    # led_off()

    # 所定の深さまで沈む
    diving_while(30)

    # スタート地点まで行く(潜水)
    led_blue()
    go_yaw_onoff_kaeri(set_speed=30, set_rot=420, set_diving=80)
    # go_yaw_onoff_kaeri(set_speed=30, set_rot=210, set_diving=80)
    led_off()

    # スタート地点まで行く(海上)
    # led_red()
    # go_yaw_onoff_kaeri(set_speed=30, set_rot=200, set_diving=5)
    # led_off()

    # 浮上
    stop()
    led_green()
    up_down(60)
    time.sleep(2)

    my_exit()
Exemplo n.º 2
0
def course_convention():
    stop()

    # Uターン地点まで行く(海上)
    led_red()
    go_yaw_onoff_iki(set_speed=30, set_rot=250, set_diving=5)
    led_off()

    # Uターン地点まで行く(潜水)
    led_blue()
    go_yaw_onoff_iki(set_speed=50, set_rot=880, set_diving=60)
    led_off()

    # 浮上
    stop()
    led_green()
    up_down(60)
    time.sleep(5)
    stop()
    led_off()

    # Uターン
    # yaw(100, set_diving=False)
    led_purple()
    yaw_rot(set_rot=20, set_diving=True)
    led_off()

    # 所定の深さまで沈む
    diving_while(30)

    # スタート地点まで行く(潜水)
    led_blue()
    go_yaw_onoff_kaeri(set_speed=30, set_rot=800, set_diving=60)
    led_off()

    # スタート地点まで行く(海上)
    led_red()
    go_yaw_onoff_kaeri(set_speed=30, set_rot=400, set_diving=5)
    led_off()

    # 浮上
    stop()
    led_green()
    up_down(60)
    time.sleep(2)

    my_exit()
Exemplo n.º 3
0
def test():
    gps_route_data_file = open('/kaiyo/log/gsp_route_data/gps_route_data.txt',
                               'r')
    waypoint_route_data = {}
    cnt = 0
    while True:
        gps_route_data = gps_route_data_file.readline()
        if gps_route_data:
            gps_route_data = ast.literal_eval(gps_route_data)
            gps_route_data.pop("datetime")
            gps_route_data.pop("alt")
            waypoint_route_data[cnt] = gps_route_data
            cnt += 1
        else:
            print waypoint_route_data
            # 移動開始
            waypoint(waypoint_data=waypoint_route_data)
            break


# -------------------------------------------------------------------

if __name__ == '__main__':
    try:
        pad_rc_route_data_creation()
        # test()
        my_exit()
    except KeyboardInterrupt as e:
        my_exit()