View Full Version : Control Panel for PC / Xbee

Robot Dude
09-23-2009, 11:17 AM
Has anyone written a PC app for controlling a bot via xbee. Basically some front end where either a mouse click or some game controller sends commands to the serial port (xbee) to control the bot. If so has the TrendNet camera integrated into the display. Basically a virtual HUD or dashboard... lol Don't want to start from scratch if it's already been done.

09-23-2009, 11:49 AM
I was using Roborealm that grabbed the video from the cam and sent control variables to a python script. The script sent data to the robot and read data back. It then sent the data from the robot to Roborealm giving me the ability to read stuff like battery voltage and display it on a HUD around the image from the cam.

I can post the python script tonight if you think it will be useful.

09-23-2009, 11:51 AM
If your talking about SSC-32 based, I should probably put together an updated version of mechmover and post it this weekend.


09-23-2009, 11:55 AM
I'm probably not the one to answer this, but here goes. Take your pick. I think Mannyr7 used your Visual Sequencer, not sure about the video, but maybe the Trendnet Secure view or something. Manny may have been using Bluetooth though.

Inxfergy had a custom setup done in Python which is in his Tutorial about Issy, and I used RoboRealm in with Bheka.


Robot Dude
09-23-2009, 12:14 PM
Hi all, It's not SSC-32 based. We're using the BRAT with Atom Pro 28 as the main processor. Currently it's using a wireless PS2 controller, so we are changing the PS2 interface code with serial commands that are similar in nature. So we will need to be able to send specific commands from the application to make the robot do stuff. I was mainly interested in knowing if anyone has combined the TrendNet camera screen into an application that incorporated a control method, like a dash board. lol In simplest terms the PC shows a screen with things to click such as walk, turn, shoot, etc. Wrapped around the TrendNet camera screen. I'm no programmer though, so this my not be easy. Thanks...

09-23-2009, 12:14 PM
I did in fact use Python to build a mech control system: PyMech. The code is released under a GPL license. It's split into 3 main files: one for the actual GUI (using PyGame), another for sending commands to the controller from a joystick (using PySerial and an XBEE radio), and a final class that is used for grabbing images from the Trendnet via mjpeg decoding. The Trendnet class is still a little on the slow side, although I got some inspiration the other day during a discussion and I will probably fix the slowest parts shortly (gotta finish some problem sets and presentations for later this week first).

Code for PyMech and Issy has been wrapped into the ArbotiX project, look under /sketches/issy/pymech, http://arbotix.googlecode.com. (http://arbotix.googlecode.com) The issy tutorial is found here: http://forums.trossenrobotics.com/tutorials/build-articles-130/build-your-own-issydunnyet-3257/

Screen Shot:


09-25-2009, 02:45 AM
I've written a HUD for PC to SSC-32 using bluetooth. It's written in VB.Net 2008 Express. I've incorporated the Trendnet video feed using the url form
http://camera_ip:port/view2.cgi?profile=5 substituting your camera's ip address and port (default is 80). No login necessary and the video (mjpg) is loaded in a borderless frame, no trendnet panel visible. Functionally, it sends hard-coded sequences out the comport. The PC sees the bluetooth modem as a serial cable. Easy Peezy! I know, it would be better to store the sequences on the EEPROM and just call up a player on the SSC-32 to execute the stored sequence, but this has fallen on the backburner till now. Think I'll clean it up and make it more configurable at runtime.

It should be easy enough to convert my hard-coded sequences to a BB2 formatted string. As for the Xbee, though, I'm not sure what kind of handshaking or level conversion would be necessary. Haven't had a pair of these to play with yet.

Oh yeah, never found a comprehensible way to incorporate joystick functionality into VB.Net That's probably why I lost interest... I could substitute iPhone control though.


"Comport not found" because my battery for SSC-32 discharged. "serial communications" LED lights up green when connected. Visual damage display at far right will show in 10% hitpoint increments.

09-26-2009, 05:03 PM
I was doing some programing for my android(linux based) phone robot control setup and then I noticed that my phone has netcat! So now this is all it takes for me to pipe keyboard input from my laptop to the serial port of my microcontroller:
Phone:" nc -l 4444 | /dev/tty3 " (listen on port 4444 and pipe any incoming data to the microcontroller serial port. )
Laptop:"nc <phone ip address> 4444" (send stdin to the phone on port 4444)

Does not get much simpler then that.

Getting the video working is trurning out to rather tricky but I will post code if I ever do. Currently I can send the video to the laptop ok, but decoding it is another story. I may end up having to write my own MJPEG codec.

Robot Dude
09-28-2009, 09:08 AM
I've written a HUD for PC to SSC-32 using bluetooth. It's written in VB.Net 2008 Express.

Now that's what I'm talking about! :D If we go this route I will be in touch for some help. Thanks!

09-28-2009, 07:06 PM
I finished it last night. Totally functioning but I would like to create an external settings file to save sequences, camera ip address and comm settings. Right now, its all in the code, so it only works on my machine. Be happy to share though! :cool:

DC Robotic
09-28-2009, 07:14 PM

I have a control panel for a rover, (which looks a lot like Adrenalynn's small serializer based one), that is written in C#.net and has a working Joystick (gamepad) module. The joystick code is base on some code originaly posted by Alex. Trade ya'.

09-28-2009, 07:50 PM
You pulled the mosquito pan and tilt code too, huh? Now that I'm done with Mech Pilot v1, I'd like to port it to C# next. I'll zip the source files together for you.