Skip to content

Commit

Permalink
SITL: tidy creation of simulated rangefinders
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jan 5, 2025
1 parent 98a06c5 commit 27662bd
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_Ainstein_LR_D1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_BLping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_Benewake_TF02.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_Benewake_TF03.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_Benewake_TFmini.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_GYUS42v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_JRE.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_Lanbao.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_LeddarOne.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_LightWareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_LightWareSerialBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_MAVLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_MaxsonarSerialLV.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_NMEA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_NoopLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_RDS02UF.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_TeraRanger_Serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_USD1_v0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_USD1_v1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SIM_RF_Wasp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27662bd

Please sign in to comment.