Grab the ball

The second step for the TriBot... if you touch the ball stop moving and grab the ball (if you haven't a clue what I'm talking about, read my previous Robotics posts first).

The program is pretty similar to the previous part. If the contact sensor is pressed the DrivePower is set to zero stopping the motor. When adding the GenericDifferentialDrive service to the diagram you'll have to choose the same instance that was used in the first part of the diagram.

At the same time power is set to the GenericMotor controlling the TriBot's arms. In this case the Timer is used to limit the time power is set to the motor, when the arms are closed no further power to the motor is needed.

VPL program to react to generic contact sensor

I must admit that by now TriBot has actually been converted to Spike, but it worked quite well. The only thing I hadn't figured out yet was how to make the program sequential. Using the Lego Mindstorms programming environment a program is sequential by default, meaning that it stops listing to a sensor after there has been input from it once. If you want to keep listing to a sensor you have to make that explicit in your program. The Robotics VPL program works parallel. So it's working just like I programmed it; if there's input from the Sonar it starts driving and if there's input from the Contact sensor it stops and closes the robot's arms.

This behaviour is perfect for Spike... the scorpion. Spike moves forward until you come close, then it starts moving backwards... until you come to close, then it attacks you with its tail (... yes... I know it's Lego... use you imagination... ). So Spike will be the next experiment and this time I'll try the Robotics Studio as well.

Posted by Ilske Verburg | with no comments
Filed under:

Vista on Tosh

After a failure running Vista in beta on my Tosh tablet a few months ago, I decided to try again with the RTM and my first impression is very positive.

The installation did require a BIOS upgrade and the use of some beta drivers, but now it's running smoothly. I'm particularly impressed by the improvement in the handwriting recognition. I'm actually writing this blogpost without having to make to much corrections, a real improvement over the support in XP. And not relevant for posting, but relevant for the day to day use of my tablet; handwriting recognition in Dutch!

The other more "nice to have" feature I love, is the Sidebar with the Gadgets. Currently I'm running the clock (in station clock look, of course), the weather in my favorite places in the world and the little notes page. And I still have some space left, so I'm looking into how to build one myself, it shouldn't be to difficult.

Posted by Ilske Verburg | with no comments
Filed under:

It seems to be my turn

Sunday morning, ready to write a new post, wondering what all this tagging business is about. I shouldn't have looked, not be so curious, then I would never noticed that Pascal tagged me, now it's too late and, I feel obliged to respond...

Curious thing this tagging, getting people to share five items of personal information... On the other hand, I now know that Patrick has become a daddy a few months ago and Erwyn an uncle, congratulations both of you. So here are my five bits of information.

1. I regularly have my nephew (age 6) over for a few days during school holidays, which I enjoy very much. Last week we build Spike together, one of the Lego Mindstorms examples, and programmed it to attack a target (Spike is a scorpion). It seems that my efforts are already paying of, as he wants to be a robot designer (although his dad being an industrial designer might have something to do with it as well).

2. To keep the other half of my brain happy, I usually take some kind of creative course. So I've learned how to make patterns for clothes, glass in lead windows and bronzes. Currently I'm taking a course in jewel making from Ralph Bakker. So far I have created two bracelets and am working on a ring.

3. Before starting my study at the Polytech (HTS) I studied history of the arts for a year at the university in Utrecht. Very interesting, but after a year my brain got bored and I decided that it would be a good idea to study for something which would enable me to earn the cheese as well as the bread.

4. I don't have a car but use public transport to get to work (or wherever else I have to go). And to make it more confusing for everyone, I do have my drivers license. I just like travelling by train; listing to my iPod, reading a book and only having to pay attention to getting out at the right station. And I've been doing this for over ten years... don't worry it's not very contagious.

5. Ok, I do have a motorbike, for fun. It's a Suzuki Savage, a 650cc one cilinder chopper... not too much power but the right sound. Last year it felt terribly neglected as I hardly took it out of the garage... I promised to make up for it this year.

And now ...as far as I could tell, these bloggers haven't been tagged yet; Rene, Rob, Stephan and Mario; good luck guys...

 

Posted by Ilske Verburg | with no comments
Filed under:

See movement... start rolling!

The manifest is ready, so onto recreating the first step of the Lego TriBot example "start driving as soon as you see a movement" using two motors and the ultrasonic sensor.

I first want to try this out using the Visual Programming Language that comes with Robotics Studio but has its own IDE. Using basic activities and Robotics services available on your machine you can visually create a program similar to a dataflow diagram. I will use the generic services which enable you to use the program on a different robot just by changing the manifest that is attached to the diagram.

VPL program to react to generic sonar

The image above shows the first part of the program, starting with the Generic Sonar. The Distance Measurement supplied by the Generic Sonar is used as the value of the variable Distance, this is necessary for the next step, comparing the variable with 30. The documentation is currently not very clear about the units this measurement is in, but based on the reactions of NXT, I guess it is centimetres. If the distance is less than 30, power is set to the Generic Differential Drive, that's the generic service for a two motor configuration used with a left and a right wheel.

Pretty simple... but how do you get to this stage? How do you know about DistanceMeasurement and SetDrivePower?

First there is some basic IntelliSense in the VPL. For instance when you have connected the Generic Sonar to the Calculate activity and explore the properties for the Calculate activity you'll get a pop-up which tells your which data is supplied by the Generic Sonar. Moving over the list will give you some indication of the meaning of the data.

Properties And Intellisense

Second when you connect two activities you'll have to specify a connection and in most cases the connection data. For instance you specify the input for the Generic Differential Drive by connecting the Data activity to the Generic Differential Drive. When you make the connection (or later by right-clicking on the connection) you will be asked to specify the connection by choosing one of the operations available on the Generic Differential Drive. And if the operation takes any parameters you will be asked to specify the data connection by selecting the value supplied by the output activity (in this case the Data activity) to the parameter(s) of the input activity (in this case the Generic Differential Drive). Needless to say that by specifying the same value to the left wheel as to the right wheel the Bot will move straight ahead.

Connections And Data Connections

So most of the information is there when you build the diagram and as a third option there is a help file included (which in version 1.0 is included in Visual Studio, VPL only includes a basic help file) in which the generic services are documented.

By now we have a generic diagram using all generic services. Here's where the manifest comes in again... the manifest will specify on which Bot we want to run this program. The manifest is specified in the properties of the generic services, in this case the MyBot manifest is specified for the Generic Sonar and the Generic Differential Drive by selecting it from the list of available manifests.

Import Manifest

And now we're ready to run... let's go... My Bot needs to be connected by BlueTooth to the machine running Robotics Studio and then I can run the program from the machine. The response is a bit slow sometimes, but when I get close to the "eyes" of My Bot, it starts driving... first step completed.

 

Posted by Ilske Verburg | with no comments
Filed under:

I have a manifest... therefore I exist...

The Robotics environment uses a manifest in which you define your Robot. This manifest basically tells what properties your robot has by defining them as services. Whether your using the Visual Programming Language (more about that later) or Visual Studio, you'll need a manifest.MyBot.JPG

To get started with the Lego stuff, I build the TriBot, one of the samples for the NXT that contains all the sensors. The TriBot is programmed (using the Mindstorms environment) to react to a movement (ultrasonic sensor), start driving (using two motors), stop when it touches a ball (contact sensor), grab the ball (using a third motor), turn around and drive until a black line is crossed (light sensor).My TriBot If I want to recreate this behaviour using Robotics Studio, I'll need a manifest...

The set of examples with Robotics Studio (now 1.0 by the way) comes with a partial definition of the TriBot only using two motors and a touch sensor. Nice, but My Bot has it all... So I created a manifest for My Bot by copying and extending the default manifest. These manifests are located in the samples\Config folder of the Robotics Studio installation.

The manifest already defined the Brick, the differential drive and the touch sensor. I added the Sonar Eyes service by defining the service by specifying the config file and relating it to the Brick. In a similar way I added the Arm service, the third motor to control the arm to grab the ball. The light sensor will follow later... first things first.

MyBot Manifest

Both services also needed a config file. The sonar eyes use the configuration below. Important here is the HardwareIdentifier specifying to which port on the Brick the ultrasonic sensor is attached. Port 4 is also referred to in the default bumper configuration which configures the sonar as a bumper, this configuration needs to be removed to get the sonar eyes to work properly.

SonarEyes Config

The configuration for the Arm is a simple one motor configuration. In this case the motor is attached to port A on the Brick.

Arm Config

My Bot is alive... now onto its first steps...

Posted by Ilske Verburg | with no comments
Filed under:

Making first contact

After exploring the box with the goodies, building the "getting started robot" and installing the Lego visual programming environment (the NXT is targeted at ages 10+), it was time for a test run... The program in the snapshot plays a sound, starts the motor to go forward, makes a turn and plays a sound again... targeted ages 6+... and enough to make sure that my laptop and my Brick were communicating and actually understood each other.

LegoMindstormsNxt Programming Environment  

So this was enough proof for me at this moment and Microsoft Robotics Studio (Nov CTP) was installed... and that of cause is what this is all about. The logical next step is to get the sample working (as we all know manual reading is for when things go wrong)... this required my Tosh to communicate with NXT using Bluetooth... simple... forgetting that my Tosh can have a bit of an attitude... So back to the basics again and making sure that the Bluetooth communication was compliant with the XP SP2 Bluetooth stack (in case you might be interested this article tells you how)... and that's as far as I'm now... Tosh and NXT happily communicating over Bluetooth... to be continued...  

Posted by Ilske Verburg | with no comments
Filed under:

My new Brick has arrived

After weeks of trying to convince myself that investing a new Brick was nonsense if you already owned a Brick, I gave in and ordered one.

Why you might ask... because this one came with servo motors or was it because of the ultrasonic sensor? Meet NXT and see for yourself...

And what does this have to do with .NET... just wait and see...

Posted by Ilske Verburg | with no comments
Filed under:

Preview RSS feed reader for the PocketPC - Alpha 1

The first version of my RSS feed reader for my PocketPC is finished and operational. The user interface is still a bit bold with the larger buttons (instead of a more subtle interface like a pop-up menu or some nice icons) but my must haves are there.  

PocketPC screen with list of blog itemsPocketPC screen with detail item

 

 

I did encounter some strange problems beside the usual limitations of the Compact Framework.

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) should work but gives a strange exception when there is no “Application Data“ folder in the “My Device” root on the PocketPC. I would expect this environment operation to handle this situation in a more elegant way, but for now I just worked around it and created the directory on the emulator based on where it was on my real PocketPC.

The RSS library I used is also able to write the RSS feed to file and does this using "iso-8859-1" encoding. But this encoding is not supported on the PocketPC… knowing that the exception “unsupported operation” is quite logical but it took me a while to figure that one out.

My problem with debugging the application in the emulator was finally solved by building all the projects in the solution again from scratch making sure all were CF projects. Not sure if this really was the problem but at least it solved the debugging issue and normal debugging is a lot easier than the remote debugging option (which in itself works quite well).

So what’s planned for Beta 1? First I’ll have to make it more error proof… quality has clearly not been first on my list. And then some user interface work and then… we’ll see, I hope to add some functionality in the RSS library to make it a little less picky about the XML it does like.

Posted by Ilske Verburg | 1 comment(s)
Filed under:

Figuring out the beta's

While René and Rob are at the PDC collecting the latest "need to knows" about Visual Studio Team System, I'm trying to figure out the beta combinations we can use to install the development environment for the same project Rob mentioned in his blog.

We will be using Visual Studio Team System as well as BizTalk 2006... preferably using VSTS RC1 which came available yesterday. But after downloading the RC1 this morning I'm not so sure anymore. The RC1 uses a different version of SQL Server 2005 CTP... not to much of a problem considering the environment configuration we have planned, BizTalk 2006 uses the VS2005 beta2 development environment... could be overcome although not very practical, but most of all the RC1 release notes mention that SQL should be installed on the same machine on which VSTS is installed... and I'm not sure if this is what I would like.

But first I'll have a look at the new RC1 version to see what the "significant enhancements" are...

Posted by Ilske Verburg | with no comments
Filed under:

It finally works…

…it took some effort but this evening it finally worked.

This morning I first deinstalled VS2005 on my Win2000 machine, better start with a “clean” situation. Removed the rest of the components installed with VS2005 as well and installed everything again. At first the emulators wouldn’t start but after installing the Device Emulator Patch, I could at least start the emulator… first hurdle taken… that was done by the end of the afternoon.

Now getting the emulator connected to the internet through the host machine. As I found out, others had already faced the challenge and had overcome the hurdle. But don’t try to find these solutions using Google, look directly on the VS2005 forums which has a whole section dedicated to emulator problems. I followed some of the tips and tricks I found there, which included getting my emulator connected to my machine using ActiveSync (if you think about it it’s a logical thing because it’s the same way you can connect a real 3D PocketPC to the internet using another host machine) and configuring some connection settings in the emulated PocketPC. I first used the IE on the PocketPC to see whether it worked by just trying to open a webpage… second hurdle taken.

Once I got these first basics in place, I made a really basic application using a library called RSS.NET which contains classes for reading rss feeds into collections. I deployed it on the emulator without any serious deployment errors but I still get the message “The operation could not be completed. Unspecified error”. At first I thought it didn’t work at all, but browsing in the Program Files folder on the emulator, I did find my application… and it worked… third hurdle taken.

This way debugging doesn’t work so that’s one still to overcome, but now at least I can get started…

Posted by Ilske Verburg | with no comments

I had forgotten...

...the challenges you will definitely face when developing applications for a PocketPC. 

As you might have noticed, I don’t do much actual programming anymore working mostly as an architect or analyst. So when some of my colleagues started exploring VS2005, I decided it was time to catch up. A few years ago when the iPAQ was a real high-tech gadget, I build some demo’s using the eMbedded Visual Tools on my first iPAQ. So exploring CF 2.0 and the support for PocketPC development in VS2005 was the obvious choice for me.

Now, three evenings later, I’m starting to remember the challenging nature of PocketPC development. And I’m still trying to get over the first hurdle… getting everything configured and connect properly to be able to run and debug the really complex application “Hello World”. Less than 5 minutes, I hear you Win- or Web-developers think… dream on… device development works on a different time scale.

First I installed VS2005 on my Win2000 “R&D” machine… should be supported according to the system requirements. But my fantastic “HelloWorld”  application won’t deploy on the device emulator… I get the message that the device emulator is not installed?!? Ok… next try… first deploy on my PocketPC… install latest version of ActiveSync (3.8)… won’t deploy… I get the message install latest version of ActiveSync?!!? Search for help… aha… it should be ActiveSync 4.0 beta (here)… why didn’t I think of that immediately. Ok… third time right… device connected… so far so good… deploying… unknown error… ggrrr etcetera.

I give up… at least for now… maybe my legacy operating system is the problem... so I try it again on my work laptop where I use Virtual PC’s for my R&D adventures… XP with VS2005. Now I have an emulator within an emulator… seems to be too much of a good thing… I get IP conflicts when starting the emulator. Search for help… follow configuration instructions found here … it works!!!  But my victory is only short-lived when I read the small print… with this configuration the PocketPC will not be able to access the network resources… so I can’t get the connection to the internet working from the emulator… minor issue you would think… but I want to build an rss feed reader…

Posted by Ilske Verburg | with no comments
Filed under:

It looks cool, but is it enough to be useful?

Last week I took a first look at the modelling features in Visual Studio 2005. A little late... sure... but probably still plenty of time to evaluate these features before the final release ;-)

I started with the class designer and tried to model the information I would like to give to a developer to give her or him a head start. In my opinion that would be a definition of the components and their interfaces. And in addition to that, I would like to give some examples of the interaction between the components. I would generally leave it to the developer to define the classes that are hidden within the component.

As always when code is generated directly within the design/development environment, you'll have to have general idea about how you want your model to be translated into code. So I created the necessary projects within the solution and started defining the interfaces and main implementation class for each interface. So far no sweat, you won't need a three days course to use it. The only thing you'll have to keep in mind is that the project references must be set to use a class from another project in your diagram.

With the basics done, I wanted to model some examples of the interaction between the components I defined. But then I tried to make an interaction diagram to define how the components interact, I ran in to trouble. I just couldn’t find something that looked like an interaction diagram or collaboration diagram. I would expect it somewhere at the solution level because you would need interfaces or classes from several projects to model the interaction between components, but I couldn’t find it.

I actually hope it's a bad case of RTFM on my behalf. If not, then the class designer is a fancy way to make a class diagram. In my opinion even to little information for documentation purposes.

To be continued...

Posted by Ilske Verburg | 1 comment(s)
Filed under: