Anybody figured out the Trutrack position reference system?

49 posts / 0 new
Last post
Tom B
Tom B's picture
Anybody figured out the Trutrack position reference system?

Hi all,

 My goal is to see if the Rovio can be used as a room localization system for other robots.  So, I'm using the CGI call:

 http://192.168.1.71//rev.cgi?Cmd=nav&action=1

 Which returns something like this....

 ------------------

Cmd = nav
responses = 0|x=1374|y=-370|theta=-1.318|room=0|ss=18444
|beacon=0|beacon_x=0|next_room=9|next_room_ss=35
|state=0|resistance=0|sm=15|pp=0|flags=0005
|brightness=4|resolution=3|video_compression=1|frame_rate=20
|privilege=0|user_check=1|speaker_volume=15|mic_volume=15
|wifi_ss=193|show_time=0|ddns_state=0|email_state=0
|battery=113|charging=80|head_position=202|ac_freq=2

--------------------

The X, Y, and theta values show the XY location of rovio and the spin, reletive to the closest beacon signal.

The question is, will it be possible to read these points in a continuous sampling and thus accurately calculate our location in the room.  The Northstar system (from Evolution) has earlier claimed accuracy of as little as 1/4 inch, which is pretty amazing.   Will be interested what accuracy Rovio provides.

First problem I'm running into...  When moving Rovio in a straight fashion, with no spin, I seem to get an accurate XY coordinate mapping to the floor.  HOWEVER the XY coords change completely when the robot is spun even a bit.  Clearly there is some mathematical mojo happening here, some formula that is needed to convert X-Y-Theta into an "absolute" XY spin number for the beacon.  I can't figure it all out.

 How does Rovio follow paths?  What's the path-following process?  Hmmm...

 Anybody have an idea?

RobosapienPet
RobosapienPet's picture
> My goal is to see if the

> My goal is to see if the Rovio can be used as a room localization system for other robots.
BTW: Evolution Robotics sells a developer kit for $1800 USD.
http://www.evolution.com/products/northstar/devbundle.masn
(mini review: http://www.acroname.com/robotics/info/evaluation/northstar/northstar.html#c)

The developer kit includes one Detector ($1400). It handles the detection of the IR, locating the detector in a room, and sending the results via RS232 to your computer (or robot).
The developer kit includes two Projector units ($600 for two) which projects the IR signals to the ceiling.
------
AFAIK in Rovio it has a similar setup (the detector part is in the robot neck, and the projector in the charger base)
The NorthStar system is separate and sends data to the main CPU over a serial port. AFAIK it is not upgradable/hackable, but you can tap into the serial protocol.
Buying a few Rovios and stripping out the detectors may be a lower cost alternative to the $1800 kit (but without any documentation).
=======
> ...will it be possible to read these points in a continuous sampling and thus accurately calculate our location in the room.
Of course, it is easy to do today by simply repeating that URL request and stripping out the numbers (that's what the existing JavaScript does). NOTE: they added one additional value in the 4.09 "BATA" release.

> The Northstar system (from Evolution) has earlier claimed accuracy of as little as 1/4 inch...
(I'll believe that when I see it ;-)

TIP: the x/y/theta numbers can bounce all over the place, especially if you are far from the beacon or have high ceilings. The "ss" signal strength will give you an indication of how reliable the numbers are. Play with Rovio (and beacon) under a table and the accuracy goes up ;->

> How does Rovio follow paths? What's the path-following process? Hmmm...
Also little is known here. I believe the path data is stored in the NorthStar system, but I haven't figured out the details of how it interacts with the motor controllers.

You could figure out more by disassembling the main firmware, including the serial packet interface.
Or wait for the open source version which should at least include the NorthStar interface library (it is statically linked with other GPL code), the way it glues to the webcam/webserver part. The NorthStar system itself is proprietary and patented.

cadcoke4
cadcoke4's picture
I am guessing here, but I

I am guessing here, but I would suspect that Rovio uses both dead reckoning, and updates from the Trutrack system to follow a path.

For example, it might know its location accurately now, and knows it must travel 6ft at a 90deg angle in relation to the base to get to the next waypoint. So, it calculate how many turns it must make of each wheel to get there. Perhaps half way there it checks its current position using Trutrack (I have no idea how frequently it checks its position) and realizes it is 3 inches off course. So, it recalculates a new path and how many wheel rotations are needed to get to its goal.

Joe Dunfee

roschler
roschler's picture
Any physics majors in the

Any physics majors in the bunch? I'd like to know why I can see the infrared beams coming out the TrueTrack beacon as a red glow when I focus my Sony Handycam video recorder on it, but not see the beams reflected on the ceiling. In other words, I understand that my the electronics in my Handycam can see infrared, but why can't the same electronics see the infrared beams projected on to the ceiling?

-roschler

RobosapienPet
RobosapienPet's picture
> I understand that my the

> I understand that my the electronics in my Handycam can see infrared, but why can't the same electronics see the infrared beams projected on to the ceiling?
BTW: This is also true for the built in Rovio camera (OV7670)
It can see regular IR signals (eg: from a TV remote) but can't disambiguate the dots projected on the ceiling.

Tom B
Tom B's picture
Yes, thanks, I know about the

Yes, thanks, I know about the Northstar kit. However my understanding was, the Rovio tech is a "newer" version of the technology. Therefore it made more sense to try to use it. No reason to hack the hardware...the CGI script sends the numbers quite conveniently. Actually in a way the Rovio is an amazingly useful piece of hardware anyway. Take off the wheels, camera, etc, and you have a northstar type position detector hooked to a wireless mini-server that can be queried at any time by other robotic systems. That's a very useful gadget.

The key question, again, is how the X, Y, and theta interact. If the robot is spun in place, the X and Y numbers change radically. Therefore they are not X and Y numbers for the "room" but are some other coordinate system that, I'm guessing, are somehow related to the orientation of the sensor reletive to multiple spots in the beam.

cadcoke4
cadcoke4's picture
Regarding the ability to see

Regarding the ability to see IR with your video recorder; these cameras are not really designed to view infrared, they are primarily visible light cameras. The fact that they can view IR is that their imaging chips happen to also detect IR as well as visible light. This is actually a bad thing for visible light photography because it can cause the image to be "wrong" as compared to what a human would see.

Because of the above, visible light cameras have filters to block the IR light. But, these filters are not perfect, and let some IR light through. As an aside, I know there have been at least one visible light video cameras that had a "nightime" mode where the IR filter is moved out of the light path to allow much better detection of IR light.

The final issue is that when you are focused on a single LED, the amount of IR light the camera recieves to a particular pixel is MUCH greater than when you are looking at the light spread out over a ceiling. Also, the ceiling absorbs some of the IR light and also disperses a lot.

In the end, it could actually be that your camera is detecting the IR light from the ceiling, but that it is so close in brightness to the other light in the room that it doesn't really show enough for you to notice.

Joe Dunfee

milw
milw's picture
Tom B said:

Tom B said:
Yes, thanks, I know about the Northstar kit. However my understanding was, the Rovio tech is a "newer" version of the technology. Therefore it made more sense to try to use it. No reason to hack the hardware...the CGI script sends the numbers quite conveniently. Actually in a way the Rovio is an amazingly useful piece of hardware anyway. Take off the wheels, camera, etc, and you have a northstar type position detector hooked to a wireless mini-server that can be queried at any time by other robotic systems. That's a very useful gadget.
The key question, again, is how the X, Y, and theta interact. If the robot is spun in place, the X and Y numbers change radically. Therefore they are not X and Y numbers for the "room" but are some other coordinate system that, I'm guessing, are somehow related to the orientation of the sensor reletive to multiple spots in the beam.

I was playing with this last night. Theta varies from +Pi to -Pi. When rovio was directly under the center of the beacon 'line' (connecting the two red arrows) and pointed at the base (right angle to the beacon line), theta was ~0.

If you spin the whole Rovio, remember the detector is not at the center of rotation, so it is changing it's XY position. Try rotating it about the sensor position itself. Also, the XY is relative to the brightest beacon, which I suspect means one of the beacon spots is considered 'major'. When you spin it, you're changing the orientation of the detector relative to that spot, so it might make sense that X and Y would change signs? One inch of position change might change the values by several hundred unit... but I've seen the value bounce by up to 1000 units between successive reads. It would be nice to know how many readings Rovio averages, to determine position at any point. 

@RobosapienPet, have you considered hooking a 'scope onto the beacon IR LEDs to see what the signal pattern is?

Tom B
Tom B's picture
Thanks for suggestion Milw,

Thanks for suggestion Milw,

I did try spinning "around detector" as if it were a fixed spot. Im still getting very large (multi-thousand) XY changes. I have to assume that X and Y are changing based on rotation, and that one must convert X and Y in some other coordinate system to come up with "normalized" room X and Y numbers.

The theta seems to be a straightforward and predictable change in pi-pi, as you said. It goes from 0 to 3.14 or -3.14 predictably, that makes perfect sense.

milw
milw's picture
I'm curious, are you directly

I'm curious, are you directly under the spots when you try spinning? I was seeing large variations on succesive reads like you describe, when Rovio was on the base and the spots were projected about 8 feet out from the base. But when I put Rovio on the floor under the spots, the variation was in a few 100s of units. And yes, I guess we don't know if the reported XY values have undergone any preprocessing; they might be just raw instantaneous values off the detectors. I'd like to try plotting a series of reads from the same position to see if the variance is related to signal strength as RobosapienPet suggested. Also move Rovio to marked positions and try to determine the relationship of normalized room XY to the cgi reported XY values.

Oops, forgot to mention, the Evolution Robotics website says the sampling interval is 100 msec...

sevik
sevik's picture
Can somebody post readings

Can somebody post readings for Rovio in one point with different value of theta?

May be several sets for different positions. Something like:

Point 1 (near base)
(12,34,1.4)
(22,44,-1.2)
...

Point 2 (center of room)
(..,..,..)
...

Point 3 (...)
...

Will be better if points are in pattern like this:

 1   2   3

 4   5   6

 7   8   9

3-4 values of theta and corresponding x,y values for each point will be enought :))

I'll try to do some math excersizes with this data :))

milw
milw's picture
working on it... I copied a

working on it... I copied a bunch of readings last night into Excel but didn't break into individual cells. Plz stand by...
under one spot, nose to 2nd spot (X Y theta)
-2436 -56 1.387
-2460 -78 1.387
-2429 -36 1.383
-2429 -36 1.383

rotate 180 degrees
-4254 490 -1.567
-4243 445 -1.555
-4261 446 -1.557
-4239 422 -1.554

under other spot
2484 -633 -1.645
2463 -656 -1.653
2440 -635 -1.641
2492 -644 -1.643

rotate 180 degrees
4170 -991 1.507
4099 -1001 1.501

centered between, nose to base
3 -1515 -0.168
6 -1468 -0.165
54 -1487 -0.161
33 -1377 -0.156

nose away from base
363 30 3.107
363 30 3.107
388 17 3.106
367 -21 3.105

These were done by rotating the entire Rovio, not centered about the sensor unfortunately.

sevik
sevik's picture
Can you do 90 degrees

Can you do 90 degrees rotation for some points too?..

milw
milw's picture
OK, coming soon (someone is

OK, coming soon (someone is blocking

sevik
sevik's picture
You can try to search for

You can try to search for extremums:
1) point with x=0 and y=0 and check behevior of values with rotating and small movements
2) tracks for which x remains 0, and check for theta and y changes
3) tracks for which y remains 0, and check for theta and x changes
4) tracks with constant value of theta (0, pi, pi/2, -pi/2)

May be this tracks/points/behaviors will give you some ideas :))

sevik
sevik's picture
Does web interface has some

Does web interface has some display of current position ?
You can check javascripts for some expressions with sin and cos functions :))

milw
milw's picture
No, the web interface doesn't

No, the web interface doesn't show anything position related, other than the status ("Roaming", "Going Home", "Recording", etc). I'm not sure about the .js, I'll take a look.

RobosapienPet
RobosapienPet's picture
> how the X, Y, and theta

> how the X, Y, and theta interact. If the robot is spun in place...
(and subsequent discussions)
Other tips:
As mentioned, try placing the robot under a table right under the 2 dots of the beacon. The signal strength will be strong, and you can easily move either the robot or beacon and watch the values change.
For rotation, try turning the beacon instead of the robot (ie. if you keep the robot still, and rotate the 2 dots, you will see the 'theta' value exactly match the rotation - ie. the angle of the line between the 2 dots as seen by the robot).
The "x" and "y" units are a little trickier. It takes a little trig. Remember you are seeing how things look from the robot's point of view
Check out this graphic: http://www.evolution.com/images/products/northstar1
Also remember it is a triangulation system, so it can't measure accurate distances on its own (unless you include the ceiling height, or coordinate with the robots motion)
----
> Does web interface has some display of current position ?
No. In the normal webpage, only the "ss" signal strength is used (for the Nav strength).
BTW: The firmware appears to have four "mag" values internally(perhaps magnitude?). I'll look into a way of extracting them.

roschler
roschler's picture
Keep up the good work

Keep up the good work everyone. I'm loving this thread since it involves understanding the Rovio location readings.

milw
milw's picture
Here's my take on things (top

Here's my take on things (top view) with some real values I recorded. The line connecting the beam dots is the X axis, Y is at right angles. 0,0 is a the center of the beam line. Theta is Rovios heading relative to the beamline. Although the readings are relative, I think Rovio should be able to calculate an absolute position after measuring the change in values for a given number of wheel rotations (ignoring slippage, which might be hard to ignore!). In my room, the beam line is about 8' out from the base, and the dots are ~7' apart on the ceiling.

XYTheta readings

sevik
sevik's picture
Looks likely..

Looks likely..

get readings at position 4863,4557 for different values of theta - if they will have the same sign and not too big difference (but due to non-linear transforms of optics/etc it can be not too small :)) ) then this theory will make sense :))

milw
milw's picture
These are the four cardinal

These are the four cardinal directions at one point, starting with Rovio nose ~parallel to beam line, then turning 90 CCW (attmepting to rotate about sensor but variance of position could be ~1-1.5 cm)

x=3171|y=-4782|theta=1.434
x=2467|y=-4642|theta=3.019
x=2410|y=-4710|theta=-1.753
x=2673|y=-5104|theta=-0.164

If you say the beam line is North-south, then theta 3.14 is a Rovio heading of West, 1.57 North, -1.57 South, and 0 or -3.14 is East

sevik
sevik's picture
heh, seems your theory is

heh, seems your theory is correct +- errors from visual effects

Tom B
Tom B's picture
Wow, thanks. What great work

Wow, thanks. What great work!!

I'm a total math retard, and trig is my least favorite. Never could have figured this out :)

So, can anybody tell me a formula that I can plug into Excel that will calculate "absolute" (as in, room reference, not rovio reference) XY positions, if I plug in the rovio XY theta numbers?

For example:

Xroom, Yroom = (formula... Xrovio, Y rovio, theta)

Again, the problem I keep running into is big variations in X and Y even when I make efforts to keep the rovio sensor absolutely central (rotate only, no XY move when I spin the device around). MILW your drawing shows, I think, that the XY should stay the same (+- variance of several hundred counts) if the device is rotated around the sensor as the axis. I'm not getting that, I'm getting big variations...

Or am I misunderestimating?

milw
milw's picture
Tom have you tried averaging

Tom have you tried averaging some readings? I think that's what you're going to have to do, before converting. Also I don't think you need any trig, theta just tells you what direction the Rovio is pointing. The X and Y from Rovio can be converted by scaling and adding an offset; you will need to calibrate the readings you get at the extreme limits of your room to the actual dimensions of your room, and pick how you want to set up the room coordinate system. I can sketch an example and show the setup, you'd have to plug in your room values and units etc to make use of it.

sevik
sevik's picture
milw: What is real scale of

milw: What is real scale of this coordinates in your case? how much units per 1m for example?

Can you make one more table for 15-20 readings in one position with different theta values - so we can see systematic error of measurement depending on theta and behavior of this error...

do you have a flat horizontal ceiling?

error in 600 units seems to be big enought... try to bookmark some point and let rovio navigate to it from different angles - will it stop at the same point or different depending on arrival angle? Does it make some additional movements at arrival for correcting final position?

milw
milw's picture
Yes, my ceiling is flat white

Yes, my ceiling is flat white with some slight sand texture. I want to dig out a turntable so there'll be less positioning error for each rotation. Will report back.

milw
milw's picture
This diagram shows some

This diagram shows some readings and real measurements. Over 4 readings, the SD is ~160 units, at about 53 units per cm, so a bit over 3 cm deviation. In X I got about 135 units per inch or 53 units/cm; in Y about 136 units/inch or 53.5 units/cm. The ceiling is 90.5 inches (229.9 cm) above Rovios detector, and the IR dots ar around 55.5 inches (21.7 cm) apart at a range of 82" (208.3 cm) from Rovios detector when docked.

milw
milw's picture
Unfortunately, using the /rev

Unfortunately, using the /rev.cgi?Cmd=nav&action=1 URL during recording seems to have mucked up the recording; older test recordings still seem to play back with fairly good fidelity (positions of turns within about 6" of recording; camera up/down and headlight on/off play back correctly).

sevik
sevik's picture
Heh, with this resolution (50

Heh, with this resolution (50+ units/cm) errors in 200-300 range is really small and comparable to rovios size.

But measurements using turntable is still interesting of course :))

milw
milw's picture
Here you go Sevik, have fun!

Here you go Sevik, have fun! 10 readings at 8 headings. Eccentricity of the sensor on the turntable is ~2 mm.
Heading 0 degrees (North)
x=-1975|y=-8298|theta=3.131
x=-1834|y=-8257|theta=3.141
x=-1761|y=-8313|theta=-3.131
x=-1942|y=-8249|theta=3.134
x=-1968|y=-8265|theta=3.133
x=-1811|y=-8274|theta=-3.128
x=-1834|y=-8310|theta=-3.141
x=-1792|y=-8289|theta=-3.133
x=-1839|y=-8333|theta=-3.136
x=-1812|y=-8291|theta=-3.132
Heading 90 CW (East)
x=-1692|y=-8091|theta=1.577
x=-1518|y=-8103|theta=1.592
x=-1518|y=-8103|theta=1.592
x=-1600|y=-8087|theta=1.584
x=-1684|y=-8070|theta=1.580
x=-1513|y=-8087|theta=1.588
x=-1561|y=-8060|theta=1.589
x=-1669|y=-8128|theta=1.578
x=-1670|y=-8100|theta=1.577
x=-1538|y=-8089|theta=1.589
Heading 180 (South)
x=-1601|y=-8360|theta=-0.028
x=-1687|y=-8322|theta=-0.045
x=-1486|y=-8306|theta=-0.024
x=-1640|y=-8311|theta=-0.038
x=-1758|y=-8298|theta=-0.054
x=-1492|y=-8293|theta=-0.024
x=-1567|y=-8248|theta=-0.031
x=-1531|y=-8199|theta=-0.025
x=-1560|y=-8296|theta=-0.029
x=-1629|y=-8273|theta=-0.034
Heading 270 (West)
x=-1730|y=-8249|theta=-1.540
x=-1746|y=-8241|theta=-1.538
x=-1590|y=-8264|theta=-1.525
x=-1867|y=-8270|theta=-1.549
x=-1759|y=-8290|theta=-1.542
x=-1611|y=-8234|theta=-1.524
x=-1675|y=-8288|theta=-1.528
x=-1658|y=-8259|theta=-1.535
x=-1618|y=-8240|theta=-1.521
x=-1534|y=-8290|theta=-1.524
Heading 0 (North)
x=-1847|y=-8267|theta=3.114
x=-1851|y=-8301|theta=3.112
x=-1882|y=-8259|theta=3.104
x=-1741|y=-8246|theta=3.120
x=-1859|y=-8317|theta=3.109
x=-1879|y=-8297|theta=3.110
x=-1847|y=-8287|theta=3.108
x=-1861|y=-8299|theta=3.111
x=-1969|y=-8278|theta=3.095
x=-1792|y=-8248|theta=3.118
Heading 45 (NE)
x=-1957|y=-8186|theta=2.333
x=-1822|y=-8131|theta=2.348
x=-1976|y=-8163|theta=2.333
x=-1982|y=-8090|theta=2.330
x=-1746|y=-8081|theta=2.361
x=-1756|y=-8065|theta=2.358
x=-1727|y=-8111|theta=2.361
x=-1902|y=-8093|theta=2.344
x=-1968|y=-8149|theta=2.333
x=-1805|y=-8156|theta=2.352
Heading 135 (SE)
x=-1432|y=-8263|theta=0.807
x=-1528|y=-8231|theta=0.801
x=-1625|y=-8200|theta=0.785
x=-1485|y=-8212|theta=0.802
x=-1480|y=-8130|theta=0.804
x=-1443|y=-8222|theta=0.801
x=-1347|y=-8207|theta=0.809
x=-1455|y=-8170|theta=0.807
x=-1644|y=-8168|theta=0.786
x=-1606|y=-8144|theta=0.791
Heading 225 (SW)
x=-1616|y=-8310|theta=-0.775
x=-1547|y=-8246|theta=-0.774
x=-1520|y=-8243|theta=-0.771
x=-1670|y=-8257|theta=-0.783
x=-1689|y=-8283|theta=-0.785
x=-1612|y=-8207|theta=-0.778
x=-1612|y=-8275|theta=-0.781
x=-1552|y=-8279|theta=-0.776
x=-1729|y=-8232|theta=-0.788
x=-1581|y=-8296|theta=-0.779
Heading 270 (NW)
x=-1671|y=-8409|theta=-2.367
x=-1726|y=-8351|theta=-2.372
x=-1726|y=-8351|theta=-2.372
x=-1622|y=-8295|theta=-2.366
x=-1561|y=-8309|theta=-2.359
x=-1720|y=-8381|theta=-2.373
x=-1608|y=-8361|theta=-2.365
x=-1421|y=-8271|theta=-2.346
x=-1554|y=-8275|theta=-2.366
x=-1745|y=-8321|theta=-2.377

RobosapienPet
RobosapienPet's picture
FWIW: I have a simple little

FWIW: I have a simple little program that draws the X/Y position on the computer screen, and draws a line using the 'theta' value.
http://aibohack.com/rovio/sample1.jpg (moving the robot around the charging station)
It hangs every so often (if I can fix that I'll post it).

IMHO the position info is amazingly good. Simply drawing it on the screen hides the bouncing of the numbers (and it settles quite well on a specific orientation).

milw
milw's picture
Nice job RsP- I hope you can

Nice job RsP- I hope you can fix it, I'd like to see the code. I was thinking it'd be nice to have a script to capture the data automatically from the nav url, cutting and pasting and refreshing is getting a bit tedious!

sevik
sevik's picture
Heh, seems it has much bigger

Heh, seems it has much bigger errors with X values then with Y - because of much bigger dependency on theta measurement quality...

but for docking it really needs only Y, so it has a sense :))

RobosapienPet
RobosapienPet's picture
re: rovtrack (Windows command

re: rovtrack (Windows command line utility with onscreen drawing)
I decreased the polling rate, and it appears to be more robust.
http://aibohack.com/rovio/test_rovtrack1.zip
Run it from the command line:
"rovtrack rovio_ip_address admin_name admin_password"
It will draw directly to the screen (slimy but it is quick-and-dirty)

You should see a little line. If you orient the beacon properly, the little dot should be the front of the rovio. Stronger signals shown in white, normal signals in yellow, poor signals in red. Move around the robot and see the great tracking (even on high ceilings). As you get further away, the tracking falls apart. The screen coordinate scaling is incorrect, but easy to fix if you are interested.
Simple keyboard commands: Q,W,E will drive forward; A,S,D will drive backwards; Z,C spin the rear wheel. These are short spurts only.
Space bar clears the screen.
Exit the program with "." (it will clean up the screen for you). Ctrl+C if the program wedges.

milw
milw's picture
Very nice RsP. I see that Q

Very nice RsP. I see that Q runs the left wheel, it gives the opposite movement of what I expected from the normal keyboard interface, but I got used to it really quickly, and it's easy to remember as matching the wheel positions. Interesting to block one of the beacons too; what conditions make the line indicator be drawn in red?

(and ps what did you write it in?)

RobosapienPet
RobosapienPet's picture
Source is included. You can

Source is included. You can change the keys, add more features, tweek the graphics.
Written in very simple 'printf' style C/C++ with some Windows stuff slapped on.
Can compile with the free version of Visual C++ Express.
Could be re-written in JavaScript relatively easily too, depending on your preference.
----
The signal strength ("ss") is used for the color of the line. I used a high threshold (red line if under 10000). White lines if signal is very strong (eg: under a table).
The regular Rovio webpage uses different thresholds (eg: under 4000 is weak, under 2000 is too low to function).
----
Does it jive with your interpretation of the coordinate system?

milw
milw's picture
Yes, it matches the actual

Yes, it matches the actual motions and orientation quite well. The available space in my room is taking only maybe 1/3rd of the vertical screen height (screen res 1440 x 900). A few of my task bar icons are also rewriting their screen bits, but that's not a big issue. Its nice that on my 2 screen system it is only blanking the main (taskbar) screen- I could drive and read your message on the other screen at the same time!

Source must be the .cpp file then, I wondered what that was...

My Rovio also has the tendency to veer left when trying to drive straight.

RobosapienPet
RobosapienPet's picture
FWIW: It is a quick-and-dirty

FWIW: It is a quick-and-dirty test program.
Someone (not me;-) should integrate the functionality into a main webpage (using JavaScript) alongside the camera image. Give it a proper UI. Show the X/Y on a grid, with a history tracking feature. etc
> My Rovio also has the tendency to veer left when trying to drive straight.
BTW: This is not using the standard drive controls. It is using an (undocumented) feature that pulses the motors for a short time. Use the regular drive features if you want to check the calibration.

milw
milw's picture
RobosapienPet said:

RobosapienPet said:
BTW: This is not using the standard drive controls. It is using an (undocumented) feature that pulses the motors for a short time. Use the regular drive features if you want to check the calibration.

Right, I noticed the pulsing. But I meant in general, using the regular control page to drive it, it still veers left.

Tom B
Tom B's picture
Just to re-visit this topic..

Just to re-visit this topic...

Having used some of the great tools y'all posted here, I am very convinced of Rovios/Trutracks superior room navigation abilities.

Next step is to buy more beacons. Waiting to buy them!!! Each day checking the Wowee store... :)

My hope is that with 2 or 3 beacons in a given room, I can get really high quality localization at a very reasonable price. The original Northstar system I believe used 3 spots per room as a standard, so I have to guess that 2 beacons and the docking station will be ideal for a standard living room.

Right now the accuracy of the localization decreases radically when I get more than 5 feet or so away from a single spot. Hoping with 3 spots and some sampling/statitsics I can cover the whole room with good accuracy.

If that works, then next step is to do 3 rooms with 3 beacons each, and focus on how to "hand off" intelligently between rooms.

Cheers,

TB

LakeRobot
LakeRobot's picture
Hello from Snowy Northern

Hello from Snowy Northern Idaho,

I got a Rovio last week, applied the latest beta firmware (5.007b) and am off to the races.  No major problems yet.

What I decided to do is write a program to display a house map and the current location and orientation of Rovio with reference to a fixed X,Y coordinate system.  That's where the fun began.

Thanks to the posters that figured out the Rovio beacon based coordinate system.  It was most helpful.  What I figured out rapidly is that each beacon has it's own coordinate system depending on orientation and distance to ceiling.  Therefore each beacon has to have it's own transforms to map Beacon X,Y,T to house X,Y,T.  Oh boy.  I'm thinking I might be able to design a set of commands so Rovio and my program could figure out this for each beacon, but for right now I'm doing it by hand.

Here's the structure I use for each beacon.  The program is in Visual Basic / Visual Studio 2008 and I'm using WPF.  Screenshot later:

 

 ' element definitions
    ' First subscript refers to Room ID (0-9)
    '  X Axis RV Direction (+1 normal, -1 Invert)
    ' X Offset (from 0,0 to RoomID Zero)
    ' Y Axis RV Direction (+1 normal, -1 invert)
    ' Y Offset (from 0,0 to to RoomID Zero)
    ' Swap X to Y Axis
    ' Scale


    Public Structure RIDArrayElement
        Dim XAxisRVDirection As Integer
        Dim XOffset As Double
        Dim YAxisRVDirection As Integer
        Dim YOffset As Double
        Dim SwapXY As Boolean
        Dim Scale As Double
    End Structure

   Dim RIDArray(10) As RIDArrayElement

The docking station values are:


   ' Sensor 0 - Charging Station
        RIDArray(0).XAxisRVDirection = -1
        RIDArray(0).XOffset = -4387
        RIDArray(0).YAxisRVDirection = 1
        RIDArray(0).YOffset = 14212
        RIDArray(0).SwapXY = False
        RIDArray(0).Scale = 1.0

FYI here is the coordinate mapping function:

               If RIDArray(RID).SwapXY Then
                    ReturnPoint.X = (RIDArray(RID).XAxisRVDirection * (Y) + RIDArray(RID).XOffset + XOffset) * XScale
                    ReturnPoint.Y = (RIDArray(RID).YAxisRVDirection * (X) - RIDArray(RID).YOffset + YOffset) * YScale
                Else
                    ReturnPoint.X = (RIDArray(RID).XAxisRVDirection * (X) + RIDArray(RID).XOffset + XOffset) * XScale
                    ReturnPoint.Y = (RIDArray(RID).YAxisRVDirection * (Y) - RIDArray(RID).YOffset + YOffset) * YScale
                End If

X,Y Offset and X,Y Scale are the global transforms for the house coordinate system.

I've got a ton of things to do:

1) Add additional beacons (I bought four of them from the wowwee store $20 apiece)
2) Add statistics/filtering to the XYT from Rovio.  It jitters a lot.
3) Add a scheduling queue to run paths, etc. at specific times (send Rovio on patrol!!!)

John

Here's the screenshot:

Tom B
Tom B's picture
John,

John,

Wow! That's great stuff. The funny thing is, I was just sitting down to write line 1 of a program to try to do the same. Yours is perfect, if you don't mind my borrowing your design.

One thing about the multiple transforms for multiple beacons...in my setup it's impossible to ensure that the beacons stay fixed. They might get jumped around or bonked. So doesn't it make sense to have a quick and easy way to calibrate to a beacon. Maybe add a button that makes it easy to calibrate a given beacon, with fields to add the "actual" XYT variables, and probably a date or version tag.

Second issue...what if you want to calibrate 2 beacons while the robot is equally spaced between. It will only display data for the first (the primary). The only solution I can figure out is to physically turn off power to beacon A, calibrate B, then turn A on and B off, calibrate A.

LakeRobot
LakeRobot's picture
Yes, calibrating the beacons

Yes, calibrating the beacons is a pain. Even figuring out the parameters are a pain. I'm thinking of a calibration routine where Rovio is driven to the beacon area, it figures out the zero zero point, then does a series of moves to figure out the coordinate system. Something like:

1) Hand drive to a beacon #

2) Algorithm for finding the beacon coordinate 0,0

3) Align to T of 0

4) Move right a fixed amount (determines the axis orientation and axis Scale)

5) Move back to 0,0

6) Align to T of 0

7) Move forward a fixed amount (determines the other axis orientation - scale should be the same).

This does require you to get to the zero zero point, but with a little thought, I bet I can do it on any fixed point in the beacon range.

Seems simpler than I thought now.

Maybe you could have Rovio do a search pattern to find all the beacons, calibrating them all.

Note: All these algorithms need to be driven by a computer since we can't directly program rovio (yet).

John

LakeRobot
LakeRobot's picture
One of the unanswered

One of the unanswered questions would be how to get the Xoffset and the Yoffset from the beacon to the X,Y zero in house coordinates. It'll be tougher to find that (or the offset to Beacon 0 (dock)) if you know where that is (in X,Y house coordinates)).

John

Tom B
Tom B's picture
Yes, but personally I'm not

Yes, but personally I'm not sure that I could find the 0,0 in the rovio coordinate system. I would probably just pick 2 random points under the main area of the emitter pattern, record both of them, and then compare the delta-rovio and delts-actual measurments for X and Y, and then offsets for X, Y, and theta.

The hardest part in my view is getting the actual XYtheta measurements. I had planned to measure the actual (room) masurements with a measuring tape from a fixed feature of the room, for example from a paint mark on a nearby wall or countertop, which serves as your master referenence point. The tape measures from the exact center of the truetrack sensor to the mark on the wall.

Something else to consider...how do I mearsure the actual theta, the angle that the rovio is, reletive to my reference wall? The rovio has no right-hand angles to line up and measure against!! I'd be tempted to hot glue a small cheapie pencil laser emitter on top, [pointing sideways. When I want to calibrate I turn on the laser and the beam acts as your standard straight line from which to measure that angle. Or a simple straight edge ruler or piece of plastic on top of rovio could serve same purpose.

Speaking of which, did you see that that the Northstar II sensor on top of rovio is *not* the center of rotation that rovio uses in it's calculations? The center of rotation as best as I can see, seems to be the front left wheel. To keep XY unchanged, while rotating theta, you need to spin rovio around the front left wheel. This makes sense from the standpoint of the rovio code, since you have to pick one place on the robot to use as your pivot point, so why not a wheel. So from this perspective, maybe I should measure the XTtheta actual points from the center of the left wheel, not the sensor.

TB

LakeRobot
LakeRobot's picture
Folks,

Folks,

Here are my latest thoughts of the beacon calibration algorithm. I'm not going to be able to start implementing this until Monday. Skiing with the family over the weekend.

1) Establish X,Y House coordinates for Beacon 0 (could make them 0,0 - I just didn't).

2) Drive until you get a strong signal for current beacon

2) Align to T of 0

4) Move right a fixed amount (determines the axis orientation and axis Scale)

5) Align to T of 0

6) Move forward a fixed amount (determines the other axis orientation - scale should be the same).

7) Move to next beacon to be calibrated

8) Note the last current beacon XYT

9) Note the first new beacon XYT

10) Repeat 2-6

11) calculate the "close" XY House coordinate offsets for the NEW beacon based on these two figures and the various scale and axis orientations

12) Head to next beacon (return to 7)

This looks like it should work. Could even be totally automated as a set of paths.

John

bh_5man
bh_5man's picture
Anyone figured out how to

Anyone figured out how to relate data between beacons without a calibration run. Suppose you have a overlap region, is it possible to get data from both beacons and calibrate the position?

denodan
denodan's picture
What am I missing here? had a

What am I missing here? had a Rovio and does not follow a track at all?