mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_HAL_SITL: add simulated RPLidarA1
This commit is contained in:
parent
2257d4686f
commit
ae7fb93e4c
@ -374,6 +374,14 @@ SITL::SerialDevice *SITL_State::create_serial_sim(const char *name, const char *
|
||||
rplidara2 = new SITL::PS_RPLidarA2();
|
||||
return rplidara2;
|
||||
#endif
|
||||
#if HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
} else if (streq(name, "rplidara1")) {
|
||||
if (rplidara1 != nullptr) {
|
||||
AP_HAL::panic("Only one rplidara1 at a time");
|
||||
}
|
||||
rplidara1 = new SITL::PS_RPLidarA1();
|
||||
return rplidara1;
|
||||
#endif
|
||||
#if HAL_SIM_PS_TERARANGERTOWER_ENABLED
|
||||
} else if (streq(name, "terarangertower")) {
|
||||
if (terarangertower != nullptr) {
|
||||
@ -678,6 +686,11 @@ void SITL_State::_fdm_input_local(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
if (rplidara1 != nullptr) {
|
||||
rplidara1->update(sitl_model->get_location());
|
||||
}
|
||||
#endif
|
||||
#if HAL_SIM_PS_TERARANGERTOWER_ENABLED
|
||||
if (terarangertower != nullptr) {
|
||||
terarangertower->update(sitl_model->get_location());
|
||||
|
@ -55,6 +55,7 @@
|
||||
// #include <SITL/SIM_Frsky_SPort.h>
|
||||
// #include <SITL/SIM_Frsky_SPortPassthrough.h>
|
||||
#include <SITL/SIM_PS_RPLidarA2.h>
|
||||
#include <SITL/SIM_PS_RPLidarA1.h>
|
||||
#include <SITL/SIM_PS_TeraRangerTower.h>
|
||||
#include <SITL/SIM_PS_LightWare_SF45B.h>
|
||||
|
||||
@ -257,6 +258,9 @@ private:
|
||||
// simulated FETtec OneWire ESCs:
|
||||
SITL::FETtecOneWireESC *fetteconewireesc;
|
||||
|
||||
// simulated RPLidarA1:
|
||||
SITL::PS_RPLidarA1 *rplidara1;
|
||||
|
||||
#if HAL_SIM_PS_LIGHTWARE_SF45B_ENABLED
|
||||
// simulated SF45B proximity sensor:
|
||||
SITL::PS_LightWare_SF45B *sf45b;
|
||||
|
@ -51,7 +51,7 @@ rc 2 1450
|
||||
#define HAL_SIM_PS_RPLIDARA2_ENABLED HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
|
||||
#endif
|
||||
|
||||
#if HAL_SIM_PS_RPLIDARA2_ENABLED
|
||||
#if HAL_SIM_PS_RPLIDARA2_ENABLED || HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@ -144,4 +144,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // HAL_SIM_PS_RPLIDARA2_ENABLED
|
||||
#endif // HAL_SIM_PS_RPLIDARA2_ENABLED || HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
|
@ -45,6 +45,11 @@ rc 2 1450
|
||||
|
||||
#include "SIM_PS_RPLidar.h"
|
||||
|
||||
#ifndef HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
#define HAL_SIM_PS_RPLIDARA1_ENABLED HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
|
||||
#endif
|
||||
|
||||
#if HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
namespace SITL {
|
||||
|
||||
class PS_RPLidarA1 : public PS_RPLidar {
|
||||
@ -54,3 +59,5 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // HAL_SIM_PS_RPLIDARA1_ENABLED
|
||||
|
Loading…
Reference in New Issue
Block a user