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

Battery calculation #10

Merged
merged 6 commits into from
Jan 13, 2022
Merged

Battery calculation #10

merged 6 commits into from
Jan 13, 2022

Conversation

arjo129
Copy link
Member

@arjo129 arjo129 commented Jan 11, 2022

This PR adds a simple formula to limit the battery operation to a fixed amount of time. It does so by adding the flightTime argument to the spawn.launch.py. A second PR with the relevant unit tests is in the works.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
# calculate battery capacity from time
# capacity (Ah) = flight time (in hours) * load (watts) / voltage
# assume constant voltage for battery to keep things simple for now.
battery_capacity = (float(flight_time) / 60) * 6.6 / 12.694
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a flightTime of 5 (min?) and this gives me 0.043327. Seems a little low? Battery ran out quickly.

Copy link
Member Author

@arjo129 arjo129 Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation is correct. The problem was due to gazebosim/gz-sim#225. Fixed in afaa010 . I've opened #11 which has a unit test which tests the discharge time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, nice it's working well now.

We should probably remove the fix_issue_225 in Garden. I see a note there to remove it in Dome..

Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 marked this pull request as ready for review January 12, 2022 07:19
@arjo129 arjo129 requested a review from iche033 January 12, 2022 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants