Skip to content

Commit

Permalink
AP_HAL_SITL: Added Software simulation for Advanced Navigation Devices.
Browse files Browse the repository at this point in the history
Adds ability for SITL Simulation of an AdNav device to be used by making a simulated serial port.
Changes create a SITL::AdNav class when requested on the command line
  • Loading branch information
AN-DanielCook authored and tridge committed Dec 2, 2023
1 parent a69ff65 commit 7417b98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libraries/AP_HAL_SITL/SITL_State_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ SITL::SerialDevice *SITL_State_Common::create_serial_sim(const char *name, const
}
microstrain5 = new SITL::MicroStrain5();
return microstrain5;
} else if (streq(name, "AdNav")) {
if (adnav != nullptr) {
AP_HAL::panic("Only one AdNav at a time");
}
adnav = new SITL::AdNav();
return adnav;
#if HAL_SIM_AIS_ENABLED
} else if (streq(name, "AIS")) {
if (ais != nullptr) {
Expand Down Expand Up @@ -435,6 +441,10 @@ void SITL_State_Common::sim_update(void)
microstrain5->update();
}

if (adnav != nullptr) {
adnav->update();
}

#if HAL_SIM_AIS_ENABLED
if (ais != nullptr) {
ais->update();
Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_HAL_SITL/SITL_State_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <SITL/SIM_RF_GYUS42v2.h>
#include <SITL/SIM_VectorNav.h>
#include <SITL/SIM_MicroStrain.h>
#include <SITL/SIM_AdNav.h>
#include <SITL/SIM_AIS.h>
#include <SITL/SIM_GPS.h>

Expand Down Expand Up @@ -200,6 +201,9 @@ class HALSITL::SITL_State_Common {
// simulated LORD MicroStrain system
SITL::MicroStrain5 *microstrain5;

// simulated AdNav system:
SITL::AdNav *adnav;

#if HAL_SIM_JSON_MASTER_ENABLED
// Ride along instances via JSON SITL backend
SITL::JSON_Master ride_along;
Expand Down

0 comments on commit 7417b98

Please sign in to comment.