2020-12-29 06:30:07 -04:00
|
|
|
/*
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
simulate serial VectorNav AHRS
|
|
|
|
|
|
|
|
Usage example:
|
|
|
|
SERIAL5_PROTOCOL = 36
|
|
|
|
AHRS_EKF_TYPE = 11
|
|
|
|
EAHRS_TYPE=1
|
|
|
|
|
2023-12-11 13:13:24 -04:00
|
|
|
sim_vehicle.py -D --console --map -A --serial5=sim:VectorNav
|
2020-12-29 06:30:07 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "SIM_Aircraft.h"
|
|
|
|
|
|
|
|
#include <SITL/SITL.h>
|
|
|
|
#include "SIM_SerialDevice.h"
|
|
|
|
|
|
|
|
namespace SITL {
|
|
|
|
|
|
|
|
class VectorNav : public SerialDevice {
|
|
|
|
public:
|
|
|
|
|
|
|
|
VectorNav();
|
|
|
|
|
|
|
|
// update state
|
|
|
|
void update(void);
|
|
|
|
|
|
|
|
private:
|
2024-07-18 21:27:08 -03:00
|
|
|
uint32_t last_imu_pkt_us;
|
|
|
|
uint32_t last_ekf_pkt_us;
|
|
|
|
uint32_t last_gnss_pkt_us;
|
2020-12-29 06:30:07 -04:00
|
|
|
|
2024-07-18 21:27:08 -03:00
|
|
|
void send_imu_packet();
|
|
|
|
void send_ins_ekf_packet();
|
|
|
|
void send_ins_gnss_packet();
|
2022-12-23 09:14:39 -04:00
|
|
|
void nmea_printf(const char *fmt, ...);
|
2020-12-29 06:30:07 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|