WiMo's Garage (Blog)

Visit the
Windows Mobile Blog
Legal mumbo jumbo: The information on this site is provided "AS IS" with no
warranties, and confers no rights.
While I do my best to make sure that all the information is correct and up-to-date,
mistakes do happen. If you think you see a mistake or something that is unclear,
please email me and let me know so that I can fix it.
|
Last Updated: 1.18.07
If you've made it this far, you are interested in seeing the source code that went
into building WiMo. That's great! One of the main purposes of WiMo is
to help provide sample code for the various technologies in Windows Mobile.
Even if you aren't interested in building a robot, I hope that this code helps you
in whatever other project you may be working on. While I will try to comment
the code, I may post the code before I have "cleaned it up" in order to let you
see it earlier rather than later. If you have any questions about the code,
please don't hesitate to email me at wimo@wimobot.com.
Interested in the Wimo APIs? Go check out the new online help section. Or download the help locally
As for the legal mumbo jumbo: This source code is provided "AS IS" with no
warranties, and confers no rights.
I am no longer going to separate the code into separate downloads. It's more
work to package up, and i think it is confusing to have so many zip files.
Source Code
You can find all the files available for download in the new
Download section of the WiMo Garage.
Precompiled
Installs
There are two main parts to wimo. The device code and the MSRS code that runs
on the desktop. I have an install for both of those components if you'd just
like to install them and play with the application and services.
Again, you can find all the files available for download in the new
Download section of the WiMo Garage.
you can deploy the WimoMsrs.msrs via the following command:
dssdeploy /unpack /target:<path> WimoMsrs.msrs
You can choose any path for <path>. You'll be able to run it from there
independently from your MSRS installation directory
To Launch Wimo
- Launch the Wimo application on the device
- Choose the hardware you are running on via the options menu
- Make sure your hardware (Aggressor, NXT, etc) is ready (ex: powered on) to accept
the bluetooth connection from your device
- Choose to listen via TCP or Serial. If you choose TCP, the device will connect
to the Wimo hardware upon a successful TCP connection. If you choose Serial,
it will connect to the hardware right away.
- Launch the MSRS services (either view the wimo.bat in the MSRS directory) or the
WimoUI.msvpl file in the MSRS\VPL\WimoUi director
To launch the MSRS side of things, you have two options right now: load the wimoui.mvpl
file found in MSRS\VPL\WimoUI into the Visual Programming Language tool that comes
with MSRS and then hit F5 (assuming you have built the MSRS projects below).
Or you can manually load the wimoui service from the root of your MSRS install directory
via:
dsshost /port:50000 /tcpport:50001 /dll:bin\services\wimoui.y2006.m07.dll
Project Breakdown
Below is a break down of what the various projects are for in Wimo. Feel free
to grab what you want, even if you aren't building a Wimo.
|
Project
(click for documentation) |
Description |
Wimo.Bluetooth
|
This is basically the
Managed Bluetooth classes |
Wimo.Common

Class Diagram of the Wimo Common APIs |
Wimo.Common contains most of the common classes that are used both on the desktop
as well as the device. You'll
find the main communication classes (WimoNet
and derived), Microcontroller classes (and derived), and Hardware classes.
In this version, i have abstracted the Microcontroller and Hardware into separate
classes so that it is easier to plug in new hardware and not have to change the
main wimo application everywhere. So this also allows the single Wimo binary
to work with all of the Wimo platforms!
Check out the documentation for all of the classes included, but some are:
- SmsTransport.cs: This is the class that is used
to transport data over Sms. Use this class inconjunction with the DesktopSms
class. The DesktopSms class returns objects of SmsTransport when it receives an
sms.
- WimoCommand.cs: General command class used
to tell WiMo to do something. This is used to tell WiMo to move, dance, turn
the camera on, etc. This is what is sent over WiFi currently from the alternate
brain (desktop or ppc) to the smartphone that is on WiMo.
- WiMoNet.cs: This class is used to send and receive
WimoCommands, Text, Xml, and Images. WiMoNet will package up your data and
send it over Tcp or a Serial Port (depending on which WiMoNet you
use). On the other side, you can register for a data received
event.
- Microcontroller classes: The code for the Nxt Brick and variations
of the OOPic
|
|
Wimo.Common.Device |
This is the project that has device specific common code.
- Camera.cs: This is the same class that is posted below. In
my WiMo implementation, the class lives in the WimoShared library. Camera
is a nice C# library that allows you to capture images from the camera (it requires
WimoNative.dll)
- DesktopSms.cs: A class that intercepts messages
that come from the alternate brain (which is ultimately going to be the desktop).
This class is used for transmitting commands via SMS (ex: via Email). Right
now it is only used to initiate the connection.
|
|
Wimo |
This is the main Wimo device-side application.
You can install it using the cab that the WimoSetup project builds.
Once installed, you'll see a Wimo folder in your start menu. |
WimoSetup
|
Device Cab Project that generates the cab to install on your device |
|
WimoNative |
Native Dll for any methods that need to be implemented using native code.
currently, this is only used to call into
DirectShow. the Camera class in
Wimo.Common uses this dll |
|
WimoComm |
This is the main MSRS service at this point. WimoComm does all of the work
to communicate with Wimo.
I have plans to create more services for Wimo, but for now, most of them are included
in this single service. |
|
WimoUi |
This is my Wimo UI MSRS service. This is the UI that is used on the desktop
to control Wimo. it is definitely not the best UI in the world, but it works
for now. I will pretty it up later, but i'd rather get cooler things working
first :)
This service partners with the WimoComm service for all of the communication.
When this service is launched it brings up a dialog asking for a serial port or
ip address. If you enter an ip address (ex: 127.0.0.1 ) it will connect to
Wimo via TCP, if you enter a com port (ex: 7) it will open that com port and attempt
to connect to wimo.
once a connection is made, a fairly blank form will appear. The following
keys will work while that form is in focus:
- Arrow keys: Move Wimo
- Spacebar: Stop Wimo
- V: Toggle Video Mode
- S: Speak (in this version, Wimo will only display the text. He will not speak
it. sorry).
- D: Dance
- Z: (NXT only) will turn wimo a little to the left
- X: (NXT only) will turn wimo a little to the right
|
|
WimoPhotoViewer |
A MSRS service that brings up a form that can show photos that Wimo has taken.
You don't need to use this to play with wimo, but if you start playing with the
services in the Visual Programming Language, you may like to have the form.
For instance, you can hook up the ReplaceCurrentImage notification to the WimoPhotoViewer
and it will display the Image whenever one comes through. |
|
WimoDrive |
A MSRS service that implements the Generic Drive system provided in MSRS.
This service isn't complete and i plan on finishing it later, but figured I'd let
everyone play with it anyway.
currently, wimo doesn't have any type of encoders on its motors, so i just use a
"timed" value for the distance and angles.
I plan on implementing the Motor service as well for Wimo. |
|
|
|
|