jaspreeth / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Scaling of remaining battery #344

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Any monitoring of battery_remaining in mavlink sys_status message will be 
too low

What is the expected output? What do you see instead?
Should start at 1000 (scaled in 1/10 of 1%, so indicating 100% left), then 
count down. Currently starts at 10 (indicating 1% left) 

What version of the product are you using? On what operating system?
APM 2.11, but same in 2.1

Please provide any additional information below.

Following line in routine mavlink_send_message in module mavlink_common.h 
should be changed from 

uint16_t battery_remaining = 10.0 * (float)(g.pack_capacity - 
current_total)/g.pack_capacity; //Mavlink scaling 100% = 1000

to

uint16_t battery_remaining = 1000.0 * (float)(g.pack_capacity - 
current_total)/g.pack_capacity; //Mavlink scaling 100% = 1000  

Original issue reported on code.google.com by AndrewJF...@gmail.com on 14 May 2011 at 8:39

GoogleCodeExporter commented 8 years ago
Fixed in the trunk.

Will fix in 2.X branch next rev

Original comment by dewei...@gmail.com on 16 May 2011 at 4:31

GoogleCodeExporter commented 8 years ago
Fixed in 2.x branch as well

Original comment by dewei...@gmail.com on 5 Jun 2011 at 2:59