Ros Interface to Android Sensors!
This project is compatible with Android Studio.
Heavily Inspired by ros_android_sensors_driver during development.
Currently Supporting Android 7.0 (Nougat) API 24
Intended for Aiding Robot Navigation and Localization
List of Supported Sensors:
- GPS
- Gyroscope
- Accelerometer
- Magnetometer
- Barometer
- Camera
- Microphone
Other Tasks:
- Support for Visual Odometry
- Support for Fused Odometry?
In my case, I installed the library as:
cd ~/libs
mkdir -p android_core/src
wstool init -j4 src https://raw.github.com/rosjava/rosjava/kinetic/android_core.rosinstall
catkin build
echo 'source ~/libs/android_core/devel/setup.bash' >> ~/.bashrc
Remember to add the --extend
option for any overlaying workspace afterwards.
Before you start, consider the below steps if you don't want to bother with connection over wireless network.
-
Edit the network interfaces file:
sudo vim /etc/network/interfaces
-
Add the following lines:
allow-hotplug usb0 iface usb0 inet dhcp
-
Re-start networking:
sudo service networking restart
-
Configure USB Tethering on the Android Device:
Settings > Mobile Hotspot and Tethering > USB Tethering ON
Now you should be ready to go!
-
Start roscore on the host computer:
roscore
-
Poll the host computer's IP address:
ifconfig [usb0/wlan0]
Whether or not it is usb0/wlan0, etc. is dependent on how you configured the network settings.
Be sure to have the phone connected to the same network as the host computer!
-
Launch the app, and enter the IP address.
-
To test whether or not the topics are being published:
rostopic list rostopic echo /android/imu rostopic echo /android/gps