AP_HAL_SITL: add Ainstein SITL driver

This commit is contained in:
jkronk 2024-03-15 14:41:00 -07:00 committed by Tom Pittenger
parent a7785b0798
commit c38cdc7d72
2 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,12 @@ SITL::SerialDevice *SITL_State_Common::create_serial_sim(const char *name, const
sitl_model->set_adsb(adsb);
return adsb;
#endif
} else if (streq(name, "ainsteinlrd1")) {
if (ainsteinlrd1 != nullptr) {
AP_HAL::panic("Only one ainsteinlrd1 at a time");
}
ainsteinlrd1 = new SITL::RF_Ainstein_LR_D1();
return ainsteinlrd1;
} else if (streq(name, "benewake_tf03")) {
if (benewake_tf03 != nullptr) {
AP_HAL::panic("Only one benewake_tf03 at a time");
@ -338,6 +344,9 @@ void SITL_State_Common::sim_update(void)
attitude);
}
#endif
if (ainsteinlrd1 != nullptr) {
ainsteinlrd1->update(sitl_model->rangefinder_range());
}
if (benewake_tf02 != nullptr) {
benewake_tf02->update(sitl_model->rangefinder_range());
}

View File

@ -14,6 +14,7 @@
#include <SITL/SIM_ADSB_Sagetech_MXS.h>
#include <SITL/SIM_EFI_Hirth.h>
#include <SITL/SIM_Vicon.h>
#include <SITL/SIM_RF_Ainstein_LR_D1.h>
#include <SITL/SIM_RF_Benewake_TF02.h>
#include <SITL/SIM_RF_Benewake_TF03.h>
#include <SITL/SIM_RF_Benewake_TFmini.h>
@ -122,6 +123,8 @@ public:
SITL::Vicon *vicon;
#endif
// simulated Ainstein LR-D1 rangefinder:
SITL::RF_Ainstein_LR_D1 *ainsteinlrd1;
// simulated Benewake tf02 rangefinder:
SITL::RF_Benewake_TF02 *benewake_tf02;
// simulated Benewake tf03 rangefinder: