Author Topic: how to make a GUI for robots?  (Read 25396 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
how to make a GUI for robots?
« on: January 27, 2009, 09:52:38 PM »
I'm considering making a GUI for my ERP (that uses the Axon). Hyperterminal is getting out of date for me . . .

Basically I want a GUI that displays all the sensor data being sent over by USB. Also the ability to control servos from the GUI.

Something like this:


I have no problem doing it from the Axon side, but not quite sure how to do it on the PC side. I guess I should use Visual Basic? Anyone know of source that basically does this already that I can reverse engineer? It just needs to send/receive UART data, and look pretty. :P

Or perhaps anyone willing to write a tutorial? <cough>

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #1 on: January 28, 2009, 12:51:48 AM »
Is this something that people usually want? Here's my proposition, I can do this over the weekend (well... I can do the PC part over the weekend, not sure about the MCU part  ;D )
How about a generic application that allows one to select an COM port and takes it's input formating from an tiny script.

Script example:
<code>
Sensor {
  Name="Pitch";
  Type="Linear" min=0 max=255;
  Prefix="01";
}
Sensor {
  Name="Roll";
  Type="Linear" min=0 max=255;
  Prefix="02";
}
</code>

The MCU should send data from the sensors using an simple format. I'm thinking of the configurable text (configured in the script using "Prefix") immediately followed by the result from the sensor. Because it's configurable it would work for anyone's robot and it would not require too much programming experience.

Something similar should be done for the other way around communication (PC to MCU). How does this look?

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #2 on: January 28, 2009, 01:21:22 AM »
Quote
I can do this over the weekend (well... I can do the PC part over the weekend, not sure about the MCU part)
Do you have an Axon? If so, just upload the axon_DAQ.hex and the MCU part is done. It outputs all 16 ADC as a constant data stream.


Quote
The MCU should send data from the sensors using an simple format. I'm thinking of the configurable text (configured in the script using "Prefix") immediately followed by the result from the sensor. Because it's configurable it would work for anyone's robot and it would not require too much programming experience.
I completely agree. The easier it is for someone else to reconfigure the better.

Also, you wouldn't by any chance know how to create a time graph from data? For example, if I wanted to plot sensor output vs time in realtime, etc.

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #3 on: January 28, 2009, 03:17:58 AM »
Quote
I can do this over the weekend (well... I can do the PC part over the weekend, not sure about the MCU part)
Do you have an Axon? If so, just upload the axon_DAQ.hex and the MCU part is done. It outputs all 16 ADC as a constant data stream.

Sorry, I don't have an Axon :(
Can you give me a sample dump as received from the Axon running the axon_DAQ program?

Quote
Quote
The MCU should send data from the sensors using an simple format. I'm thinking of the configurable text (configured in the script using "Prefix") immediately followed by the result from the sensor. Because it's configurable it would work for anyone's robot and it would not require too much programming experience.
I completely agree. The easier it is for someone else to reconfigure the better.

Also, you wouldn't by any chance know how to create a time graph from data? For example, if I wanted to plot sensor output vs time in realtime, etc.

I'll do that too.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #4 on: January 28, 2009, 04:18:31 AM »
Quote
Can you give me a sample dump as received from the Axon running the axon_DAQ program?
Its really just a data dump if anything. Basically 16 sensors, 8 bit, with a carriage return at the end after each print out data. Here is an example of sensors with static data:

12 44 255 0 87 23 129 221 76 8 187 12 44 255 0 0
12 44 255 0 87 23 129 221 76 8 187 12 44 255 0 0
12 44 255 0 87 23 129 221 76 8 187 12 44 255 0 0
12 44 255 0 87 23 129 221 76 8 187 12 44 255 0 0

Oh, and perhaps take the clock from the PC to add real time? The mcu time is always off by some small % that just keeps building up.

Also, perhaps baud rate detection and/or selection? By default its 115200bps.

Offline yerbie

  • Full Member
  • ***
  • Posts: 62
  • Helpful? 3
Re: how to make a GUI for robots?
« Reply #5 on: January 28, 2009, 07:56:25 AM »
hmm, very interesting task.  i'll start working on it and see what i'll come up with :)

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: how to make a GUI for robots?
« Reply #6 on: January 28, 2009, 08:59:19 AM »
I've made GUI programs before for some of my projects. I've used Visual Basic 6 ( classic :P )and had no problems at all doing it.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #7 on: January 28, 2009, 10:01:00 AM »
The interesting part is making the GUI easily configurable so that Average Joe can take advantage of it without doing any GUI programming. This brings into discussion all sort of interesting things, like auto-detecting COM port and port configuration.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #8 on: January 28, 2009, 10:48:27 AM »
Quote
This brings into discussion all sort of interesting things, like auto-detecting COM port and port configuration.
I think ideally it should be kept really simple for the first version, and worry about feature creep after it works :P

airman00, feel free to share more info about your VB source :P
http://www.societyofrobots.com/member_tutorials/node/170
http://www.instructables.com/files/orig/F01/57FK/FIHVKCYW/F0157FKFIHVKCYW.zip

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: how to make a GUI for robots?
« Reply #9 on: January 28, 2009, 11:29:05 AM »
airman00, feel free to share more info about your VB source :P
http://www.societyofrobots.com/member_tutorials/node/170
http://www.instructables.com/files/orig/F01/57FK/FIHVKCYW/F0157FKFIHVKCYW.zip

I don't really consider that too much of a GUI

This program however is a GUI - http://i273.photobucket.com/albums/jj202/erobot/Fx/Picture22-1.png 
Its for one of my projects ( admin I think you know which one )
Graphics were done by my friend Eli - www.photography.narobo.com  . I just did all the coding and stuff like that.

As for source code - the butler robot source code is released online, but I can't reveal any source code for that other GUI program.
Its very easy - just make buttons , labels, pictures, etc. and just update them in your program. Visual Basic is very very easy to learn and extremely useful. I use it to make all kinds of programs ( even the Servo Calculator Program )
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #10 on: January 28, 2009, 02:49:58 PM »
I've done an quick test/demo. Unfortunately I can't test it in any kind of realistic conditions: I'm working over Remote Desktop on a remote computer, I don't have serial ports available so I'm using an "Virtual Serial Port" that creates two virtual ports and links them with an virtual "Null Modem Cable". I obviously have no Axon to test with so I simply made an other application that sent data to the other COM port (remember there are two virtual ports linked by an virtual cable).

This "alpha-quality" application can be downloaded here: http://stoiadan.ro/portdump.zip
For those that don't want to test alpha-quality I'm attaching a picture here in the forum.

Offline Tomas

  • Full Member
  • ***
  • Posts: 111
  • Helpful? 0
Re: how to make a GUI for robots?
« Reply #11 on: January 28, 2009, 03:45:26 PM »
I know we have a program at our university that is very, very easy to create these GUI for microcontrollers. It reads values straight off the COM port, and it has a neat and easy graphical interface to create sliders, buttons, graphs and such. I'll see if its easily usable with the axon tomorrow, and learn what the name of the app is again. I used it just a little bit last year, so I forgot.

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: how to make a GUI for robots?
« Reply #12 on: January 28, 2009, 08:16:18 PM »
I think you should create something flexible, so each user can enter the data format.
There won't be major differences between the formats on the long term, mostly everybody outputs the values raw from the memory - but to make it good, the trick will let them be to configure this order, and how to display them.

You could also add 'special' type of variables, for example the pitch-yaw-roll or acceleration could be displayed on an opengl type of thingy, in 3D, or proximity stuff as transparent/less transparent walls around a crude model (box, circle?)
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #13 on: January 28, 2009, 08:29:45 PM »
cosminprund, it doesn't work. It seems to be connecting to the com port properly though because it gives me an error if I try to use Hyperterminal at the same time. It also detects the com port correctly. But no data gets displayed.

Tomas, probably LabView? Horrible software . . .

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #14 on: January 28, 2009, 09:01:39 PM »
cosminprund, turns out I'm a moron . . . the DAQ prints out 18 values, where the last two represent the timer. Could that be why it didn't work?

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #15 on: January 28, 2009, 09:36:41 PM »
I just found this:
http://www.andreavb.com/forum/database/index.php?action=showmod&mod=182

Quote
This program shows how to connect to a GPS receiver (wired or bluetooth via SPP outgoing connection) and decode GSV, GSA and GGA sentences of NMEA protocol, display position coordinates and satellite informations such as signal strength, satellite ID and satellites used for fix


Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #16 on: January 29, 2009, 12:23:54 AM »
cosminprund, turns out I'm a moron . . . the DAQ prints out 18 values, where the last two represent the timer. Could that be why it didn't work?

Yes and now. The program expects 16 values per line. If it doesn't get exactly 16 values per line it doesn't update the progress bars.
On the other hand if you go to the "Bulk data" page where the big black screen is, *any* data received on the serial port should be displayed.
If you don't see anything on the "Bulk data" page then it's bad... I'll need to do some tests with some real serial connection, preferably a MCU connection.

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #17 on: January 29, 2009, 12:32:35 AM »
I think you should create something flexible, so each user can enter the data format.
There won't be major differences between the formats on the long term, mostly everybody outputs the values raw from the memory - but to make it good, the trick will let them be to configure this order, and how to display them.

You could also add 'special' type of variables, for example the pitch-yaw-roll or acceleration could be displayed on an opengl type of thingy, in 3D, or proximity stuff as transparent/less transparent walls around a crude model (box, circle?)

I've done the thing in a highly flexible way. The 16-value DAQ is not what I want to use so I'll add flexibility. I also want it to work the other way around (send data to the MCU). I don't want to deal with 3D stuff and complex visualizations for now, nor will I bother with very complex input GUI's - I just want the thing to work, be modular. Next I'll add in the ability to create visualizations and input-modules as plugin modules that may be written in any programming language.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #18 on: January 29, 2009, 12:48:42 AM »
Quote
If you don't see anything on the "Bulk data" page then it's bad... I'll need to do some tests with some real serial connection, preferably a MCU connection.
Nothing is displayed at all, not even on the Bulk data page . . .


Quote
I've done the thing in a highly flexible way. The 16-value DAQ is not what I want to use so I'll add flexibility. I also want it to work the other way around (send data to the MCU). I don't want to deal with 3D stuff and complex visualizations for now, nor will I bother with very complex input GUI's - I just want the thing to work, be modular. Next I'll add in the ability to create visualizations and input-modules as plugin modules that may be written in any programming language.
As long as the bare basics are there, it's enough for others to reverse engineer and add on to it. Having something to start with definitely helps!

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #19 on: January 29, 2009, 02:01:57 AM »
Nothing is displayed at all, not even on the Bulk data page . . .

Ouch, that's bad. I'll give it a shot tonight at home, with a null-modem cable between an "real" COM port and an USB adapter COM port, see what happens. I only tested with an simulated serial cable that provides full handshake and flow control, so there might be an issue with that! Do you know if the Axon provides flow control and handshake?

In the worst cace scenario I'll wait for my Axon (I ordered one last night) so I'd be able to test with the real thing. But with the way Romania's parcel service works it might be a full month before I actually get the Axon! Even if it only takes 10 days for a packet to make it from USA to my home town :(

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #20 on: January 29, 2009, 03:31:25 AM »
Quote
Do you know if the Axon provides flow control and handshake?
To my knowledge, no. But not entirely sure what the USB drivers do. Trying turning that stuff off, plus account for 18 values instead of 16, and I'll try it again.

I'm currently struggling to install VB. Worst installer ever. It keeps crashing, giving strange errors, horrible download speeds, and forces you to install MySQL Server, all for a mere ~860mb! I'm now waiting for the ~240mb .NET Framework to download. I'm amazed at how an IDE + compiler takes up as much memory as a movie . . . :'(

Quote
But with the way Romania's parcel service works it might be a full month before I actually get the Axon! Even if it only takes 10 days for a packet to make it from USA to my home town
I live in Thailand and I know exactly how you feel. Except here you have to bribe the mailman occasionally or your mail might get 'lost'. And thats assuming a bunch of protesters don't shut down the airport blocking all international mail :P

I saw your order, and it'll go out next week (my next shipping cycle).

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #21 on: January 29, 2009, 04:24:07 AM »
To my knowledge, no. But not entirely sure what the USB drivers do. Trying turning that stuff off, plus account for 18 values instead of 16, and I'll try it again.

I'm pretty sure it's a problem with flow control. With my two applications talking to one another over the serial line I never get good speed! But if one end of the connection happens to be an HyperTerminal everything simply flyes! This leads me to believe it's a problem with software flow control, there's something I'm supposed to do and I'm not doing (and HyperTerminal does it).

Quote
I live in Thailand and I know exactly how you feel. Except here you have to bribe the mailman occasionally or your mail might get 'lost'. And thats assuming a bunch of protesters don't shut down the airport blocking all international mail :P

So you called them "protesters"? That's a interesting twist, they're called terrorists here in Romania. Is this Europe's double-standards at work again? I remamber I wanted to travel to Paris last year for a Firebird conference and there were strikes all over the place in France, they basically shut down the whole country! But no one called them terrorists...

paulstreats

  • Guest
Re: how to make a GUI for robots?
« Reply #22 on: January 29, 2009, 05:46:59 AM »
Just adding a bit of input to this....

 I would try and use name - value pairs like cgi scripts do. If the axon could send first a name such as IR then a control charater like | then the value say 6 then another control character | You can then interpret this.
so the axon would be sending a string like this:       IR|6|        (obviously in hex)
If you have a bar graph type gui then each bar can be configured to a name. So have a text box next to each bar If you type IR into the text box then it will look for any data with the value IR then update itself with the data after the control character |

Offline reSpawn

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 0
Re: how to make a GUI for robots?
« Reply #23 on: January 29, 2009, 03:09:29 PM »
on what OS it has to work?

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #24 on: January 29, 2009, 08:11:01 PM »
My understanding is that there is a mod to get VB to work with Java, meaning it can run on Linux. I haven't really looked into it.

But Windows is the priority, as 95% of you guys use Windows ;D

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #25 on: January 30, 2009, 04:13:31 AM »
I've got a new version; This time I'm exposing every single configuration option possible, but I haven't managed to test it on my real hardware com port because... well... I forgot to buy the nullmodem cable :(

The ZIP file is here: http://stoiadan.ro/portdump.zip

It now accepts anything from 16 to 18 decimal values per line.

I've also included in the ZIP file my "demogen" application, the one that sends test values to the port (simulates what would come from the "DAQ" program on the Axon) - I made that application to test the first one without actually having an Axon :)

Please someone confirm this is working with an real MCU so I can move on. The next thing on my list is making this configurable so it can be adapted to any kind of MCU output (the 18-values-per-line format is not particularly usefull in an working robot).

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #26 on: January 30, 2009, 06:40:28 AM »
Apparently we have a problem with our network connections at the office, the link I posted doesn't seem to work  :-X
Here's an alternate location:

https://activari2.sediu.ro/portdump.zip

(that's a HTTPS link, click on it as-is, don't change it to HTTP!)

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #27 on: January 30, 2009, 08:47:13 AM »
Arghh. The corect second link is:
https://activari2.sediu.ro:442/portdump.zip

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: how to make a GUI for robots?
« Reply #28 on: January 30, 2009, 11:13:11 AM »
I wish I was better at Java programming :( I got to learn that 'swing' library so I can make Java GUIs

paulstreats

  • Guest
Re: how to make a GUI for robots?
« Reply #29 on: January 31, 2009, 11:04:33 AM »
Quote
I wish I was better at Java programming  I got to learn that 'swing' library so I can make Java GUIs

The gui's arent the problem in java for this issue...

The problem is that Sun removed their comm api for windows and everything else apart from solaris x86 and some high level linux type meaning that there is no support for serial communications.....

(I still have an old version of the comm api and libraries so im gonna see if it works with my xp system, if so i might release a simple terminal program for other people to test on their systems).


 


Get Your Ad Here