From f7b47679bb0db22e7093d85c16a5ff9c791d87bd Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 15 Aug 2019 14:01:24 +1000 Subject: [PATCH] SITL: remove home_str from constructor --- libraries/SITL/SIM_AirSim.cpp | 4 ++-- libraries/SITL/SIM_AirSim.h | 6 +++--- libraries/SITL/SIM_Aircraft.cpp | 26 ++++++++++++++------------ libraries/SITL/SIM_Aircraft.h | 5 ++++- libraries/SITL/SIM_BalanceBot.cpp | 4 ++-- libraries/SITL/SIM_BalanceBot.h | 6 +++--- libraries/SITL/SIM_Balloon.cpp | 4 ++-- libraries/SITL/SIM_Balloon.h | 6 +++--- libraries/SITL/SIM_CRRCSim.cpp | 4 ++-- libraries/SITL/SIM_CRRCSim.h | 6 +++--- libraries/SITL/SIM_Calibration.cpp | 4 ++-- libraries/SITL/SIM_Calibration.h | 6 +++--- libraries/SITL/SIM_FlightAxis.cpp | 4 ++-- libraries/SITL/SIM_FlightAxis.h | 6 +++--- libraries/SITL/SIM_Gazebo.cpp | 4 ++-- libraries/SITL/SIM_Gazebo.h | 6 +++--- libraries/SITL/SIM_Helicopter.cpp | 4 ++-- libraries/SITL/SIM_Helicopter.h | 6 +++--- libraries/SITL/SIM_JSBSim.cpp | 4 ++-- libraries/SITL/SIM_JSBSim.h | 6 +++--- libraries/SITL/SIM_Morse.cpp | 4 ++-- libraries/SITL/SIM_Morse.h | 6 +++--- libraries/SITL/SIM_Multicopter.cpp | 4 ++-- libraries/SITL/SIM_Multicopter.h | 6 +++--- libraries/SITL/SIM_Plane.cpp | 4 ++-- libraries/SITL/SIM_Plane.h | 6 +++--- libraries/SITL/SIM_QuadPlane.cpp | 4 ++-- libraries/SITL/SIM_QuadPlane.h | 6 +++--- libraries/SITL/SIM_Rover.cpp | 4 ++-- libraries/SITL/SIM_Rover.h | 6 +++--- libraries/SITL/SIM_Sailboat.cpp | 4 ++-- libraries/SITL/SIM_Sailboat.h | 6 +++--- libraries/SITL/SIM_Scrimmage.cpp | 4 ++-- libraries/SITL/SIM_Scrimmage.h | 6 +++--- libraries/SITL/SIM_SilentWings.cpp | 4 ++-- libraries/SITL/SIM_SilentWings.h | 6 +++--- libraries/SITL/SIM_SingleCopter.cpp | 4 ++-- libraries/SITL/SIM_SingleCopter.h | 6 +++--- libraries/SITL/SIM_Submarine.cpp | 4 ++-- libraries/SITL/SIM_Submarine.h | 6 +++--- libraries/SITL/SIM_Tracker.cpp | 4 ++-- libraries/SITL/SIM_Tracker.h | 6 +++--- libraries/SITL/SIM_XPlane.cpp | 4 ++-- libraries/SITL/SIM_XPlane.h | 6 +++--- libraries/SITL/SIM_last_letter.cpp | 4 ++-- libraries/SITL/SIM_last_letter.h | 6 +++--- 46 files changed, 128 insertions(+), 123 deletions(-) diff --git a/libraries/SITL/SIM_AirSim.cpp b/libraries/SITL/SIM_AirSim.cpp index 3ee19fc834..1d5b180719 100644 --- a/libraries/SITL/SIM_AirSim.cpp +++ b/libraries/SITL/SIM_AirSim.cpp @@ -16,8 +16,8 @@ extern const AP_HAL::HAL& hal; using namespace SITL; -AirSim::AirSim(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +AirSim::AirSim(const char *frame_str) : + Aircraft(frame_str), sock(true) { printf("Starting SITL Airsim\n"); diff --git a/libraries/SITL/SIM_AirSim.h b/libraries/SITL/SIM_AirSim.h index d87858840f..d9685f88b2 100644 --- a/libraries/SITL/SIM_AirSim.h +++ b/libraries/SITL/SIM_AirSim.h @@ -15,14 +15,14 @@ namespace SITL { class AirSim : public Aircraft { public: - AirSim(const char *home_str, const char *frame_str); + AirSim(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new AirSim(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new AirSim(frame_str); } /* Create and set in/out socket for Airsim simulator */ diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index f2daec8205..c6d0013640 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -38,7 +38,7 @@ using namespace SITL; parent class for all simulator types */ -Aircraft::Aircraft(const char *home_str, const char *frame_str) : +Aircraft::Aircraft(const char *frame_str) : ground_level(0.0f), frame_height(0.0f), dcm(), @@ -63,6 +63,19 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) : // make the SIM_* variables available to simulator backends sitl = AP::sitl(); + set_speedup(1.0f); + + last_wall_time_us = get_wall_time_us(); + frame_counter = 0; + + // allow for orientation settings, such as with tailsitters + enum ap_var_type ptype; + ahrs_orientation = (AP_Int8 *)AP_Param::find("AHRS_ORIENTATION", &ptype); + terrain = reinterpret_cast(AP_Param::find_object("TERRAIN_")); +} + +void Aircraft::set_start_location(const char *home_str) +{ if (!parse_home(home_str, home, home_yaw)) { ::printf("Failed to parse home string (%s). Should be LAT,LON,ALT,HDG e.g. 37.4003371,-122.0800351,0,353\n", home_str); } @@ -75,19 +88,8 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) : ground_level = home.alt * 0.01f; dcm.from_euler(0.0f, 0.0f, radians(home_yaw)); - - set_speedup(1.0f); - - last_wall_time_us = get_wall_time_us(); - frame_counter = 0; - - // allow for orientation settings, such as with tailsitters - enum ap_var_type ptype; - ahrs_orientation = (AP_Int8 *)AP_Param::find("AHRS_ORIENTATION", &ptype); - terrain = reinterpret_cast(AP_Param::find_object("TERRAIN_")); } - /* parse a home string into a location and yaw */ diff --git a/libraries/SITL/SIM_Aircraft.h b/libraries/SITL/SIM_Aircraft.h index f2f687c4fb..fa62c7fad2 100644 --- a/libraries/SITL/SIM_Aircraft.h +++ b/libraries/SITL/SIM_Aircraft.h @@ -37,7 +37,10 @@ namespace SITL { */ class Aircraft { public: - Aircraft(const char *home_str, const char *frame_str); + Aircraft(const char *frame_str); + + // called directly after constructor: + virtual void set_start_location(const char *home_str); /* set simulation speedup diff --git a/libraries/SITL/SIM_BalanceBot.cpp b/libraries/SITL/SIM_BalanceBot.cpp index c46d55554e..38f2986d78 100644 --- a/libraries/SITL/SIM_BalanceBot.cpp +++ b/libraries/SITL/SIM_BalanceBot.cpp @@ -23,8 +23,8 @@ extern const AP_HAL::HAL& hal; namespace SITL { -BalanceBot::BalanceBot(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +BalanceBot::BalanceBot(const char *frame_str) : + Aircraft(frame_str), skid_turn_rate(140) // degrees/sec { dcm.from_euler(0,0,0); // initial yaw, pitch and roll in radians diff --git a/libraries/SITL/SIM_BalanceBot.h b/libraries/SITL/SIM_BalanceBot.h index eec2e11eb2..b3b44c21ff 100644 --- a/libraries/SITL/SIM_BalanceBot.h +++ b/libraries/SITL/SIM_BalanceBot.h @@ -24,14 +24,14 @@ namespace SITL { class BalanceBot : public Aircraft { public: - BalanceBot(const char *home_str, const char *frame_str); + BalanceBot(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new BalanceBot(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new BalanceBot(frame_str); } private: diff --git a/libraries/SITL/SIM_Balloon.cpp b/libraries/SITL/SIM_Balloon.cpp index 6c00cfa99a..77eca0b1ab 100644 --- a/libraries/SITL/SIM_Balloon.cpp +++ b/libraries/SITL/SIM_Balloon.cpp @@ -22,8 +22,8 @@ namespace SITL { -Balloon::Balloon(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +Balloon::Balloon(const char *frame_str) : + Aircraft(frame_str) { mass = 5.0f; } diff --git a/libraries/SITL/SIM_Balloon.h b/libraries/SITL/SIM_Balloon.h index a6c80b699a..081bb36be3 100644 --- a/libraries/SITL/SIM_Balloon.h +++ b/libraries/SITL/SIM_Balloon.h @@ -27,14 +27,14 @@ namespace SITL { */ class Balloon : public Aircraft { public: - Balloon(const char *home_str, const char *frame_str); + Balloon(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Balloon(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Balloon(frame_str); } private: diff --git a/libraries/SITL/SIM_CRRCSim.cpp b/libraries/SITL/SIM_CRRCSim.cpp index 39059754f6..4973886b32 100644 --- a/libraries/SITL/SIM_CRRCSim.cpp +++ b/libraries/SITL/SIM_CRRCSim.cpp @@ -26,8 +26,8 @@ extern const AP_HAL::HAL& hal; namespace SITL { -CRRCSim::CRRCSim(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +CRRCSim::CRRCSim(const char *frame_str) : + Aircraft(frame_str), last_timestamp(0), sock(true) { diff --git a/libraries/SITL/SIM_CRRCSim.h b/libraries/SITL/SIM_CRRCSim.h index 75da72e12a..46bcf83ec8 100644 --- a/libraries/SITL/SIM_CRRCSim.h +++ b/libraries/SITL/SIM_CRRCSim.h @@ -29,14 +29,14 @@ namespace SITL { */ class CRRCSim : public Aircraft { public: - CRRCSim(const char *home_str, const char *frame_str); + CRRCSim(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new CRRCSim(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new CRRCSim(frame_str); } private: diff --git a/libraries/SITL/SIM_Calibration.cpp b/libraries/SITL/SIM_Calibration.cpp index 7160e5685d..7c10ea21c9 100644 --- a/libraries/SITL/SIM_Calibration.cpp +++ b/libraries/SITL/SIM_Calibration.cpp @@ -24,8 +24,8 @@ #include -SITL::Calibration::Calibration(const char *home_str, const char *frame_str) - : Aircraft(home_str, frame_str) +SITL::Calibration::Calibration(const char *frame_str) + : Aircraft(frame_str) { mass = 1.5f; } diff --git a/libraries/SITL/SIM_Calibration.h b/libraries/SITL/SIM_Calibration.h index 0892d21cd4..f2ded133fb 100644 --- a/libraries/SITL/SIM_Calibration.h +++ b/libraries/SITL/SIM_Calibration.h @@ -64,12 +64,12 @@ namespace SITL { */ class Calibration : public Aircraft { public: - Calibration(const char *home_str, const char *frame_str); + Calibration(const char *frame_str); void update(const struct sitl_input &input) override; - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Calibration(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Calibration(frame_str); } private: diff --git a/libraries/SITL/SIM_FlightAxis.cpp b/libraries/SITL/SIM_FlightAxis.cpp index d761794312..5881ffaa1b 100644 --- a/libraries/SITL/SIM_FlightAxis.cpp +++ b/libraries/SITL/SIM_FlightAxis.cpp @@ -82,8 +82,8 @@ static const struct { }; -FlightAxis::FlightAxis(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +FlightAxis::FlightAxis(const char *frame_str) : + Aircraft(frame_str) { use_time_sync = false; rate_hz = 250 / target_speedup; diff --git a/libraries/SITL/SIM_FlightAxis.h b/libraries/SITL/SIM_FlightAxis.h index 86b730e528..04760cd602 100644 --- a/libraries/SITL/SIM_FlightAxis.h +++ b/libraries/SITL/SIM_FlightAxis.h @@ -29,14 +29,14 @@ namespace SITL { */ class FlightAxis : public Aircraft { public: - FlightAxis(const char *home_str, const char *frame_str); + FlightAxis(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new FlightAxis(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new FlightAxis(frame_str); } struct state { diff --git a/libraries/SITL/SIM_Gazebo.cpp b/libraries/SITL/SIM_Gazebo.cpp index a87e2635f3..fe60de34af 100644 --- a/libraries/SITL/SIM_Gazebo.cpp +++ b/libraries/SITL/SIM_Gazebo.cpp @@ -27,8 +27,8 @@ extern const AP_HAL::HAL& hal; namespace SITL { -Gazebo::Gazebo(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +Gazebo::Gazebo(const char *frame_str) : + Aircraft(frame_str), last_timestamp(0), socket_sitl{true} { diff --git a/libraries/SITL/SIM_Gazebo.h b/libraries/SITL/SIM_Gazebo.h index 027a0b10c0..78515d4a92 100644 --- a/libraries/SITL/SIM_Gazebo.h +++ b/libraries/SITL/SIM_Gazebo.h @@ -28,14 +28,14 @@ namespace SITL { */ class Gazebo : public Aircraft { public: - Gazebo(const char *home_str, const char *frame_str); + Gazebo(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Gazebo(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Gazebo(frame_str); } /* Create and set in/out socket for Gazebo simulator */ diff --git a/libraries/SITL/SIM_Helicopter.cpp b/libraries/SITL/SIM_Helicopter.cpp index ea22b4f017..d9c27f7e09 100644 --- a/libraries/SITL/SIM_Helicopter.cpp +++ b/libraries/SITL/SIM_Helicopter.cpp @@ -22,8 +22,8 @@ namespace SITL { -Helicopter::Helicopter(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +Helicopter::Helicopter(const char *frame_str) : + Aircraft(frame_str) { mass = 2.13f; diff --git a/libraries/SITL/SIM_Helicopter.h b/libraries/SITL/SIM_Helicopter.h index c345042506..580b27b924 100644 --- a/libraries/SITL/SIM_Helicopter.h +++ b/libraries/SITL/SIM_Helicopter.h @@ -27,14 +27,14 @@ namespace SITL { */ class Helicopter : public Aircraft { public: - Helicopter(const char *home_str, const char *frame_str); + Helicopter(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Helicopter(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Helicopter(frame_str); } private: diff --git a/libraries/SITL/SIM_JSBSim.cpp b/libraries/SITL/SIM_JSBSim.cpp index 93980db4c2..94e8eb9274 100644 --- a/libraries/SITL/SIM_JSBSim.cpp +++ b/libraries/SITL/SIM_JSBSim.cpp @@ -36,8 +36,8 @@ namespace SITL { #define DEBUG_JSBSIM 1 -JSBSim::JSBSim(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +JSBSim::JSBSim(const char *frame_str) : + Aircraft(frame_str), sock_control(false), sock_fgfdm(true), initialised(false), diff --git a/libraries/SITL/SIM_JSBSim.h b/libraries/SITL/SIM_JSBSim.h index 237ef113c7..26b9489859 100644 --- a/libraries/SITL/SIM_JSBSim.h +++ b/libraries/SITL/SIM_JSBSim.h @@ -29,14 +29,14 @@ namespace SITL { */ class JSBSim : public Aircraft { public: - JSBSim(const char *home_str, const char *frame_str); + JSBSim(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new JSBSim(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new JSBSim(frame_str); } private: diff --git a/libraries/SITL/SIM_Morse.cpp b/libraries/SITL/SIM_Morse.cpp index 835f678cd2..8bac7a7a56 100644 --- a/libraries/SITL/SIM_Morse.cpp +++ b/libraries/SITL/SIM_Morse.cpp @@ -80,8 +80,8 @@ static const struct { }; -Morse::Morse(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +Morse::Morse(const char *frame_str) : + Aircraft(frame_str) { char *saveptr = nullptr; char *s = strdup(frame_str); diff --git a/libraries/SITL/SIM_Morse.h b/libraries/SITL/SIM_Morse.h index e65a36832d..a61f17c29b 100644 --- a/libraries/SITL/SIM_Morse.h +++ b/libraries/SITL/SIM_Morse.h @@ -28,14 +28,14 @@ namespace SITL { */ class Morse : public Aircraft { public: - Morse(const char *home_str, const char *frame_str); + Morse(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Morse(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Morse(frame_str); } private: diff --git a/libraries/SITL/SIM_Multicopter.cpp b/libraries/SITL/SIM_Multicopter.cpp index 090a67ff14..e568d9405e 100644 --- a/libraries/SITL/SIM_Multicopter.cpp +++ b/libraries/SITL/SIM_Multicopter.cpp @@ -23,8 +23,8 @@ using namespace SITL; -MultiCopter::MultiCopter(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +MultiCopter::MultiCopter(const char *frame_str) : + Aircraft(frame_str), frame(nullptr) { mass = 1.5f; diff --git a/libraries/SITL/SIM_Multicopter.h b/libraries/SITL/SIM_Multicopter.h index 075629a3f5..fa9a869358 100644 --- a/libraries/SITL/SIM_Multicopter.h +++ b/libraries/SITL/SIM_Multicopter.h @@ -29,14 +29,14 @@ namespace SITL { */ class MultiCopter : public Aircraft { public: - MultiCopter(const char *home_str, const char *frame_str); + MultiCopter(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new MultiCopter(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new MultiCopter(frame_str); } protected: diff --git a/libraries/SITL/SIM_Plane.cpp b/libraries/SITL/SIM_Plane.cpp index 270fe652f5..36b532c57a 100644 --- a/libraries/SITL/SIM_Plane.cpp +++ b/libraries/SITL/SIM_Plane.cpp @@ -23,8 +23,8 @@ using namespace SITL; -Plane::Plane(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +Plane::Plane(const char *frame_str) : + Aircraft(frame_str) { mass = 2.0f; diff --git a/libraries/SITL/SIM_Plane.h b/libraries/SITL/SIM_Plane.h index cf2cc8736b..4034a8d194 100644 --- a/libraries/SITL/SIM_Plane.h +++ b/libraries/SITL/SIM_Plane.h @@ -29,14 +29,14 @@ namespace SITL { */ class Plane : public Aircraft { public: - Plane(const char *home_str, const char *frame_str); + Plane(const char *frame_str); /* update model by one time step */ virtual void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Plane(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Plane(frame_str); } protected: diff --git a/libraries/SITL/SIM_QuadPlane.cpp b/libraries/SITL/SIM_QuadPlane.cpp index c3b4fd1998..3c8aee544d 100644 --- a/libraries/SITL/SIM_QuadPlane.cpp +++ b/libraries/SITL/SIM_QuadPlane.cpp @@ -22,8 +22,8 @@ using namespace SITL; -QuadPlane::QuadPlane(const char *home_str, const char *frame_str) : - Plane(home_str, frame_str) +QuadPlane::QuadPlane(const char *frame_str) : + Plane(frame_str) { // default to X frame const char *frame_type = "x"; diff --git a/libraries/SITL/SIM_QuadPlane.h b/libraries/SITL/SIM_QuadPlane.h index 303b41ecaa..38c26a394e 100644 --- a/libraries/SITL/SIM_QuadPlane.h +++ b/libraries/SITL/SIM_QuadPlane.h @@ -29,14 +29,14 @@ namespace SITL { */ class QuadPlane : public Plane { public: - QuadPlane(const char *home_str, const char *frame_str); + QuadPlane(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new QuadPlane(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new QuadPlane(frame_str); } private: Frame *frame; diff --git a/libraries/SITL/SIM_Rover.cpp b/libraries/SITL/SIM_Rover.cpp index 26b20607c6..cdbe77899c 100644 --- a/libraries/SITL/SIM_Rover.cpp +++ b/libraries/SITL/SIM_Rover.cpp @@ -23,8 +23,8 @@ namespace SITL { -SimRover::SimRover(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +SimRover::SimRover(const char *frame_str) : + Aircraft(frame_str), max_speed(20), max_accel(10), max_wheel_turn(35), diff --git a/libraries/SITL/SIM_Rover.h b/libraries/SITL/SIM_Rover.h index 2477337493..830fd79922 100644 --- a/libraries/SITL/SIM_Rover.h +++ b/libraries/SITL/SIM_Rover.h @@ -27,14 +27,14 @@ namespace SITL { */ class SimRover : public Aircraft { public: - SimRover(const char *home_str, const char *frame_str); + SimRover(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new SimRover(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new SimRover(frame_str); } private: diff --git a/libraries/SITL/SIM_Sailboat.cpp b/libraries/SITL/SIM_Sailboat.cpp index 1a1a4d04e7..060a2fb183 100644 --- a/libraries/SITL/SIM_Sailboat.cpp +++ b/libraries/SITL/SIM_Sailboat.cpp @@ -38,8 +38,8 @@ namespace SITL { #define WAVE_ANGLE_GAIN 1 #define WAVE_HEAVE_GAIN 1 -Sailboat::Sailboat(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +Sailboat::Sailboat(const char *frame_str) : + Aircraft(frame_str), steering_angle_max(35), turning_circle(1.8) { diff --git a/libraries/SITL/SIM_Sailboat.h b/libraries/SITL/SIM_Sailboat.h index df0f5a0e00..b82f41959c 100644 --- a/libraries/SITL/SIM_Sailboat.h +++ b/libraries/SITL/SIM_Sailboat.h @@ -27,14 +27,14 @@ namespace SITL { */ class Sailboat : public Aircraft { public: - Sailboat(const char *home_str, const char *frame_str); + Sailboat(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Sailboat(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Sailboat(frame_str); } bool on_ground() const override {return true;}; diff --git a/libraries/SITL/SIM_Scrimmage.cpp b/libraries/SITL/SIM_Scrimmage.cpp index 1f1af6c4a7..c4a28bf5b6 100644 --- a/libraries/SITL/SIM_Scrimmage.cpp +++ b/libraries/SITL/SIM_Scrimmage.cpp @@ -35,8 +35,8 @@ extern const AP_HAL::HAL& hal; namespace SITL { -Scrimmage::Scrimmage(const char *home_str, const char *_frame_str) : - Aircraft(home_str, _frame_str), +Scrimmage::Scrimmage(const char *_frame_str) : + Aircraft(_frame_str), prev_timestamp_us(0), recv_sock(true), send_sock(true), diff --git a/libraries/SITL/SIM_Scrimmage.h b/libraries/SITL/SIM_Scrimmage.h index 160a7da86e..35e9fe2082 100644 --- a/libraries/SITL/SIM_Scrimmage.h +++ b/libraries/SITL/SIM_Scrimmage.h @@ -32,14 +32,14 @@ namespace SITL { */ class Scrimmage : public Aircraft { public: - Scrimmage(const char *home_str, const char *frame_str); + Scrimmage(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Scrimmage(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Scrimmage(frame_str); } void set_config(const char *config) override; diff --git a/libraries/SITL/SIM_SilentWings.cpp b/libraries/SITL/SIM_SilentWings.cpp index 7502a9bfc9..9757573f31 100755 --- a/libraries/SITL/SIM_SilentWings.cpp +++ b/libraries/SITL/SIM_SilentWings.cpp @@ -51,8 +51,8 @@ static const struct { { "INS_ACCSCAL_Z", 1.001 }, }; -SilentWings::SilentWings(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +SilentWings::SilentWings(const char *frame_str) : + Aircraft(frame_str), last_data_time_ms(0), first_pkt_timestamp_ms(0), time_base_us(0), diff --git a/libraries/SITL/SIM_SilentWings.h b/libraries/SITL/SIM_SilentWings.h index 9fb0253f81..4e8a91015b 100755 --- a/libraries/SITL/SIM_SilentWings.h +++ b/libraries/SITL/SIM_SilentWings.h @@ -26,14 +26,14 @@ namespace SITL { */ class SilentWings : public Aircraft { public: - SilentWings(const char *home_str, const char *frame_str); + SilentWings(const char *frame_str); /* Updates the aircraft model by one time step */ void update(const struct sitl_input &input) override; /* Static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new SilentWings(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new SilentWings(frame_str); } private: diff --git a/libraries/SITL/SIM_SingleCopter.cpp b/libraries/SITL/SIM_SingleCopter.cpp index f4e28828b7..a4937976c4 100644 --- a/libraries/SITL/SIM_SingleCopter.cpp +++ b/libraries/SITL/SIM_SingleCopter.cpp @@ -22,8 +22,8 @@ using namespace SITL; -SingleCopter::SingleCopter(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +SingleCopter::SingleCopter(const char *frame_str) : + Aircraft(frame_str) { mass = 2.0f; diff --git a/libraries/SITL/SIM_SingleCopter.h b/libraries/SITL/SIM_SingleCopter.h index 5ecceb54e1..1ab8fb2027 100644 --- a/libraries/SITL/SIM_SingleCopter.h +++ b/libraries/SITL/SIM_SingleCopter.h @@ -28,14 +28,14 @@ namespace SITL { */ class SingleCopter : public Aircraft { public: - SingleCopter(const char *home_str, const char *frame_str); + SingleCopter(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new SingleCopter(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new SingleCopter(frame_str); } private: diff --git a/libraries/SITL/SIM_Submarine.cpp b/libraries/SITL/SIM_Submarine.cpp index 89cd67b7c9..31f6e4bdd6 100644 --- a/libraries/SITL/SIM_Submarine.cpp +++ b/libraries/SITL/SIM_Submarine.cpp @@ -35,8 +35,8 @@ static Thruster vectored_thrusters[] = }; -Submarine::Submarine(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str), +Submarine::Submarine(const char *frame_str) : + Aircraft(frame_str), frame(NULL) { frame_height = 0.0; diff --git a/libraries/SITL/SIM_Submarine.h b/libraries/SITL/SIM_Submarine.h index 8cd8431d7c..a82aafb843 100644 --- a/libraries/SITL/SIM_Submarine.h +++ b/libraries/SITL/SIM_Submarine.h @@ -31,14 +31,14 @@ namespace SITL { class Submarine : public Aircraft { public: - Submarine(const char *home_str, const char *frame_str); + Submarine(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Submarine(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Submarine(frame_str); } diff --git a/libraries/SITL/SIM_Tracker.cpp b/libraries/SITL/SIM_Tracker.cpp index e0da8ae32f..1a52004a01 100644 --- a/libraries/SITL/SIM_Tracker.cpp +++ b/libraries/SITL/SIM_Tracker.cpp @@ -22,8 +22,8 @@ namespace SITL { -Tracker::Tracker(const char *home_str, const char *frame_str) : -Aircraft(home_str, frame_str) +Tracker::Tracker(const char *frame_str) : +Aircraft(frame_str) {} diff --git a/libraries/SITL/SIM_Tracker.h b/libraries/SITL/SIM_Tracker.h index 858e33e8e9..82eea5abbb 100644 --- a/libraries/SITL/SIM_Tracker.h +++ b/libraries/SITL/SIM_Tracker.h @@ -27,12 +27,12 @@ namespace SITL { */ class Tracker : public Aircraft { public: - Tracker(const char *home_str, const char *frame_str); + Tracker(const char *frame_str); void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new Tracker(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new Tracker(frame_str); } private: diff --git a/libraries/SITL/SIM_XPlane.cpp b/libraries/SITL/SIM_XPlane.cpp index ee392f94c6..d4c58c1587 100644 --- a/libraries/SITL/SIM_XPlane.cpp +++ b/libraries/SITL/SIM_XPlane.cpp @@ -32,8 +32,8 @@ extern const AP_HAL::HAL& hal; namespace SITL { -XPlane::XPlane(const char *home_str, const char *frame_str) : - Aircraft(home_str, frame_str) +XPlane::XPlane(const char *frame_str) : + Aircraft(frame_str) { use_time_sync = false; const char *colon = strchr(frame_str, ':'); diff --git a/libraries/SITL/SIM_XPlane.h b/libraries/SITL/SIM_XPlane.h index 165aad8f1b..cf5180fdb1 100644 --- a/libraries/SITL/SIM_XPlane.h +++ b/libraries/SITL/SIM_XPlane.h @@ -29,14 +29,14 @@ namespace SITL { */ class XPlane : public Aircraft { public: - XPlane(const char *home_str, const char *frame_str); + XPlane(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new XPlane(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new XPlane(frame_str); } private: diff --git a/libraries/SITL/SIM_last_letter.cpp b/libraries/SITL/SIM_last_letter.cpp index ab6547f5ac..0215c09a9e 100644 --- a/libraries/SITL/SIM_last_letter.cpp +++ b/libraries/SITL/SIM_last_letter.cpp @@ -29,8 +29,8 @@ extern const AP_HAL::HAL& hal; namespace SITL { -last_letter::last_letter(const char *home_str, const char *_frame_str) : - Aircraft(home_str, _frame_str), +last_letter::last_letter(const char *_frame_str) : + Aircraft(_frame_str), last_timestamp_us(0), sock(true) { diff --git a/libraries/SITL/SIM_last_letter.h b/libraries/SITL/SIM_last_letter.h index 96cb15808a..ca66ed8f0d 100644 --- a/libraries/SITL/SIM_last_letter.h +++ b/libraries/SITL/SIM_last_letter.h @@ -29,14 +29,14 @@ namespace SITL { */ class last_letter : public Aircraft { public: - last_letter(const char *home_str, const char *frame_str); + last_letter(const char *frame_str); /* update model by one time step */ void update(const struct sitl_input &input) override; /* static object creator */ - static Aircraft *create(const char *home_str, const char *frame_str) { - return new last_letter(home_str, frame_str); + static Aircraft *create(const char *frame_str) { + return new last_letter(frame_str); } private: