Exemplo n.º 1
0
 public RegisterIO(IRegisterIo io_provider, byte update_rate_hz, IIoCompleteNotification notify_sink, IBoardCapabilities board_capabilities)
 {
     this.io_provider = io_provider;
     this.update_rate_hz = update_rate_hz;
     this.board_capabilities = board_capabilities;
     this.notify_sink = notify_sink;
     raw_data_update = new IMUProtocol.GyroUpdate();
     ahrs_update = new AHRSProtocol.AHRSUpdate();
     ahrspos_update = new AHRSProtocol.AHRSPosUpdate();
     board_state = new BoardState();
     board_id = new AHRSProtocol.BoardID();
 }
Exemplo n.º 2
0
        const bool debug = false; /* Set to true to enable debug output (to smart dashboard) */

        public SerialIO(SerialPort.Port port_id, byte update_rate_hz, bool processed_data, IIoCompleteNotification notify_sink, IBoardCapabilities board_capabilities)
        {
            this.serial_port_id = port_id;
            ypr_update_data = new IMUProtocol.YPRUpdate();
            gyro_update_data = new IMUProtocol.GyroUpdate();
            ahrs_update_data = new AHRSProtocol.AHRSUpdate();
            ahrspos_update_data = new AHRSProtocol.AHRSPosUpdate();
            board_id = new AHRSProtocol.BoardID();
            board_state = new BoardState();
            this.notify_sink = notify_sink;
            this.board_capabilities = board_capabilities;
            serial_port = GetMaybeCreateSerialPort();
            this.update_rate_hz = update_rate_hz;
            if (processed_data)
            {
                update_type = AHRSProtocol.MSGID_AHRSPOS_UPDATE;
            }
            else {
                update_type = IMUProtocol.MSGID_GYRO_UPDATE;
            }
        }
Exemplo n.º 3
0
 public void SetBoardState(BoardState boardState)
 {
     m_parent.m_updateRateHz = boardState.UpdateRateHz;
     m_parent.m_accelFsrG = boardState.AccelFsrG;
     m_parent.m_gyroFsrDps = boardState.GyroFsrDps;
     m_parent.m_capabilityFlags = boardState.CapabilityFlags;
     m_parent.m_opStatus = boardState.OpStatus;
     m_parent.m_sensorStatus = boardState.SensorStatus;
     m_parent.m_calStatus = boardState.CalStatus;
     m_parent.m_selftestStatus = boardState.SelftestStatus;
 }