After integrating ROS and SparkV robot, its very easy to control the SparkV robot using Android phone's accelerometer. The prerequisite for this tutorial is basic understanding of ROS and my previous tutorial of integrating ROS and SparkV.
Package summary :
sparkV_android is a basic ROS package that subscribes to imu messages published by phone and according to the phone's orientation publishes motion command to sparkV robot.
Installation:
First install the ROS android sensor driver app from android market.
After that you have to connect your phone and computer to same network. For this you can check this tutorial. OR simply you can start a portable WiFi hotspot from your android device and connect your laptop to that network. After that open a new terminal and write
ifconfig
You will see your IP address in wlan tab as
inet addr:YOUR-IP
Now enter this IP address as http://YOUR-IP:11311/ in the app and start the app.
To verify the topics, try
roscore
rostopic list
rostopic echo /android/imu
Sends velocity commands to SparkV robot.
**Subscribed topics:** android/imu ([sensor_msgs/Imu](http://www.ros.org/doc/api/sensor_msgs/html/msg/Imu.html))accelerometer data is published on this topic.
### Usage: After connecting the android device and sparkV robot runroscore
rosrun rosserial_python serial_node.py /dev/ttyUSB0
rosrun sparkV_android android
More on PlaywithRobots
avr-tutorials
- Introduction to AVR microcontrollers
- Basic hardware and software required for AVR
- AVR fuse bits
- Input/Output Concept