Evolution of a Blog

This blog has evolved as I have as a maker. It starts at the beginning of my journey where I began to re-tread my tires in the useful lore of micro electronics and the open-source software that can drive them. While building solutions around micro-electronics are still an occasional topic my more recent focus has been on the 3D Printing side of making.

Sunday, November 4, 2012

Remote Control Web Interface for 'Bot

The first phase of my project was to assemble the 'bot, integrate all of it's moving parts with the Arduino, and then with the RPi via my interface library, and control it all with a web based control panel.   In the next phase I will tackle some autonomous tasking but the first phase has been quite the challenge as it stands.   I am nearly there now and have one of the most expensive, yet clunky, remote control 'bots around.

Anyway, here is a screen shot of the web control panel for the 'bot.   I really should have developed this in something like Python and gotten rid of the latency that a web application entails but I did have a rationale.   Namely that as part of my technical education I developed a forms building environment for PHP and that allows me to very easily and quickly deploy a web based application.   So here it is.

Under control of this application my 'bot can now do the following things (though still with a couple areas of improvement):
  1. Move forward or backward at various speeds using the compass to maintain a straight course (tracks do not always pull uniformly).
  2. Throttle forward speed based on nearness to an object being approached as detected by the ultrasonic range finder.
  3. Detect obstacles using the four corner IR sensors and stop the 'bot.
  4. Reverse direction, change course, or stop under command from the web application.
  5. Pan and tilt the sensor stalk at the front of the robot on which the range finder and webcam reside.
  6. Use the range finder to scan the area within the pan range of the sensor stalk.
While doing the above the 'bot will upload images from the webcam, will upload an image created from the scan done with the range finder, all while uploading various status messages and telemetry.   The 'bot will also respond to shutdown and restart commands (the python code runs within a looping shell script that either repeats itself for a restart or exits on shutdown).

My first incarnation of the interface between the 'bot and this web application was to have the 'bot interact using a simple command/response dialog via HTTP.   This doubled the latency for dealing between the controlling app and the 'bot so I implemented a socket based stream for communications.   You still have the latency between wet ware and the web application but commands from the web app, and telemetry back, are done in real time.  This is described here.

The below screen shots show the result of the ultrasonic scan that matches the photo from the screen shot above.  The 'bot is in blue, the darker a return the more confident we are in it's location, and red indicates infinity.    This is a very first attempt at this and has much work to do including accounting for the "cone" of coverage the sensor provides.

A third and final screenshot shows the status log display.

No comments:

Post a Comment