-
Notifications
You must be signed in to change notification settings - Fork 21k
Cleanup and improve sim battery #32124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
12a587f
d40188e
275e975
c1e9938
f6c2ede
ac72c9a
ea555a7
dc4ab14
e8a1313
b305e3c
adba694
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ namespace SITL { | |
| */ | ||
| class Aircraft { | ||
| public: | ||
| Aircraft(const char *frame_str); | ||
| Aircraft(const char *unused_frame_str); | ||
|
|
||
| // called directly after constructor: | ||
| virtual void set_start_location(const Location &start_loc, const float start_yaw); | ||
|
|
@@ -174,7 +174,8 @@ class Aircraft { | |
| void set_dronecan_device(DroneCANDevice *_dronecan) { dronecan = _dronecan; } | ||
| #endif | ||
| float get_battery_voltage() const { return battery_voltage; } | ||
| float get_battery_temperature() const { return battery.get_temperature(); } | ||
| float get_battery_temperature() const { return battery_temperature; } | ||
| float get_battery_current() const { return battery_current; } | ||
|
|
||
| float ambient_temperature_degC() const; | ||
|
|
||
|
|
@@ -222,12 +223,14 @@ class Aircraft { | |
| float airspeed_pitot; // m/s, EAS airspeed, as seen by fwd pitot tube | ||
| float battery_voltage; | ||
| float battery_current; | ||
| float battery_temperature; | ||
| float local_ground_level; // ground level at local position | ||
| bool lock_step_scheduled; | ||
| bool flightaxis_sync_imus_to_frames; // causes the frame counter to be incremented on each timestep, IMUs will then update at the same rate | ||
| uint32_t last_one_hz_ms; | ||
|
|
||
| // battery model | ||
| // OPTIONAL battery model | ||
| // ("OPTIONAL" because a child can ignore it and directly set/get battery_* members.) | ||
| Battery battery; | ||
|
Comment on lines
+232
to
234
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love how every Aircraft has a I welcome a spin-off discussion about the future of simulated batteries. I'd prefer that every aircraft (every instantiated child of As an example, an alternate design would be for "the sim" to own "the simulated battery" as a stand-alone object. While that's nonphysical, its consistent with |
||
|
|
||
| uint32_t motor_mask; | ||
|
|
@@ -274,7 +277,6 @@ class Aircraft { | |
| uint32_t last_frame_count; | ||
| uint8_t instance; | ||
| const char *autotest_dir; | ||
| const char *frame; | ||
| bool use_time_sync = true; | ||
| float last_speedup = -1.0f; | ||
| const char *config_ = ""; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at removing this, but it looks like ~20 children also have it because this does. 🙁
I'm happy to do that in a separate cleanup PR, but it would distract too much from the focus of this one.