Robosapien PC Control Setup

Here is a sample PC control scheme I made for Robosapien using MainLobby software from Cinemar. The central circular control button cluster controls movement and leaning. The identical circular control button clusters in the top corners control each arm (up, down, in, out, macros that perform all the way up, all the way down, all the way in, all the way out, and a macro that resets the arm to the lowest, furthest in position for walking). The three small buttons that run along the inside curve are macro buttons assignable to whatever I have programmed in Girder. Unlike the Robosapien, Girder places no limit on the number of steps you can put in a macro.

The purpose of this page is to outline a detailed 'how to' on setting up a skinned PC interface to control Robosapien using the USB-UIRT IR transceiver, Girder, and MainLobby.

This information was originally published by me on August 2, 2004 in this thread in the forums at robosapien.tk.

Questions or comments, please email me.

 

Hardware:
USB-UIRT , $50
Robosapien , ~$100 (http://robosapienonline.com)

I used the USB-UIRT as my IR transceiver. I don't think it is the cheapest option, but I had an extra laying around from an HTPC project. The creater, Jon Rhees, hand makes them, provides excellent support, and the device is pretty much custom made to work with Girder. Note that if you are just going to use it with Robosapien the base model will do, but if you also want to use it to learn IR from a lot of stereo and home theater components you need to get the version with the additional 56KHz IR sensor. After you plug in the USB-UIRT for first time, make sure to install the latest drivers from the support section of the website.

Software:
Girder, free to try, $19.99 to register
USB-UIRT plug in for Girder, free
MainLobby, free 30 day trial, $59.99
ML Server, free

Girder is Windows automation software that is very popular with the HTPC crowd. It can be complicated and has a steep learning curve, but in terms of depth of control and raw power it is the best thing out there by far. We are going to use it primarily to learn, organize, and store the IR commands from the Robosapien remote, and then execute them when called by pressing a button in the MainLobby interface. Another extremely useful feature of Girder is the ability to program macros (called 'multigroups' in Girder) with unlimited amounts of steps. We are really only using a fraction of the software's capabilities -- you can also use Girder to control your PC via IR remote, to send and receive serial commands, and a million other things.

MainLobby is made by a company called Cinemar and is designed to be an HTPC front end. It allows you to create a custom graphical user interface (GUI) with buttons that you can set up to launch programs, execute files, trigger events in Girder to send IR commands, and so on. It is entirely skinnable so the sky is the limit in terms of graphics, and the design is accomplished via an easy drop-and-drag interface. For this project I am using the trial version of MainLobby and I just used buttons and a background from the included libraries. It will be fun to design Robosapien-themed setups. ML Server is the MainLobby application used to interact with Girder.

Setup:
So how do we get all these pieces set up and communicating with each other? First thing make sure that the USB-UIRT, Girder, ML Server, and MainLobby are all installed and running on your PC.

Girder setup and configuration:
Go to File -> Settings -> Plugins tab and make sure that the 'Internet Event Server' and 'USB-UIRT driver' plugins are installed (checked). Also make sure that the 'Auto Enable Input device' box is checked. Click 'apply' and then click 'ok'. You should now be back at the main Girder screen, and the light in the bottom right corner should be green (this means the plugins are enabled and operational). If it is not green, try going to File and choose 'Enable Input Device(s)' or hit F9.

Now that the plugins are set up, lets teach Girder a Robosapien command. Go to File -> New. In the large white area on the left, right click and choose 'Add command'. A folder named 'New' and a command named 'New' will be created. Select these and right click to rename them. The folder is what's called a 'group' and is used to organize commands. Let's rename it as 'arm commands' and use it to store all of Robosapien's individual arm movements. Select the command, right click, and rename it to 'R arm in.' While it is still selected, look in the top right and select 'Internet Event Server'. Click on the learn button and and enter an event string, for example 'rarmin'. Notice that underneath the command there is a new item called an 'Event String'. This is the command that Mainlobby will send to trigger Girder to send out the appropriate IR command.

Click 'OK'. Now make sure the 'R arm in' command is still selected and in the bottom right choose the 'Plugins' tab. Select the 'USB-UIRT driver' in the list and then click on 'Settings'. A USB-UIRT driver window will pop up, click on the 'Learn...' button. Another window will now show up and await your the IR signal. Take Robosapien's remote and point it at your USB-UIRT then continue pressing the right arm up button until it learns the command and returns you back to the USB-UIRT driver window. I know that the instructions in the window say to HOLD the button on the remote, but Robosapien's IR isn't a constant signal, it is a burst so you might have to hit the 'Accept Burst' button if it will not fully learn. Now that you are back at the USB-UIRT driver window, point the USB-UIRT at Robosapien and hit the 'Test' button to make sure that the command was learned successfully. If not, relearn it. Also pay attention to the 'Repeat' box. You will want to set this to 1 in most cases, so that Girder only sends the command once (unless you want it to send the IR command multiple times -- for example I have commands set up to move the arm all the way up, all the way down, all the way out and all the way in that utilize the repeat function).

Here is a picture of the main Girder control window:

Here is the USB-UIRT plugin settings window:

Congratulations! Now you have taught Girder the first Robosapien command. Repeat the above steps for each command on the remote, and organize them in groups as you see fit.

One other thing worth mentioning in Girder are 'multigroups'. These are macros -- you can take any girder command you have created, right click on it and copy, and then paste them into multigroups. String together unlimited commands, but keep in mind that you might have to mess around with some more advanced settings to get the timing right when using Robosapien's combination or attitude moves. Don't forget to add an event string for them so you can call them from MainLobby.

Once you have your IR commands learned into Girder, save your file, and then click File-> close window to send Girder into your system tray.

ML Server setup and configuration:
Open up ML Server and make sure that 'MLGirder' is listed in the plugins at the bottom. Open up Windows Explorer and find the file gireventlib.dll (it should be in the folder C:\Program Files\girder) and copy it to your C:\Windows\system32 folder. Alternatively, you can add the file to your path. Select Option on MLServer and choose hide to send ML Server to the system tray.

MainLobby setup and configuration:
With MainLobby open go to the top of the screen to bring up the menu. Select options, and hit the 'Girder' button at the left. Set up both the Girder.exe location and the Internet Event Server (ieventc.exe) location on your hard drive. They should both be in the main Girder directory.

Click on the 'Scene' button on the left. Notice that here is where you choose your background skin, any animated effects, and so on. Click on the 'OK' button in the bottom right to exit the Options screen.

Now move your mouse to the top menu bar, and choose design mode. Click 'Add' to add a button, any button shape will do for now. You can load custom buttons of your own or hit the 'Library' button to choose from those included with MainLobby.

Once you see the button appear on your background, you can drag and drop it wherever you like. Hit the 'Edit' mode button in the top menu bar and click on the button you just created. A screen with tons of options will open up. Here you can customize your button. In the 'MLServeCmd' area at the bottom click on the "A" button. A new window will pop up. From the drop down list in the 'MLServeCmd' Panel choose 'MLGirder' -- this will populate the following statement in the box: 'MLServeCmd.MLGirder|' Add the Event String you created in Girder for a particular Robosapien command to the end of this statement. Using the command we created earlier, the box would read 'MLServeCmd.MLGirder|rarmin'

You can now test it via the test button to ensure it works, or press ok and test it from the button's properties panel. Click 'OK' when finished.

You should now be able to choose 'Launch' from the top menu bar, click on the button you created, and Robosapien should bring his right arm in.

Repeat the above steps in MainLobby for each button you wish to create.

Here is the Mainlobby top menu bar:

Here is the properties window for the button that tells Robosapien to move his right arm in: