{"action":"created","issue":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/9414","repository_url":"https://api.github.com/repos/ArduPilot/ardupilot","labels_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/9414/labels{/name}","comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/9414/comments","events_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/9414/events","html_url":"https://github.com/ArduPilot/ardupilot/pull/9414","id":359685287,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MTIxOTMx","number":9414,"title":"AP_BattMonitor: Run arming checks, increase number of instances.","user":{"login":"WickedShell","id":567688,"node_id":"MDQ6VXNlcjU2NzY4OA==","avatar_url":"https://avatars2.githubusercontent.com/u/567688?v=4","gravatar_id":"","url":"https://api.github.com/users/WickedShell","html_url":"https://github.com/WickedShell","followers_url":"https://api.github.com/users/WickedShell/followers","following_url":"https://api.github.com/users/WickedShell/following{/other_user}","gists_url":"https://api.github.com/users/WickedShell/gists{/gist_id}","starred_url":"https://api.github.com/users/WickedShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WickedShell/subscriptions","organizations_url":"https://api.github.com/users/WickedShell/orgs","repos_url":"https://api.github.com/users/WickedShell/repos","events_url":"https://api.github.com/users/WickedShell/events{/privacy}","received_events_url":"https://api.github.com/users/WickedShell/received_events","type":"User","site_admin":false},"labels":[{"id":208947406,"node_id":"MDU6TGFiZWwyMDg5NDc0MDY=","url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/AllVehicles","name":"AllVehicles","color":"bfd4f2","default":false},{"id":547273148,"node_id":"MDU6TGFiZWw1NDcyNzMxNDg=","url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/DevCallTopic","name":"DevCallTopic","color":"b60205","default":false},{"id":24259150,"node_id":"MDU6TGFiZWwyNDI1OTE1MA==","url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/Enhancement","name":"Enhancement","color":"84b6eb","default":false},{"id":136051782,"node_id":"MDU6TGFiZWwxMzYwNTE3ODI=","url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/Library","name":"Library","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-12T23:12:39Z","updated_at":"2018-09-26T20:45:14Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/9414","html_url":"https://github.com/ArduPilot/ardupilot/pull/9414","diff_url":"https://github.com/ArduPilot/ardupilot/pull/9414.diff","patch_url":"https://github.com/ArduPilot/ardupilot/pull/9414.patch"},"body":"This replaces #8025. Was actually easier to redo it accounting for the requested changes on master then rebase and correct the other one.\r\n\r\nThe key change this provides is that it allows AP_BattMonitor to run the arming checks for the battery. This is significant, as the current structure allows you to arm with a battery which would immediately failsafe (but hasn't yet because the vehicle isn't armed so we don't run failsafe checks). This also moves the arming minimum voltage parameters into the AP_BattMonitor_Params table, and provides an accompanying minimum remaining capacity parameter (there are a couple of notes on that in the description dealing with the assurances this parameter provides if you don't have a smart battery).\r\n\r\nThere are some structural rearrangements presented here as well. They key one is that the function to do the failsafe updating on a single battery was split into a function that determines if we are below a voltage/capacity threshold, and an outside caller that manages timers. This was critical to allow the arming check to be running exactly the same checks as failsafe checks. (Otherwise someone would forget to keep the near identical functions looking the same in the future). Because this also moved to the backend this allows drivers like smart batteries to override the arming checks (or failsafe conditions) in the future, which will allow us to utilize their alarm flags, and any other data provided from the battery.\r\n\r\nFinally this increases the number of battery monitors to 9. Given that these are all behind the `ENABLE` parameters a GCS should only see an increase of 6 or 7 params to download. At a minimum I need 4 monitors enabled now, 9 helps us cover a number of requests for more monitors I've received, without going into hex numbering.\r\n\r\nThe AP_BattMonitor commits can be squashed before merging, they've been left standalone for now as it makes it easier to review the transformations of the failsafe checks then just looking at the final diff.\r\n\r\nThe final note is that this does not provide parameter conversion code at the moment. Due to being inside a sub group the conversion code is painful to add, requires us to burn another parameter permanently to storage to indicate the conversion. Before I went through the pain to get the exact table indexes for all the vehicles I wanted to confirm if we really needed the conversion on these parameters, I suspect very few people have ever seen or used them, but I could be underestimating that."},"comment":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/comments/424863686","html_url":"https://github.com/ArduPilot/ardupilot/pull/9414#issuecomment-424863686","issue_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/9414","id":424863686,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDg2MzY4Ng==","user":{"login":"WickedShell","id":567688,"node_id":"MDQ6VXNlcjU2NzY4OA==","avatar_url":"https://avatars2.githubusercontent.com/u/567688?v=4","gravatar_id":"","url":"https://api.github.com/users/WickedShell","html_url":"https://github.com/WickedShell","followers_url":"https://api.github.com/users/WickedShell/followers","following_url":"https://api.github.com/users/WickedShell/following{/other_user}","gists_url":"https://api.github.com/users/WickedShell/gists{/gist_id}","starred_url":"https://api.github.com/users/WickedShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WickedShell/subscriptions","organizations_url":"https://api.github.com/users/WickedShell/orgs","repos_url":"https://api.github.com/users/WickedShell/repos","events_url":"https://api.github.com/users/WickedShell/events{/privacy}","received_events_url":"https://api.github.com/users/WickedShell/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T20:45:14Z","updated_at":"2018-09-26T20:45:14Z","author_association":"CONTRIBUTOR","body":"@OXINARF I'm 100% with you on using an index field. This is growing out of control and is a prime example for why the unique fields don't work well (and the number of log ID's this burns is insanely high)"}}
{"actor":{"display_login":"WickedShell"}}