Brookstone Rover Wireless Spy Tank is a wireless controlled tank. The iPhone or iPad acts as a control panel. Communication takes place directly through a Wi-Fi point created. The device is equipped with a built-in video camera, with which you can monitor others. Also on the device is a microphone and an infrared emitter, for shooting in complete darkness. It feeds a miracle tank of six AA batteries. For owners of devices on Android, there is a RoverOpen implementation and is available for download on the GooglePlay Market at play.google.com/store/apps/details?id=org.almende.roveropen
Recently, the second version of the tanks appeared on the market. They added a couple of improvements. A servo drive has been added, with which the angle of rotation of the camcorder is controlled from the application and the speaker through which you can play sounds. In addition to all of the above, the built-in lights were added to the all-terrain vehicle, whose brightness can also be controlled remotely through the application. For this version of the tank there are official applications in the App Store and on Google Play. ')
Manage from PC
If you do not have an iPhone or an android device, then you are unlikely to acquire such a gadget. But if you really want? What then?
There is such a great software package - EZ-Builder, a tool of a Canadian friend. It already has an exchange protocol with AR Drone Parrot and Brookstone Rover Spy Tank. The program is written in C #. Management is easier than a steam turnip. Download software from here
Installation is simple and does not require a description.
Easy programming on EZ-Script
EZ-Builder has the ability to write simple scripts in common scripting language. He is a bit like a BASIC. EZ-Builder allows you to program the behavior of a toy without being a professional robot builder and software engineer. In the EZ-Script language, you can write simple programs with which you can control our rover. In order to master them and understand the principle, we add a management console to the EZ-Builder desktop: “Script Console”. To do this, just press F3 or select it in the Add Control -> Scripting -> Script Console item.
Let us examine several commands:
Sleep (milliseconds) - Set a pause in milliseconds. Example of a pause for 1 second: Sleep (1000)
SleepRandom (lowMilliSec, highMilliSec) - Pause by a random variable. Example: SleepRandom (1000, 5000)
Forward ([speed], [milliSeconds]) - the command to move forward. Accepts the speed value from 0 to 255 and the engine running time in milliseconds. The default is infinite. Examples: Forward (), Forward (50), Forward (255, 5000)
Reverse ([speed], [milliSeconds]) is the reverse action of the Forward command, i.e. backward movement.
Stop () - to stop.
Left ([speed], [milliSeconds]) - turn left. Accepts the value of speed and time in milliseconds ..
Right ([speed], [milliSeconds]) - turn right
# - comments
: Label - label for the GOTO (LABEL) command. Example:: MyLabel
Goto (label) - go to the label
Return () - exit from GOTO to continue the program
Halt () - stop executing the script
HTTPGet (url) - send a GET request to the specified address
Print (txt) - output text to debug console
Exec (EXE / Bat File, [parameters]) - call an external Windows program
Browser (url) - launch the browser at the specified address
Tweet (message) - send a message to the Twitter.com service. To do this, you need to configure the Tweet module: File-> Twitter Settings. Example: Tweet (“I Love EZ-Robot!”). Example of sending a screenshot from the device's camera to Twitter: ControlCommand (“Camera”, CameraTweet, “Our New Image”)
ControlCommand (windowName, ControlCommandParameter, [values]) - execute the command by referring to the component by its name, where windowName is the name of the window on the EZ-Builder desktop, ControlCommandParameter is the command, [values] are additional optional parameters depending on the calling context.
You can always get help on all teams on special tabs or by calling the appropriate help through:
Help -> Print Script Manual
Learn to follow objects.
In the Tracking Types section, we tick the Color punch. We place a bright object in front of the camera of our device (the best of all is red). Switch to the Color tab, select the minimum object size (Min Object Size) and set the object brightness (Object Brightness). As soon as the item is identified, our tank will begin to turn in his direction if we try to move it. I would advise in the settings in the Tracking Quadrant Settings section to move the vertical lines a little closer to the edge so that the robot reacts more adequately to the movement of the object. Further, playing with different parameters, you will be able to independently achieve the necessary settings and optimal values.
Simple program
Now, aggregating the received information, we connect everything together. Add the Script Manager component to the EZ-Builder desktop: Ad Control -> Scripting -> EZ-Script Manager. In the window that opens, click the Add Script button. In the Name field we write: PursuitTarget. This will be the name of our program responsible for the movement. It will be very simple and consist of one line. In general, it must be said that in EZ-Builder all components are interconnected by the names of windows and script names. We write the program as follows:
forward(255)
We only need this in order to set the forward speed to the maximum, since we will reduce it in the target search program. Press Add Script again, in the Name field we write: FindTarget and, accordingly, the program text itself:
Now click the Config button on the Camera panel, go to the Scripts tab and in the Tracking Scripts section in the Tracking Start field we write the call to our PursuitTarget script:
Go to the Tracking Settings tab in the Movement Tracking section and tick the appropriate box. Also tick off the inscription Allow Left / Right Movement. We save. Click Refresh Device List, select Video Device: Brookstone_Rover, put a tick on Debug and on Color. Go to the Color tab and set the size and brightness of the pursued object. Now it is enough to throw a red ball in front of the “nose” of our terminator, as he immediately recognizes it and activates. After which he will begin his pursuit. As soon as the robot will bump into it, the ball will most likely be rolled to the side. The robot will turn in his strontium, and if he loses sight of him at all, he will begin to move back, turning from side to side and trying to find the intended goal.
Programming AR Drone Parrot
It is no different. Only engine start and landing commands are added.
What's next?
In the next article, there is a desire to describe an example of working on C #, while fastening a laser flashlight and converting it into a laser rangefinder with a webcam.
PS: Thanks to icases.ru for the kindly provided gadgets for testing