Location: a widget to publish phone's location to ROS#99
Location: a widget to publish phone's location to ROS#99graiola wants to merge 14 commits intoROS-Mobile:masterfrom
Conversation
nicostudt
left a comment
There was a problem hiding this comment.
I left you some comments on the code. I'll try it in the next days.
So far - good work! Thank you for making this PR
| <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | ||
| <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | ||
| <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> | ||
|
|
There was a problem hiding this comment.
With a newer Android version you actually have to include the permission for coarse location as well
There was a problem hiding this comment.
I fixed that in the last commit
| message.setLatitude(latitude); | ||
| message.setLongitude(longitude); | ||
| message.setAltitude(altitude); | ||
|
|
There was a problem hiding this comment.
Consider to include the position_covariance as well to enable the user to use this widget in conjunction with fused odometry.
There was a problem hiding this comment.
I have to check how to get these info
| final boolean networkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); | ||
|
|
||
| if(gpsEnabled) | ||
| locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps); |
There was a problem hiding this comment.
Here it would be nice, if the user can control the minimum distance/time via widget parameters to reduce the drain on the device battery.
There was a problem hiding this comment.
With the fused provider it is slightly different. I will try to export these parameters in the widget if we decide to keep this version using the LocationManager.
| //this.publishRate = 20f; | ||
| this.text = "Publish phone's location to ROS"; | ||
| this.rotation = 0; | ||
| this.buttonPressed = false; |
There was a problem hiding this comment.
Is this something the user should control via parameters from the config?
There was a problem hiding this comment.
Text and rotation can be changed by the user
|
Thing to discuss: |
Thank you! :)
Actually there is a problem with that: the publisher stops when the phone locks. It would be nice to have the publisher running in the background even if the phone locks. I was thinking to embed the I will work on the changes in the next days. Thank you again for your amazing work and suggestions. |
|
I made other two branches to test the new google API for the fused location and to test foreground services with the Here are the branches: https://github.com/graiola/ROS-Mobile-Android/tree/fused https://github.com/graiola/ROS-Mobile-Android/tree/service I think the fused method is better because requires way less code to get the current location, moreover it has a way to define the publishing interval. |
Add a widget to publish the phone's coordinates to ROS.
It needs testing and a good code review because I am not an android developer :P
It would solve #98 and #79