예제 #1
0
if __name__ == '__main__':
    # shortcut to not have to find out the port yourself
    serial_port = Configuration.get_correct_serial_port()

    remote_id = 0x6120  # remote device network ID
    remote = True  # whether to use a remote device
    if not remote:
        remote_id = None

    index = 0
    previous_cycle_time = 0
    current_cycle_time = 0

    # import properties from saved properties file
    (remote, remote_id, anchors, attributes_to_log, to_use_file, filename,
     use_processing) = Configuration.get_properties()

    if not remote:
        remote_id = None

    ip = "127.0.0.1"
    network_port = 8888

    pozyx = PozyxSerial(serial_port)
    osc_udp_client = SimpleUDPClient(ip, network_port)
    o = Orientation3D(pozyx, osc_udp_client, remote_id)
    o.setup()

    logfile = None
    if to_use_file:
        logfile = open(filename, 'a')
                single.num_of_error += 1


class ContinueI(Exception):
    pass


continue_i = ContinueI()

if __name__ == "__main__":
    serial_port = Configuration.get_correct_serial_port()
    pozyx = PozyxSerial(serial_port)
    use_velocity = True

    # import properties from saved properties file
    config = Configuration.get_properties()
    tags = config.tags
    anchors = config.anchors
    attributes_to_log = config.attributes_to_log
    to_use_file = config.use_file
    filename = config.data_file
    range_anchor_id = config.range_anchor_id
    alpha_pos = config.position_smooth
    alpha_vel = config.velocity_smooth
    smooth_velocity = alpha_vel < 1.00
    share_data_over_lan = config.share_data_over_lan

    to_get_sensor_data = not attributes_to_log == []

    ranging_protocol = POZYX_RANGE_PROTOCOL_PRECISION  # the ranging protocol