Skip to content
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

No battery drain and other issues in flight #9

Open
Scratchcat1 opened this issue Oct 5, 2017 · 3 comments
Open

No battery drain and other issues in flight #9

Scratchcat1 opened this issue Oct 5, 2017 · 3 comments

Comments

@Scratchcat1
Copy link
Owner

AATC/AATC_Drone_Logic.py

Lines 116 to 117 in 9816fc7

def DroneHardware(FlightQueue,StatusQueue):
Battery = 100

Battery of Drone currently does not decrease during flight and Drone will always follow path exactly, no movement of wind is shown.

Time Interval Battery Drain = ( Distance Moved / Range )*100 * random.random(0.9,1.1)
This means that if the drone moved a Distance equal to half it's range it will have used ~50% of it's battery.
The random section means that it will have some randomness eg due to wind etc
Distance moved could be calculated from AATC_Coordinate.DeltaCoordsToMetres using the last two coordinates.

@Scratchcat1
Copy link
Owner Author

AATC/AATC_Drone_Logic.py

Lines 184 to 188 in 274f7dc

def DecrementBattery(DroneInfo,CoordA,CoordB,Battery):
distance = AATC_Coordinate.DeltaCoordToMetres(CoordA,CoordB)
decAmount = (distance/DroneInfo.DroneRange)*100
Battery -= decAmount
return Battery

-Added battery drain

@Scratchcat1
Copy link
Owner Author

decAmount = (distance/DroneInfo.DroneRange)*100*(1+random.randint(-1,1)*0.1)

-Added randomness to battery drain.

@Scratchcat1
Copy link
Owner Author

decAmount = (distance/DroneInfo.DroneRange)*100*(1+random.randint(-1,1)*0.1) * AATC_Config.DRONE_BATTERY_DRAIN_MULT

Added battery drain multiplier AATC_Config setting to modify battery drain of simulation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant