Software > Software

TCP/IP Controll!


W00t I had to share this.
This is my robot reporting to a request for a current radial servo scan :

--- Code: ---# D cd
D was input
cd was input
        => W
        => 252 is data_buffer_length told
        => 252 is buffer_length recieved
        => A was the ack part
                @  0 is  600mm -1350deg
                @  1 is  600mm -1305deg
                @  2 is  600mm -1260deg
                @  3 is  158mm -1215deg
                @  4 is   93mm -1170deg
                @  5 is    4mm -1125deg
                @  6 is  600mm -1080deg
                @  7 is  361mm -1035deg
                @  8 is   20mm -990deg
                @  9 is   57mm -945deg
                @ 10 is  322mm -900deg
                @ 11 is  444mm -855deg
                @ 12 is  600mm -810deg
                @ 13 is  536mm -765deg
                @ 14 is   96mm -720deg
                @ 15 is  600mm -675deg
                @ 16 is  600mm -630deg
                @ 17 is  252mm -585deg
                @ 18 is  502mm -540deg
                @ 19 is  265mm -495deg
                @ 20 is  125mm -450deg
                @ 21 is   82mm -450deg
                @ 22 is 3789mm -405deg
                @ 23 is  188mm -360deg
                @ 24 is  436mm -315deg
                @ 25 is  261mm -270deg
                @ 26 is  564mm -225deg
                @ 27 is   55mm -180deg
                @ 28 is 4027mm -135deg
                @ 29 is   26mm  -90deg
                @ 30 is  229mm  -45deg
                @ 31 is 3902mm    0deg
                @ 32 is  574mm   45deg
                @ 33 is  154mm   90deg
                @ 34 is  368mm  135deg
                @ 35 is  533mm  180deg
                @ 36 is 3288mm  225deg
                @ 37 is  389mm  270deg
                @ 38 is   14mm  315deg
                @ 39 is 2148mm  360deg
                @ 40 is  145mm  405deg
                @ 41 is 3977mm  450deg
                @ 42 is  600mm  450deg
                @ 43 is  500mm  495deg
                @ 44 is  600mm  540deg
                @ 45 is   63mm  585deg
                @ 46 is  557mm  630deg
                @ 47 is  185mm  675deg
                @ 48 is  600mm  720deg
                @ 49 is  270mm  765deg
                @ 50 is  170mm  810deg
                @ 51 is  460mm  855deg
                @ 52 is  549mm  900deg
                @ 53 is  299mm  945deg
                @ 54 is  319mm  990deg
                @ 55 is   84mm 1035deg
                @ 56 is   15mm 1080deg
                @ 57 is  600mm 1125deg
                @ 58 is  360mm 1170deg
                @ 59 is  308mm 1215deg
                @ 60 is  471mm 1260deg
                @ 61 is  125mm 1305deg
                @ 62 is  222mm 1350deg

--- End code ---

Incase you are wondering those are actualy deg x 10. Avoid Floating Point to save time yo!
The 4500 and -4500 are repeated because there the side sensors over lap the front sensor.
I havn't quite decided what I want to do about that but......oh works for now...

Best part is that I'm running a threaded server so any process can come in and get information (this is just
one kind of query, you can also ask various other things). And the way I have it set up only one Client
can actualy tell it what to do (turn, speed up, break, reverse, change scanning interval or size).

So you may ask why is this so cool? TCP/IP over bluetooth ;)
ok John H. you can upstage me any time you feel like  :P

Now Jesse, why would you say that?

My ethernet isn't working yet, although its getting there. My brother is working on writing the code for the ATmega128 to talk to the DPAC wifi module.

- Jon

which servo are you using?

are you telling it to move 4.5deg, or is that the resolution of the servo?

what does the mm mean?

im also interested in finding out more about your hardware you are using to get the TCP/IP connection . . .

question questions questions! :P

Right now I'm using a micro servo from e-flight, it's a little jittery but it works ok.

4.5 degs is the about the best resolution I could get out of it. Of course I can tell it to move in smaller increments but this worked out about the best.

mm is measurement in millimeters. Still working out the Acroname conversion so it's a bit unreliable and from 4500 to -4500 it's a combined measurement from a Sharp IR and Max-EZ sonar, where as outside of that it's just Sharp IR. The hardest part about this is you have to spend at least 50milliseconds in each 4.5 degree segment so that the sonar can get a good reading. Means it takes about one second to cross 90 degrees, which is not to great.If I went with just IR I could technicaly trim this down to 32 miliseconds because that is how fast the Sharp IR's update their voltage but since I want good measurements I'm comparing the IR to the Sonar
and comeing up with better representative values.

Some time soon (when I have a tad more money) I'm going to get the Hokuyo range finder because it does a whole scan in 100ms and has an angular resolution of .36 degrees and a linear accuracy of 20mm with a maximum range of 4meters. I'm pinning for it sooo bad. but this works for now and will continue to work for reflex actions once I get the laser range finder.

for computing hardware I'm using a gumstix 400xm-bt and a robostix.
Free RTOS is running on the robostix to do all the automated stuff with the servo (move servo, take measurements, output motor commands, stop if measurements are with in certain distance, take commands from gumstix on i2c.

On the gumstix I I'm still working out some of the serial read bugs, but it's working for the most part. it's just a small threaded server in Linux at the user level. I also had to set up the gumstix to do TCP/IP through the on board bluetooth, which is really quite simple if you are using Linux on your laptop.


[0] Message Index

Go to full version