Open khancyr opened 5 years ago
i would like work on this, is this still required?
From the code change in #9900 on libraries/AP_HAL_SITL/SITL_State.cpp
and recommended approach for this, we should have a battery object that returns right throttle value dependent on the vehicle type.
Did i get the approach right?
hello, yes this is still require ! We should do it step by step. The first one would be to have battery object in SITL, then each vehicle could implement its correct consumption based on motors output requested. Then we could improve the battery, adding new chemistry (lipo, NICD, lead battery, etc), custom discharge rate, temperature, etc etc.
Yep, i would like to work on this, i will first add a battery object in SITL.
I have explored creating a SIM_Battery
, like that of SIM_Sprayer
and SIM_Parachute
.
But the function to calculate the the servo voltage (float get_servo_voltage()
), I have plans to make it a function in SIM_Aircraft
that can be overriden.
Is this the right track?
Also, one last thing, i have searched all over, and it seems like the battery voltage and current is used to set the simulated pin out. Is there anyplace where the battery level is lowered in the SITL, might have missed something.
pr open
@khancyr any update for this?
haha, any updates?
@khancyr should this one still be open? There is a sim_battery now. But I think there is still work to be done for vehicle type's other than multicopter?
We got a proper SITL backend now, but it would deserve some work to be adapted to each vehicles type. So I think we could leave it open as that a good issue for newcomeers
Great! So as an update the things that still need to done for this issue:
Add the battery backend and an appropriate model to the following using SIM_MultiCopter.cpp
as a guide
I would like to contribute to this. Could you guide me on how? Thank you!
I have made the changes for SIM_Plane here is the pull request,
Please guide me if I am going in the correct direction.
@hendjoshsr71 could you evaluate this, please?
Feature request
Is your feature request related to a problem? Please describe. Following https://github.com/ArduPilot/ardupilot/pull/9900, we should create a correct way to implement battery consumption on SITL : Maybe with a battery object in SITL and with model of consumption on each vehicle backend.
Platform [ X] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [ ] Submarine