SITL: tidy creation of simulated rangefinders

This commit is contained in:
Peter Barker 2022-06-22 10:06:32 +10:00 committed by Peter Barker
parent 98a06c566b
commit 27662bd106
20 changed files with 40 additions and 0 deletions

View File

@ -44,6 +44,8 @@ namespace SITL {
class RF_Ainstein_LR_D1 : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Ainstein_LR_D1(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
uint16_t reading_interval_ms() const override { return 100; }

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_BLping : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_BLping(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -37,6 +37,8 @@ namespace SITL {
class RF_Benewake_TF02 : public RF_Benewake {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Benewake_TF02(); }
// see AP_RangeFinder_Benewake.cpp for definitions
uint8_t byte4() const override { return 1; } // strength low-bits
uint8_t byte5() const override { return 1; } // strength high-bits

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_Benewake_TF03 : public RF_Benewake {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Benewake_TF03(); }
// see AP_RangeFinder_Benewake.cpp for definitions
uint8_t byte4() const override { return 0; } // reserved
uint8_t byte5() const override { return 0; } // reserved

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_Benewake_TFmini : public RF_Benewake {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Benewake_TFmini(); }
// see AP_RangeFinder_Benewake.cpp for definitions
uint8_t byte4() const override { return 1; } // strength L
uint8_t byte5() const override { return 1; } // strength H

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_GYUS42v2 : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_GYUS42v2(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
// TODO: work this out

View File

@ -37,6 +37,8 @@ namespace SITL {
class RF_JRE : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_JRE(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
private:

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_Lanbao : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Lanbao(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_LeddarOne : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_LeddarOne(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_LightWareSerial : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_LightWareSerial(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
void update(float range) override;

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_LightWareSerialBinary : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_LightWareSerialBinary(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_MAVLink : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_MAVLink(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
private:

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_MaxsonarSerialLV : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_MaxsonarSerialLV(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -37,6 +37,8 @@ namespace SITL {
class RF_NMEA : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_NMEA(); }
uint32_t device_baud() const override { return 9600; }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;

View File

@ -25,6 +25,8 @@ namespace SITL {
class RF_Nooploop : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Nooploop(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -37,6 +37,8 @@ namespace SITL {
class RF_RDS02UF : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_RDS02UF(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -31,6 +31,8 @@ namespace SITL {
class RF_TeraRanger_Serial : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_TeraRanger_Serial(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_USD1_v0 : public RF_USD1 {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_USD1_v0(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_USD1_v1 : public RF_USD1 {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_USD1_v1(); }
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;
};

View File

@ -36,6 +36,8 @@ namespace SITL {
class RF_Wasp : public SerialRangeFinder {
public:
static SerialRangeFinder *create() { return NEW_NOTHROW RF_Wasp(); }
void update(float range) override;
uint32_t packet_for_alt(uint16_t alt_cm, uint8_t *buffer, uint8_t buflen) override;