mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_HAL_SITL: add terarangertower simulator
This commit is contained in:
parent
bd5c34f626
commit
5e2bd6d9ec
@ -352,6 +352,12 @@ int SITL_State::sim_fd(const char *name, const char *arg)
|
||||
}
|
||||
rplidara2 = new SITL::PS_RPLidarA2();
|
||||
return rplidara2->fd();
|
||||
} else if (streq(name, "terarangertower")) {
|
||||
if (terarangertower != nullptr) {
|
||||
AP_HAL::panic("Only one terarangertower at a time");
|
||||
}
|
||||
terarangertower = new SITL::PS_TeraRangerTower();
|
||||
return terarangertower->fd();
|
||||
} else if (streq(name, "richenpower")) {
|
||||
sitl_model->set_richenpower(&_sitl->richenpower_sim);
|
||||
return _sitl->richenpower_sim.fd();
|
||||
@ -460,6 +466,11 @@ int SITL_State::sim_fd_write(const char *name)
|
||||
AP_HAL::panic("No rplidara2 created");
|
||||
}
|
||||
return rplidara2->write_fd();
|
||||
} else if (streq(name, "terarangertower")) {
|
||||
if (terarangertower == nullptr) {
|
||||
AP_HAL::panic("No terarangertower created");
|
||||
}
|
||||
return terarangertower->write_fd();
|
||||
} else if (streq(name, "richenpower")) {
|
||||
return _sitl->richenpower_sim.write_fd();
|
||||
} else if (streq(name, "ie24")) {
|
||||
@ -671,6 +682,10 @@ void SITL_State::_fdm_input_local(void)
|
||||
rplidara2->update(sitl_model->get_location());
|
||||
}
|
||||
|
||||
if (terarangertower != nullptr) {
|
||||
terarangertower->update(sitl_model->get_location());
|
||||
}
|
||||
|
||||
if (_sitl) {
|
||||
_sitl->efi_ms.update();
|
||||
}
|
||||
|
@ -49,6 +49,7 @@
|
||||
// #include <SITL/SIM_Frsky_SPort.h>
|
||||
// #include <SITL/SIM_Frsky_SPortPassthrough.h>
|
||||
#include <SITL/SIM_PS_RPLidarA2.h>
|
||||
#include <SITL/SIM_PS_TeraRangerTower.h>
|
||||
|
||||
#include <SITL/SIM_RichenPower.h>
|
||||
#include <AP_HAL/utility/Socket.h>
|
||||
@ -284,9 +285,12 @@ private:
|
||||
SITL::Frsky_D *frsky_d;
|
||||
// SITL::Frsky_SPort *frsky_sport;
|
||||
// SITL::Frsky_SPortPassthrough *frsky_sportpassthrough;
|
||||
// simulated NMEA rangefinder:
|
||||
|
||||
// simulated RPLidarA2:
|
||||
SITL::PS_RPLidarA2 *rplidara2;
|
||||
|
||||
SITL::PS_TeraRangerTower *terarangertower;
|
||||
|
||||
// simulated CRSF devices
|
||||
SITL::CRSF *crsf;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user