Mavros, howto read second battery monitor - ros

i am using both battery monitors on my pixhawk with Ardurover as fluid flow meters and need to get the data in my ROS ecosystem. After a fair amount of research, I was not able to find a reference to a second battery status besides the one published on
mavros/battery as sensor_msgs/BatteryState. But this seems to be for a single battery
Can someone please tell me that the second monitor is implemented and where to find it.....(please also tell me if this is not implemented yet)

Related

How much accurate does apps like Uber, GoogleMap, Life360 works, I mean what can be the minimum distanceFilterValue to listen to location updates?

I am working on a feature in an iOS app to send location updates to our backend when there is a change in the location.
Initially, I had set minimalDistanceFilter(minimum change in location value) to none to send location updates. But it is making the network calls continuously and it can increase the load on the backend.
If some of you worked on this case earlier, I wanted to know how you solved it. What can be the minimalDistanceFilter?
I am also curious about how the above-listed apps work with location-related events.
The distanceFilter and the desiredAccuracy go hand-in-hand. For the distance filter, it can be anything between kCLDistanceFilterNone and CLLocationDistanceMax. See the documentation.
Regarding what other people used, it will vary widely from app to app. For navigation apps, you tend to need high accuracy so you don't miss a turn. But a weather app might be perfectly happy with city-level accuracy.
If you really need reasonable precision and want to reduce volume, then a filter of 5–15 meters is a good starting point. Try different values yourself and see what the effect is.
But there is no magical answer to your question. You will have to balance the legitimate needs of your app with (a) the server load; and (b) the power consumption on the device.
By the way, if the app doesn't need high accuracy, you might contemplate the very efficient, but less accurate, significant change service which will report changes of roughly 500 meters, with a frequency not exceeding once every 5 minutes
Finally, remember, nowadays the user is in control of the accuracy. You can request whatever accuracy you want, but if the user wants to preserve their privacy, they can choose not to share their precise location, and there is nothing you can do about it (other than to try to make a case for why precise location data is essential for the proper functioning of your app).

CMMotionActivity detailing automotive to distinguish between car and train

I'm using CMMotionActivity and trying to distinguish between car, train and bus when the framework return automotive type.
This is not possible only using CoreMotion, so I think it's necessary to use a 3rd party service, such as cloud service or 3rd party framework.
Has anyone got to face the same problem?
Thanks
I had the same problem a while back. Long story short, it's pretty much impossible from anything in existence. However, it is not too hard to bake it yourself. Here's how I solved it-
My app had background location permission, in addition to motion permission. The background location kept the app alive. As you might know, you can't enable the location monitoring from background, but you can keep it alive for as long as you want, and you can change the quality of service from the background. To avoid draining battery, I set it to the lowest quality of data possible, so that it basically had no effect on power consumption when idle. That way, you have background access to motion data with an ability to enable precise location tracking without opening the app, you just have to never shut off location monitoring.
I used this background permission to monitor the motion data, and whenever it changed to automotive with a certain confidence threshold, I upped the location data quality to the best available, and stored it to disk as soon as possible. When the motion chip reported walking or some other non-automotive activity, indicating that the automotive session had ended, I prompted the user to open the app to fill in other details (this was a driving tracker for tax purposes). When the user opened the app, I pulled train track data from a map provider, and ran a quick "algorithm" to detect if the automotive activity was correlated with any train tracks. If it was with a certain confidence, I discarded the data as I did not need it, but that's what you should do. Just correlate high-quality location data with map data of train tracks.
I got my train track data from my countries government as it's open, but I suppose other map providers have this data available as well.
Hopefully this helps you out, sorry I could not provide a prebaked service!

Xamarin - IOS - Battery usage

i have developped an IOS application with Xaramin and am trying to find out what is consuming most significantly the battery. The application has three main activities:
Listen to location updates in the background (with AccurityNearestTenMeters and DistanceFilter = 50)
Write all the acquired locations every 10 seconds in a file
Send the file content to a remote server by using a standard HttpClient object
The application is consuming about 50% of the battery after 7 hours or so. It depends on the user movement but let's say that there are plenty of movements by walk, tramway, etc...then a reasonable amount of time where there is much less movements (i.e at work).
I have tried to change the desired accuracy to nearest 100 meter and also change the distance filter. I got some pretty good optimization especially for the accuracy change but i need to have more precise locations so am looking for another possibility if any to optimize the battery.
There are many questions that cross my mind and for which i would like to have your feedbacks please: what is more battery consuming? Location updates or file writing? also the same for a network request so if i put it side by side what does consume more the battery: location updates, file writing or network requests. I mean from a general point of view.
Also, do you guys have any recommendations or information that can help me in this optimization ?

Dynamic accuracy with Core Location

I would like my iOS app to get notified in background whenever user stops (or slows down below some velocity threshold) at a place while maintaining maximum battery life.
The catch is that I don't really care for accuracy when the user is moving but I need as accurate measurement as possible when user stops or walks around the same spot.
There are many Core Location tools available:
Standard Location Service
Significant Change Location Service
Geofencing and Ranging Service
Integration with Core Motion and M7 Motion Coprocessor
Which one of them should I use? Is there a best practice for what I am attempting to do? Has anybody experience with this sort of stuff? I found this app which does exactly what I want to incorporate in my app but I'm not permitted to use their API.
I've read the documentation but my case doesn't really fit any of the categories they discuss.
Thanks in advance.
Pete.
In iOS8 there is a new technology that fits what it sounds like you are asking for. CLVisit objects are sent to your app in the background when the user arrives or departs after stopping at a location. Power consumption is very low with this feature. You enable it by calling startMonitoringVisits on a CLLocationManager object.

Switch btw. Location Manager & Region Monitoring

for an app that is part of a scientific study I have to implement location tracking (the users who take part in the study know this and are willing to supply this data). The two premises for this app are:
track the user's location with the highest accuracy possible while he/she is on the move
use as little power as possible so that users don't feel the need to shut down the app (turn off location services for it), while they aren't using it
I know these two requirements normally exclude each other :) So the general question is "What would be the best strategy to meet in the middle here?"
My thoughts were to monitor as usual with the highest accuracy possible while location changes keep coming in. If we detect that the delta between theses location updates become almost 0 over a certain period of time, we would assume that the user is not "on the move" anymore and would switch to region monitoring (with a radius of e.g. 40m). Once the user exits that region we'd switch back to regular location monitoring.
So two questions:
Can you tell me if the proposed approach will work for an app that is running in the background?
Have you maybe implemented something similar and know if it really saves a lot of battery power?
Regards,
Sebastian
My thoughts were to monitor as usual with the highest accuracy possible while location changes keep coming in. If we detect that the delta between theses location updates become almost 0 over a certain period of time, we would assume that the user is not "on the move" anymore and would switch to region monitoring (with a radius of e.g. 40m). Once the user exits that region we'd switch back to regular location monitoring.
Using region monitoring to re-engage the location monitoring has a few draw backs, that I have found:
If you set up a region for the user's current location, then wait for -didExitRegion to fire, you're reliant upon the system's default radius cushion, (probably 200m) and some time (probably 20 sec) after they cross out of their boundary before you'll get the message. If accuracy is your main goal, you're likely to loose a lot of data points in between when region monitoring started and when you cross out of the region. Is that acceptable for your needs?
So, to answer your questions:
Can you tell me if the proposed approach will work for an app that is running in the background?
You should not have any trouble running this type of thing in the background. Both location monitoring and region monitoring work when an app is backgrounded, provided you've set it up to do so. Also, to ensure Region Monitoring works on iOS 7 you must have Background App Refresh turned on for your app. That tripped me up.
Have you maybe implemented something similar and know if it really saves a lot of battery power?
In our experience the battery savings were not noticeable. Region Monitoring can be a battery drain that's just as significant as the high accuracy location updates because it uses all kinds of hardware to do it's thing. So pick your poison. Apple's recommendation for saving battery is and always has been to use the significant change location service. It gives you good location data just not as often.

Resources