Back
[00:04:51] <rue_house> hmm, I wonder if sorting the points would actually help
[00:05:00] <rue_house> I dont think so
[00:07:07] <rue_house> hmm which rule is that...
[00:07:55] <rue_house> cosine law
[00:08:40] <rue_house> I'm gonna try longest circumcrence
[00:09:57] <rue_house> so, all the radii are the smae
[00:10:13] <rue_house> c^2 = a^2 + b^2 - 2ABcos(t)
[00:10:15] <rue_house> a = b
[00:10:31] <rue_house> c^2 = a^2 + a^2 - 2aacos(t)
[00:10:48] <rue_house> c^2 = 2a^2 - 2a^2cos(t)
[00:11:19] <rue_house> c^2 = 2a^2(1-cos(t))
[00:11:28] <rue_house> a is a constant
[00:11:46] <rue_house> c^2/2a^2 = 1-cos(t)
[00:11:50] <rue_house> 1 is a constant
[00:12:06] <rue_house> 1+c^2/2a^2 = cos(t)
[00:12:23] <rue_house> er, wait, I want c..
[00:12:40] <rue_house> BUT
[00:13:00] <rue_house> is looks like if I just look for the highest cos(t), I'm good
[00:13:22] <rue_house> the phase dosn't matter
[00:13:33] <rue_house> isn't 1-cos(t) = sin(t)?
[00:13:46] <rue_house> no
[00:13:53] <rue_house> its a veritcal displacement
[00:26:05] <rue_house> ooo that might be it
[00:26:33] <rue_house> some of these I'm not sure of tho
[00:27:50] <rue_house> hmm there is a fail
[00:28:40] <Jak_o_Shadows> Could you just do the biggest distance between points?
[00:28:46] <Jak_o_Shadows> Convert to cartesian space?
[00:28:58] <Jak_o_Shadows> By biggest distance, I mean closest distance to 120 degrees
[00:29:38] <rue_house> thats kinda what i was doing, I use the angles to work out the chord lengths and then look for the triangle with the largest sum of chords
[00:29:52] <rue_house> it works better than most things yet
[00:32:31] <rue_house> 1-cos(t) makes sense
[00:32:37] <rue_house> a) its always postiive,
[00:32:45] <rue_house> b) its symmetrical around 0
[00:32:50] <rue_house> so + or - angles dont matter
[00:33:21] <rue_house> but the answer isn't it the sum of the sides
[00:34:33] <rue_house> if the robot is within the beacons, the angles to them will alwyas total 360
[00:34:46] <rue_house> all the problems relate to the robot moving outside them
[00:35:02] <Jak_o_Shadows> I'd be very tempted to sorta renormalise based on what one I'm looking at. BVut I will look at it in more detail in a cuple of months
[00:35:29] <rue_house> then the sum of the angles starts to come down
[00:36:17] <rue_house> and things like beacons at the same angle start to cause flat triangles
[00:36:50] <rue_house> so this is where I should be looking at area and not circumfrence
[00:37:11] <Jak_o_Shadows> great circle distances maybe?
[00:37:56] <rue_house> all we know is the angle to the beacons, so in this, I'm placing points at equal radii from the robot at those angles
[00:38:02] <mrdata> rue_house, did you see anonnumberanon 's code for finding the right 3 beacons?
[00:38:09] <rue_house> didn't work
[00:38:14] <anonnumberanon> okay im back
[00:38:19] <rue_house> suffers from the same problems mine did
[00:38:27] <mrdata> what problems
[00:38:41] <Jak_o_Shadows> Yup, equal radii makes sense.
[00:38:42] <rue_house> <rue_house> float angles[] = {340.000000, 322.000000, 89.000000, 11.000000, 308.000000, 89.000000, 102.000000, 68.000000, };
[00:38:42] <rue_house> <rue_house>
http://ruemohr.org/~ircjunk/images/anon.png
[00:38:45] <anonnumberanon> so i put 90, 210 and 330 in the list of eight and it returned those angles as the best
[00:38:52] <anonnumberanon> lemme try that set rue_house
[00:39:05] <rue_house> look at the graph, its a fail
[00:39:08] * anonnumberanon needs to turn on dev computer
[00:39:24] <rue_house> my test program runs random data
[00:39:36] <rue_house> sdl, next frame on mouse click
[00:39:40] <rue_house> want?
[00:39:47] <anonnumberanon> yes ofc
[00:39:51] <anonnumberanon> brb
[00:40:07] <anonnumberanon> be back in 10 plus gotta turn on my dev comp
[00:40:11] <mrdata> rue_house, what are we looking at in that graph?
[00:40:32] <Jak_o_Shadows> Problem with cartesian lengths is that it works best for angles that result in points close to each other
[00:40:40] <mrdata> are each of the points beacons?
[00:40:57] <mrdata> i only see 7 of them
[00:42:03] <rue_house> http://ruemohr.org/~ircjunk/programming/beacon.tgz
[00:42:12] <rue_house> two are in the same spot
[00:42:19] <rue_house> mrdata, so the + is the robot
[00:42:30] <rue_house> it knows the angle to a number of poistioning beacons
[00:42:36] <mrdata> ok
[00:42:44] <rue_house> the challange is to find the best 3 to use for triangulation
[00:42:52] <mrdata> you said there ar 8 beacons; i only see 7
[00:43:02] <rue_house> which is an alg none of us have solved right yet
[00:43:05] <mrdata> rue_house, and what is the blue line?
[00:43:10] <rue_house> yea, two of them are at the same point
[00:43:24] <rue_house> the lines are the set that the code chose
[00:43:44] <rue_house> its just done as r, g, b, so they can be identified
[00:44:03] <rue_house> the circles show the angle around the robot of a beacon
[00:44:28] <rue_house> there can be any number of beacons, 8 is "crazy lots"
[00:44:46] <rue_house> so code that can handle between 4 and 8 is fine
[00:45:16] <rue_house> (3 is like, pre-solved :) )
[00:46:25] <rue_house> mrdata, does the problem make sense?
[00:46:29] <mrdata> the code chose the ones closest together??!?
[00:46:37] <mrdata> thats wrong
[00:46:45] <rue_house> well, it screwed up with that instance of data
[00:46:49] <rue_house> mine so far has too
[00:47:01] <rue_house> MOST of the solutions are fine
[00:47:15] <rue_house> but you get into glitches when the beacons are not AROUND the robot
[00:47:37] <rue_house> if they are all clustered to one side, our codes seems to screws upie
[00:48:30] <mrdata> anonnumberanon, which points does your code pick?
[00:48:34] <mrdata> in this example
[00:48:36] <rue_house> the first idea was that one could select the beacons that have angles closest to +120 and -120 degrees of a given beacon
[00:48:49] <rue_house> it chose the 3 with the lines between them
[00:48:59] <rue_house> the lines show the chosen beacons
[00:49:45] <rue_house> my current code calculates the length of each side, and looks for the solution with the longest sum of sides, which is also a really close answer
[00:50:18] <mrdata> bbiab
[00:50:35] <rue_house> most often is picks a good set
[00:50:53] <rue_house> but then I get a dup beacon position and it goes to hell
[00:51:28] <anonnumberanon> im about to test it mrdata hang on
[00:53:25] <rue_house> http://ctrlv.in/856445
[00:53:37] <rue_house> right now, mine cakcs on duplicate points
[00:55:28] <anonnumberanon> the best combination of angle (there may be more equally as good is: 340.000000 322.000000 89.000000
[00:56:02] <rue_house> can you get the code to find it tho
[00:56:17] <anonnumberanon> this is made by my code
[00:56:23] <anonnumberanon> check those angles
[00:56:32] <rue_house> ? you saw the image
[00:56:37] <anonnumberanon> no
[00:56:44] <anonnumberanon> well, yeah
[00:56:49] <rue_house> wrong points
[00:56:50] <anonnumberanon> the last one you posted?
[00:57:02] <rue_house> <rue_house> <rue_house> float angles[] = {340.000000, 322.000000, 89.000000, 11.000000, 308.000000, 89.000000, 102.000000, 68.000000, };
[00:57:03] <rue_house> <rue_house> <rue_house>
http://ruemohr.org/~ircjunk/images/anon.png
[00:57:18] <rue_house> that image is the points your code chose
[00:57:46] <anonnumberanon> But these are not the same points that you had earlier.
[00:57:51] <mrdata> no
[00:57:52] <mrdata> it isnt
[00:57:54] <rue_house> in the tgz file I posted, the anon.c is your code, adjusted for the SDL
[00:58:05] <rue_house> anonnumberanon, the points are random
[00:58:26] <rue_house> the code needs to find the best points no matter where they are
[00:58:27] <mrdata> anonnumberanon, the points will be updated frequently; try to handle that
[00:58:28] <anonnumberanon> can you post tgz again i changed computers
[00:58:43] <rue_house> http://ruemohr.org/~ircjunk/programming/beacon.tgz
[00:59:01] <rue_house> it brings up an sdl widnow you can click on for another data set
[00:59:17] <rue_house> the code you wrote goes in beaconChooser.c
[00:59:27] <rue_house> I put it in anon.c while I tried other things
[01:00:31] <anonnumberanon> ok there was this line i added that if the weight was more than 180 you substract 180
[01:00:52] <anonnumberanon> Just check the angles that I got from that last set.
[01:01:23] <rue_house> ...?
[01:01:27] <rue_house> url/
[01:01:28] <rue_house> ?
[01:01:59] <mrdata> anonnumberanon, post the svg file?
[01:02:12] <anonnumberanon> mrdata, I didn't automate the svg
[01:02:21] <anonnumberanon> it's a pain to remake
[01:02:23] <anonnumberanon> lol
[01:02:25] <mrdata> bummer
[01:02:43] <Jak_o_Shadows> Whats some points that we're having trouble with?
[01:02:48] <mrdata> i dont have the display libraries so i cant see any of this
[01:02:53] <rue_house> its random data
[01:03:05] <Jak_o_Shadows> Yes. What is an example that doesn't work.
[01:03:05] <rue_house> mrdata, SDL-dev?
[01:03:07] <mrdata> svg would fix that by making it display in any web browser
[01:03:14] <mrdata> cannot do
[01:03:17] <rue_house> there are two things that make our code(s) fail
[01:03:22] <mrdata> foreign oopersting system
[01:03:32] <rue_house> a) points all to one side of the robot
[01:03:43] <rue_house> b) points at the same angle
[01:03:45] <anonnumberanon> rue_house, give me a set of angles in which you know three angles are the solution and ill run it through my code to check if I get them.
[01:04:05] <rue_house> :) those are easy ones tho
[01:04:14] <rue_house> some of these solutions are kinda grey
[01:04:30] <anonnumberanon> so 300, 301, 302 for example?
[01:04:44] <rue_house> float angles[] = {126.000000, 244.000000, 311.000000, 232.000000, 262.000000, 277.000000, 169.000000, 343.000000, };
[01:04:46] <anonnumberanon> vs 300, 302, 304?
[01:05:06] <rue_house> in this one, two of the points are obvious, but which point is used for the 3rd is a bit of a toss-up
[01:05:28] <rue_house> my code chose indexes 0, 3, 7
[01:06:20] <anonnumberanon> the best combination of angles (there may be more equally as good is: 126.000000 244.000000 343.000000
[01:07:00] <rue_house> 0, 1, 7
[01:07:15] <rue_house> Testing 0,1,7, average error: 4.424541
[01:07:15] <anonnumberanon> yeah
[01:07:22] <rue_house> Testing 0,3,7, average error: 4.432641
[01:07:33] <rue_house> this current alg of mine is searching for the highest
[01:07:51] <rue_house> so, it can barely tell between those two answers
[01:08:04] <Jak_o_Shadows> I believe I have some matlab that will do it
[01:08:04] <rue_house> 0, 4, 7 is close too
[01:08:08] <Jak_o_Shadows> I'm sorry for using matlab
[01:08:15] <anonnumberanon> lol
[01:08:25] <anonnumberanon> if matlab runs on avr we're in business!
[01:08:33] <rue_house> float angles[] = {40.000000, 31.000000, 109.000000, 347.000000, 30.000000, 114.000000, 36.000000, 41.000000, };
[01:08:38] <rue_house> my code does this one wrong
[01:08:51] <rue_house> it uses 2, 3, 5
[01:09:08] <rue_house> (109, 347, 114)
[01:09:15] <anonnumberanon> ruethe best combination of angles (there may be more equally as good) is: 40.000000 109.000000 347.000000
[01:09:33] <rue_house> 0, 2, 3
[01:10:27] <rue_house> is that what your code gave you?
[01:10:28] <anonnumberanon> This takes into account there is also 40 347 109, 109 40 347, etc
[01:10:32] <anonnumberanon> yes
[01:10:49] <Jak_o_Shadows> Hmm. Except that an difference of (240, 0) is weighted the same as (120, 120), which is obviously wrong
[01:10:51] <rue_house> what did you change?
[01:11:15] <rue_house> Jak_o_Shadows, thats the issue my code was having
[01:11:19] <anonnumberanon> Jak_o_Shadows, if 240 > 180 answer = 240 -180
[01:11:52] <anonnumberanon> has anyone else done this in the world ever?
[01:11:58] <rue_house> pff no
[01:12:05] <rue_house> were leading the pack
[01:12:17] <Jak_o_Shadows> TBH, i'm thinking just square a difference or something.
[01:12:22] <rue_house> super cheap absolute robot positioning
[01:12:41] <anonnumberanon> yeah but what beacons technology do you have in mind?
[01:12:43] <rue_house> with heading!
[01:12:51] <mrdata> impossiblre
[01:12:58] <mrdata> must have been done before
[01:13:01] <rue_house> you spin a laser around, when you hit a beacon it RFs an ID back
[01:13:34] <rue_house> so, by the angle of the beacons, and a database of hte beacon positions by ID, you can locate and get heading
[01:13:43] <mrdata> rue_house, whats the error on the sensed angle?
[01:13:46] <rue_house> no, nobody knew the math to solve the position
[01:14:05] <rue_house> I'll be at some fraction of a degree
[01:14:32] <mrdata> seems silly
[01:14:32] <mrdata> must be easy
[01:14:32] <mrdata> at most +/- 1 degree?
[01:14:32] <mrdata> okay
[01:14:51] <anonnumberanon> ill check 0, 2, 3 vs 2, 3, 5
[01:14:52] <rue_house> http://ruemohr.org/~ircjunk/robots/abspos/position_scanner.html
[01:16:08] <mrdata> will there be multiple bots in the arena?
[01:16:24] <mrdata> so, will the RF reply ever be confused?
[01:17:55] <rue_house> 1.8 degrees * ?:168
[01:18:11] <mrdata> ?
[01:18:24] <rue_house> I was thinking the laser can be modulated with a robot ID, and the reply can be beacon:robotid
[01:18:37] <rue_house> trying to find that ratio I used
[01:18:40] <mrdata> 1.8 degrees per step? ... 200 steps?
[01:18:58] <anonnumberanon> Actually no, I won't check cause I can't , it's too much dumb math to do.
[01:19:14] <mrdata> check what?
[01:19:23] <anonnumberanon> his solution vs mine
[01:19:26] <anonnumberanon> here:
[01:19:34] <anonnumberanon> float angles[] = {40.000000, 31.000000, 109.000000, 347.000000, 30.000000, 114.000000, 36.000000, 41.000000, };
[01:19:36] <Jak_o_Shadows> I think I have it?
[01:19:44] <anonnumberanon> rue got (109, 347, 114)
[01:19:47] <mrdata> Jak_o_Shadows, what you got
[01:19:58] <anonnumberanon> i got 40.000000 109.000000 347.000000
[01:20:08] <rue_house> I didn't say what the motor tooth count is
[01:20:30] <Jak_o_Shadows> anonnumberanon, I got 31, 109, 347
[01:20:32] <mrdata> anonnumberanon's solution seems better
[01:21:02] <anonnumberanon> between me and Jak it's pretty close, which one is correct?
[01:21:36] <anonnumberanon> yeah drawing it is good to check i guess
[01:21:54] <anonnumberanon> but between 31 and 40 some calculation needs be made
[01:21:56] <Jak_o_Shadows> I get 127, 73, 54 with a slightly different objective function.
[01:22:08] <Jak_o_Shadows> wait. No. 347, 114, 41
[01:22:13] <rue_shop5> 25:268
[01:22:14] <anonnumberanon> 73 does not exist in the angle set heh
[01:22:14] <Jak_o_Shadows> Which seems better?
[01:22:22] <Jak_o_Shadows> that was the differences :D
[01:22:48] <rue_shop5> about .268 degrees
[01:22:55] <rue_shop5> resolution, full step
[01:22:57] <anonnumberanon> i wish we had a master to grade us
[01:23:14] <rue_shop5> .134 degrees half stepping the motor
[01:23:46] <mrdata> 31 to 109 is 78, (score -42); 109 to 347 is 238, (score -118); 347 to 31 is 44, (score -76); total -236
[01:24:28] <anonnumberanon> Jak_o_Shadows, what do you get for this set? { 298.0, 17.0, 235.0, 207.0, 253.0, 90.0, 210.0, 330.0 }
[01:24:31] <rue_house> want me to plot these?
[01:25:22] <anonnumberanon> that would be nice
[01:25:32] <anonnumberanon> can you connect the robot to the points?
[01:25:50] <anonnumberanon> it's cos and sin to get x and y coordinates of the ends of the lines
[01:25:55] <Jak_o_Shadows> I get 5, 6, 7
[01:26:05] <Jak_o_Shadows> that one is really nice, it has a perfect score...
[01:26:09] <mrdata> 40 to 109 is 69, (score -51); 109 to 347 is 238, (score -118); 347 to 40 is 53, (score -67); total -236
[01:26:14] <rue_house> hold on, let me rework my code
[01:26:17] <mrdata> same
[01:26:17] <anonnumberanon> Jak_o_Shadows, yeah that's correct
[01:27:11] <anonnumberanon> 5, 6, 7 are the angles i used to troubleshoot my program cause i wanted the perfect score which was everything spaced out by 120
[01:27:38] <anonnumberanon> those angles were not found by the program and that's how I knew a bit more where to debug
[01:27:42] <mrdata> abnormal behaviour tells you more
[01:27:51] <mrdata> about a system than does normal behaviour
[01:28:10] <mrdata> give the worst most horrible inputs you can imagine
[01:28:32] <mrdata> make it want to kill all humans
[01:28:47] <mrdata> ;)
[01:28:50] <anonnumberanon> if it does, then you found a bug
[01:28:59] <mrdata> \o/
[01:29:07] <anonnumberanon> all bugs want to kill all humans that's known
[01:29:11] <anonnumberanon> just look at mosquitos
[01:30:31] <rue_house> ok what do you want me to show first? (data set and answer)
[01:30:37] <Jak_o_Shadows> http://jak-o-shadows.github.io/electronics/robot/localisation/angles120.html
[01:30:58] <anonnumberanon> rue_house, I want a full report on my office asap
[01:31:15] <anonnumberanon> im starting to have second thoughts about this program
[01:31:22] * rue_house puts Jak_o_Shadows' report on anonnumberanons desk
[01:31:31] <Jak_o_Shadows> aha
[01:31:42] <Jak_o_Shadows> That is just Matlab's publish command, so you can see some of the graphs as well
[01:31:54] <anonnumberanon> Okay let's do this:
[01:32:12] <rue_house> I'm confused, gimma a data set and a answer set you want me to plot
[01:32:37] <anonnumberanon> My brain is fried.
[01:32:39] <anonnumberanon> Help.
[01:32:40] <Jak_o_Shadows> rue, the datasets and plots I made are in that link. The dataset should be copy-pastable easily enough
[01:32:50] <rue_house> k just a sec, I'm collecting...
[01:33:35] <anonnumberanon> let's say now we have 0, 180 and 270.
[01:33:48] <anonnumberanon> now let's play with 2 more combinations very close to that
[01:34:03] <rue_house> I'm doing the second one
[01:34:17] <anonnumberanon> 0, 180, 275 AND 0, 180, 265
[01:34:22] <rue_house> it looks good
[01:34:27] <anonnumberanon> These should give the same score, correct?
[01:35:35] <rue_house> http://img.ctrlv.in/img/16/10/01/57ef529e7b4ab.png
[01:35:38] <rue_house> thats the first one
[01:36:12] <Jak_o_Shadows> Well, that is the same points selected, yes.
[01:36:14] <rue_house> dunno
[01:36:37] <anonnumberanon> this made with sdl?
[01:36:47] <rue_house> if they are the same deviation of a triangle in either direction, the score shoul dbe the same
[01:36:49] <rue_house> yes
[01:37:08] <Jak_o_Shadows> My score doesn't correspond to an angle
[01:37:20] <rue_house> the beacons are lighter as the index goes up
[01:37:23] <Jak_o_Shadows> You'd have to divide it by 3 then 4th root it.
[01:37:37] <rue_house> the darkest is the first beacon and the brightest is the 8th
[01:39:28] <rue_house> is that an area calc?
[01:39:37] <Jak_o_Shadows> me? Nope.
[01:39:55] <rue_house> cause I'm starting to think we want the largest area (sudo area)
[01:40:10] * anonnumberanon wants to get back into sdl...
[01:40:13] <Jak_o_Shadows> I just, fairly arbitarily, decided that 4th power penalises the large badness more.
[01:40:28] <rue_house> anonnumberanon, that code works, run ./make to compile it
[01:40:48] <Jak_o_Shadows> Could probably replace with exponential, 5th, 1/(x-120), etc fairly easily
[01:41:05] <rue_house> I was thinking of a lineear error rating
[01:41:27] <rue_house> like 5*(240/k)
[01:41:30] <rue_house> where k is the angle
[01:41:46] <rue_house> (for 240 degrees)
[01:42:12] <rue_house> abs(k) I guess
[01:42:57] <rue_house> but like I say, if all the points are to one side of the robot, the answer gets funkey cause its not really 120 degrees your looking for
[01:42:59] <rue_house> hmmm
[01:43:05] * rue_house tries something
[01:43:30] <anonnumberanon> i see 120 as like a type of golden ratio
[01:43:45] <anonnumberanon> it means "farthest apart"
[01:43:49] <rue_house> yea I'm gonna try that linear scale against +-120
[01:44:05] <anonnumberanon> the closest you get to that ratio (even very very far from it), the better
[01:44:09] <rue_house> well, then the problem is that if ...
[01:45:52] <rue_house> "from a point, the futhest left and right, thats not more than 120 degrees"
[01:45:52] <rue_house> ?
[01:46:03] <Jak_o_Shadows> I'm not sure teh 1/difference is going to work.
[01:46:17] <rue_house> it should produce a V like curve
[01:46:23] <rue_house> possibly ^ like
[01:46:32] <rue_house> brain is failing
[01:49:37] <anonnumberanon> <SDL/SDL_gfxPrimitives.h
[01:49:57] <anonnumberanon> hey i don't have that lib is it a super cool super epic but secret lib for sdl?
[01:50:05] <anonnumberanon> FAILS at compilation
[01:50:13] <anonnumberanon> cause of this ^
[01:51:25] <rue_house> oooh, its not hte cats, its thunder!
[01:51:31] * rue_house turns the music back up
[01:52:23] <rue_house> libsdl-gfx1.2-dev
[01:52:28] <rue_house> gfx
[01:52:52] <rue_house> anonnumberanon, its seperate, can you gather it?
[01:53:29] <rue_house> hmm, if my power goes out it'd be bad, all my backup supplies are in a bad state
[01:53:55] <anonnumberanon> yueah
[01:54:15] <rue_house> it'll come up blank, each time you click on the window it re-renders with new random data
[01:55:58] <anonnumberanon> ah damn
[01:56:06] <rue_house> working?
[01:56:19] <anonnumberanon> uh so im not sure if i should go paste it into my SDL folder
[01:56:24] <anonnumberanon> nor where that folder is
[01:56:29] <rue_house> hehehe
[01:57:01] <Jak_o_Shadows> Hmm. Rue, does your algorithm for working out the position work if the robot is not inside the triangle?
[01:57:13] <anonnumberanon> guess ill do locate sdl.h
[01:57:25] <rue_house> Jak_o_Shadows, hrm, do we have to ask that?
[01:57:44] <Jak_o_Shadows> Not if your beacons are all around the robot.
[01:57:47] <Jak_o_Shadows> otherwise, yes.
[01:57:53] <rue_house> hmm
[01:57:56] <anonnumberanon> /usr/lib/x86_64-linux-gnu/ seems to be it...
[01:58:09] * rue_house looks for an escape to this line of questioning
[01:58:38] <rue_house> Jak_o_Shadows, if the question is, 'can my code locate the robot with the beacons?' the answer is YES!
[01:58:52] <Jak_o_Shadows> If the beacons are all on one side.
[01:59:03] <anonnumberanon> well i have this: libSDL2_gfx-1.0.so.0
[01:59:07] <rue_house> mmmm, look! butterflies!
[01:59:13] <anonnumberanon> MAYBE THAT COvers what's in your file rue
[01:59:14] <rue_house> 1.0!
[01:59:16] <rue_house> wow
[01:59:32] <rue_house> I'm using debian, and even I have 1.2
[02:00:28] <anonnumberanon> i use sdl 1.2 but that thing is 1.0
[02:00:31] <anonnumberanon> man
[02:00:52] <rue_house> you should be able to get a gfx for 1.2
[02:02:55] <anonnumberanon> /usr/include/SDL2/SDL2_gfxPrimitives.h
[02:02:59] <anonnumberanon> found
[02:03:19] <rue_house> ah include SDL2/SDL2_gfx...
[02:03:21] <anonnumberanon> so ill jsut change in the source SDL to SDL2
[02:03:25] <anonnumberanon> sigh
[02:03:38] <anonnumberanon> is it in a source and in the make file or just the source?
[02:04:12] <rue_house> yup, main.c and the make.sh
[02:05:36] <anonnumberanon> hahah oh god, and then i get a million errors, what version of debian is you? are you sure you are on sdl2, not just sdl?
[02:06:25] <anonnumberanon> okay
[02:06:34] <anonnumberanon> uhm, enough linux heh
[02:06:47] <rue_house> hmm
[02:06:52] <rue_house> I think its 1.2
[02:06:55] <rue_house> oooh, its 1.2
[02:07:24] <rue_house> libsdl-gfx1.2-dev
[02:07:45] <rue_house> libsdl1.2-dev
[02:08:07] <rue_house> I think you jumped over that version didn't you?
[02:08:24] <rue_house> I wonder what they changed in sdl2
[02:08:30] <anonnumberanon> in my package manager that has a little box waiting to be ticked by me, asking to tick it so that my computer will version-blow up
[02:08:42] <rue_house> hehe, been there
[02:08:46] <anonnumberanon> i used to use sdl1.2 a long time ago
[02:08:49] <rue_house> removing kernel...
[02:09:02] <rue_house> "no! no!, I need that!"
[02:09:41] <anonnumberanon> then on my second try hard moment of sdl i was insulted in the sdl channel into using sdl2, which was very nice and iirc a better experience than the former for
[02:10:13] <anonnumberanon> and the tutorial for sdl2 is better, i feel compared to sdl1 (tutorials by lazyfoo)
[02:10:31] <rue_house> been there
[02:10:45] <rue_house> ##c will cut you down nomatter what you ask
[02:10:58] <anonnumberanon> oh yeah that's why i like it
[02:12:23] <anonnumberanon> allright it's late
[02:13:41] <rue_house> ah midnight
[02:17:58] <anonnumberanon> 2:49
[02:18:30] <anonnumberanon> yeah no in my program i would remove 360 degrees if the result of the first abs() was more than 180
[02:18:56] <anonnumberanon> okay ill post it tomorrow though
[02:20:06] <mrdata> rue_house, are you on the west coast?
[02:20:18] * mrdata is in toronto
[02:20:19] <rue_house> yea
[02:20:24] <mrdata> it's nearly 3am here
[02:20:34] <rue_house> well done!
[02:20:56] <rue_house> give me tommorows lottery numbers
[02:23:10] <rue_house> https://www.wolframalpha.com/input/?i=plot+y+%3D+abs%28x%2B120%29%2F2
[02:23:29] <rue_house> 120 degrees will result int eh lowest error
[02:23:46] <rue_house> https://www.wolframalpha.com/input/?i=plot+y+%3D+abs%28x-120%29%2F2
[02:23:48] <rue_house> +-
[02:32:04] <rue_house> ooo this alg is looking good
[02:32:11] <rue_house> its along your track
[02:32:31] <rue_house> e1 = angleCompare(angles[i], angles[j]);
[02:32:31] <rue_house> e2 = angleCompare(angles[i], angles[k]);
[02:32:31] <rue_house> ea = Min(abs(e1-120) + abs(e2+120), abs(e1+120) + abs(e2-120)); // closest to +- 120 degrees, I dont care if reversed.
[02:32:34] <rue_house> lowest of ea
[02:33:18] <rue_house> anything it cant solve well, I cant either
[02:33:34] <rue_house> oops, spoke too soon
[02:34:56] <rue_house> d1 = -1.500000 d2 = -120.750000 d3 = 0.000000 Testing 1,2,5, average error: 121.000000
[02:35:18] <rue_house> it took 120 degrees of error on one side, cause the 1.5 on the other was so good
[02:37:06] <rue_house> so, it should probably try to balance the errors a bit
[02:46:18] <Jak_o_Shadows> Yeah, that's why I put the 4th power in.
[02:46:23] <Jak_o_Shadows> To penalise the bigger erros more
[02:46:29] <Jak_o_Shadows> also, did you consider one of these:
http://www.ebay.com.au/itm/Red-Line-Laser-Module-Focus-Adjustable-Laser-Head-5V-Industrial-Grade-5mW-650nm-/400781449348?hash=item5d506f9884:g:dh0AAOSwPe1UKh0U
[03:02:37] <rue_bed2> they weren't availoable atthe time
[11:50:14] <rue_house> I have 20 now
[11:58:20] <z64555> why the abs?
[12:00:10] <rue_house> because then it dosn't matter if the error is to your left or right, its still positive error
[12:00:23] <rue_house> so the lowest value is the closest to the target
[12:01:23] <z64555> what's this trying to counter? wobble? backlash?
[12:03:27] <rue_house> you havn't heard the conversation we been having over the last 3 days?
[12:03:41] <rue_house> positioning syste for robot
[12:04:02] <rue_house> the robot knows the angle around it to beacons that are of known locations
[12:04:25] <rue_house> so, if you robot can see 8 beacons, choose the best 3 to triangulate the position from
[12:04:36] <z64555> right
[13:34:53] <rue_shop5> ugh
[13:35:04] <rue_shop5> I have about 40 lead-acid batteries to top up
[13:48:23] <SpeedEvil> distilled water I hope
[13:48:25] <SpeedEvil> (or RO)
[16:00:40] <rue_house> gel
[16:00:55] <rue_house> I need to etch an array of chargers
[16:03:44] <rue_house> hmm, I could probably use an avr to run a few channels
[16:18:22] <Tom_itx> rue_house do you know where to find the format for rtf?
[16:18:42] <rue_house> isn't it almost like html?
[16:19:15] <Tom_itx> could be..
[16:19:54] <Tom_itx> what about things like page size or orientation?
[16:24:54] <rue_house> no idea
[16:25:03] <Tom_itx> i found some info...
[16:26:07] <rue_house> anonnumberanon, I mutilated a triangle area formula, and it seems to work great
[16:28:17] <rue_house> yea, it doing really well
[16:28:34] <rue_house> nope thats a strike...
[16:28:38] <rue_house> might be that last mod tho
[16:30:35] <Tom_itx> hello world saved as rtf is 42k file
[16:30:36] <rue_house> strnage
[16:31:05] <rue_house> I massicured a triangle area alg, and it works, if I dont make logical corrections to it
[16:33:44] <Tom_itx> i suppose i could save the header and low level write it out before the data each time
[16:33:59] <rue_house> butchered, and it works great
[16:34:27] <rue_house> / largest triangle
[16:34:28] <rue_house> e1 = (angleCompare(angles[i] , angles[j]));
[16:34:28] <rue_house> e2 = (angleCompare(angles[i] , angles[k]));
[16:34:28] <rue_house> e3 = (angleCompare(angles[j] , angles[k]));
[16:34:28] <rue_house>
[16:34:28] <rue_house> w1 = (e1+e2+e3+0.005)/2;
[16:34:32] <rue_house> ea = w1*(w1-e1)*(w1-e2)*(w1-e3);
[16:34:37] <rue_house> find the highest ea
[16:35:15] <rue_house> and its not failing...
[16:39:00] <rue_house> its correctly hitting things I can barely call as the best solution
[16:39:21] <rue_house> float angles[] = {308.500000, 305.250000, 319.250000, 304.000000, 353.500000, 261.750000, 259.500000, 326.500000, };
[16:39:25] <rue_house> that ones evil
[16:39:37] <rue_house> winning is 1 4 6
[16:41:23] <rue_house> so, maybe what I'll do now, is up the simulation,
[16:41:55] <rue_house> make a fixed field of beacons, and when you click on a spot, it shows what beacons it would use realtime
[16:44:13] <SpeedEvil> why do you think beacons work?
[16:44:35] <SpeedEvil> That is - what hardware are you using
[16:49:26] <rue_shop5> not sure on the light detector
[16:49:44] <rue_shop5> but they would detect a hit from a modulated laser and reply by RF
[16:50:56] <SpeedEvil> I guess if you have line of sight, that works well
[16:51:10] <rue_shop5> well the idea is that you spread a bunch of beacons around
[16:51:19] <SpeedEvil> have you considered reteroreflectors?
[16:51:27] <rue_shop5> this code being worked on picks 3 to use for triangulation
[16:51:45] <rue_shop5> I dont know how to do the bounceback optics
[16:51:54] <rue_shop5> and I need to know the beacon ID
[16:52:08] <SpeedEvil> you really don't if you have a map
[16:52:09] <rue_shop5> so I can look it up in a database
[16:52:43] <rue_shop5> I do if I want to be able to just drop a robot into a field, with a database and have it know where it is
[16:53:12] <rue_shop5> ITS FREAKING RAINING AND I WANT TO PLAY OUTSIDE
[16:53:20] <SpeedEvil> you don't.
[16:53:24] <rue_shop5> if it weren't raining, I'd stay in and work on this code
[16:53:51] <SpeedEvil> A position makes it easier, but if you can see >2 beacons, you can disambiguate quite fast
[16:54:11] <rue_shop5> I dont think so
[16:54:14] <SpeedEvil> Also - if a field - why not GPS
[16:54:35] <rue_shop5> if you have 100 beacons, its going to take a lot of work to know which ones you might be seeing
[16:54:39] <rue_shop5> indoors too?
[16:55:16] <rue_shop5> I want to be able to just stick beacons all over, and give the robot a database of the xy positions of them all
[16:56:33] <rue_shop5> besides, so far it looks like I'm the only one who can figure this all out
[16:57:01] <rue_shop5> anonnumberanon, adjusted his code, and I dont have a working model here that I can test, so his code might work too
[16:57:30] <SpeedEvil> 100 beacons is only 10000 possible combinations for any two beacons
[16:57:39] <rue_shop5> 16mips avr
[16:57:41] <rue_shop5> 8 bit
[16:57:46] <SpeedEvil> yeah - don't do that
[16:58:01] <SpeedEvil> 32 bit much more capable processors are as cheap
[16:58:04] <rue_shop5> what I'v got here, sofar, can be done with an avr in pretty good time
[16:58:15] <veverak> rue_shop5: btw: isn't it better for it to 'genearte beacon map' ?
[16:58:34] <rue_shop5> you cant, you cant measure the distance to a beacon
[16:58:36] <rue_shop5> $$$$$
[16:58:39] <veverak> ah
[16:58:41] <veverak> how they work? :)
[16:58:45] <rue_shop5> knowing the angles to beacons is cheap
[16:59:06] <rue_shop5> you hit them with a modlated laser and they transmitt their ID via RF
[16:59:22] <veverak> hmm
[16:59:45] <veverak> particle filter?
[17:00:04] <rue_shop5> I'm thinking the proto might be to modulate the laser with a robot ID, and the RF reply is the robot and beacon ID's
[17:00:17] <veverak> or...
[17:00:21] <veverak> hmm
[17:00:25] <rue_shop5> but I have to finish getting the math down
[17:00:27] <rue_shop5> and code
[17:00:48] <rue_shop5> this beacon chooser code seems to work
[17:01:14] <rue_shop5> I'll make another test program,
[17:01:29] <rue_shop5> add in the triangulation code
[17:01:47] <veverak> if you have something that can detect it's position change with high precision
[17:01:52] <rue_shop5> and then, if thats all good, I'll get going on the hardware again
[17:01:58] <veverak> it should be able to map the beacons
[17:02:00] <veverak> if you got nagle
[17:02:11] <veverak> *angle
[17:02:26] <rue_shop5> hmm, give it the first 3 beacons and let it try to work out the rest?
[17:02:55] <veverak> should work
[17:03:03] <veverak> I would prefer shared database for beacons info
[17:03:12] <rue_shop5> it would save work
[17:03:17] <veverak> and something that actually knows where it is
[17:03:22] <veverak> and how it's position changes
[17:03:24] <veverak> :)
[17:03:32] <veverak> (it can reliably detect first set of beacons)
[17:03:33] <rue_shop5> hmm, the beacon could answer with robot ID, beacon ID and beacon position
[17:03:59] <rue_shop5> and the robot could tell it the position if the beacon didn't know
[17:04:16] <rue_shop5> this comm proto is getting thicker
[17:04:21] <veverak> if you have rail of length 'x' and carriage can detect it's position (endstops enough)
[17:04:30] <veverak> and it can detect at which angle is beacon
[17:04:42] <veverak> with 'x' big enough you should be able to detect position of beacons
[17:04:45] <rue_shop5> wheeled robot, with slipping wheels
[17:04:59] <rue_shop5> I could just measure the first set
[17:05:06] <veverak> yeah
[17:05:12] <veverak> hmm
[17:05:22] <rue_shop5> I'll have to think about the math to locate a beacon
[17:05:36] <veverak> well
[17:05:50] <rue_shop5> the math to locate the robot isn't simple
[17:05:56] <veverak> I think there is place to correctly implement 'how certain you are'
[17:05:58] <veverak> :)
[17:06:07] <rue_shop5> yea
[17:06:16] <veverak> for entire thing to makes sense
[17:06:26] <rue_shop5> the robot could use different sets of beacons to come up with an 'uncertianty'
[17:06:48] <veverak> well, for start your beacon position detection will be uncertain
[17:06:55] <veverak> and you should be able to guess how
[17:07:00] <rue_shop5> no, start with 3 known
[17:07:15] <veverak> yeah, I mean when it will detect the unknown
[17:07:17] <veverak> :)
[17:07:30] <veverak> for start set, I suppose you can tell position +-0.1mm
[17:07:45] <rue_shop5> http://ruemohr.org/~ircjunk/robots/abspos/code/lkasdjfyk2.gif
[17:07:55] <rue_shop5> avoiding stuff like that was a challange
[17:08:27] <veverak> :)))
[17:08:50] <rue_shop5> http://ruemohr.org/~ircjunk/robots/abspos/code/problem.html
[17:09:03] <rue_shop5> it would be nice to have a method that didn't need so much trig
[17:09:11] <rue_shop5> poor little avr
[17:10:41] <veverak> let me think
[17:11:58] <veverak> nah
[17:12:22] <rue_shop5> somehow, I'm sure there should be a way of solving all the angles using a simotanious equation
[17:12:24] <veverak> quaternions calculation can avoid cos/sin for certain operations
[17:12:42] <veverak> not completely, but reduce their usage
[17:12:59] <veverak> not sure how to usem them in this case though
[17:16:27] <veverak> rue_shop5: I suppose precalculation of angles doesn't do the trick?
[17:16:33] <veverak> (sin/cos tables)
[17:27:33] <rue_shop5> well, if you know the 3 positions of the beacons, and you know the angles from the robot to them, then the lengths of the lines from the robot to the beacons only has 1 soluton, and those lengths are a ratio of the angles
[17:27:59] <rue_shop5> so, there should be a 3 way simotanious equation that dosn't actually require trig
[17:30:21] <rue_shop5> as soon as you know the distances betweent eh robot and the beacons, the math is easy
[17:30:44] <rue_shop5> you can even get some uncertianty, cause when you do the calc, you only use 2 of the distances
[17:32:49] <veverak> if you know beacon pos
[17:32:54] <veverak> and angle
[17:33:26] <veverak> you should be able to get formula of line that goes through the beacon towards the robot?
[17:33:44] <veverak> *parametric equation
[17:34:00] <veverak> (if you have two of them, it's pretty easy to get their intersection)
[17:34:36] <veverak> definetly
[17:34:38] <rue_shop5> try it:) it took me a year and 2 irc channels to solve
[17:34:58] <rue_shop5> http://ruemohr.org/~ircjunk/robots/abspos/code/robot.png
[17:35:00] <veverak> if you have beacon pos, and of robot position against it
[17:35:19] <veverak> it should be atan2 calculation to get vector for parametric equation
[17:35:35] <veverak> means 2x atan2 calculations for two parametric equations
[17:35:43] <rue_shop5> you know Xa,Ya, Xb,Yb, Xc,Yc, angles ARB ARC and BRC
[17:35:59] <rue_shop5> find Rx,Ry
[17:45:27] <veverak> nah, there is no simple way to get required angles for my idea
[17:51:52] <Guest2562> hello
[17:52:00] <Guest2562> what is irc
[17:52:20] <Tom_itx> a chat room
[17:52:39] <Guest2562> alright tom are you realy a robot or a online human
[17:53:09] <Tom_itx> i am a robot
[17:53:28] <Guest2562> alright is there a better app then this
[17:53:43] <Tom_itx> what app?
[17:54:14] <Guest2562> IRC
[17:54:26] <Tom_itx> irc isn't an app
[17:54:35] <Tom_itx> just like the interweb isn't an app
[17:55:07] <Guest2562> but this is a app its name irc
[17:55:19] <Guest2562> an
[17:55:43] <anonnumberanon> Guest2562, this is off-topic, here we talk about robots and building them.
[17:56:05] <Guest2562> oo alright sorry
[17:56:15] <anonnumberanon> For questions about irc, joing ##irc.
[17:56:32] <anonnumberanon> type this: /join ##irc
[17:57:05] <anonnumberanon> >troll leaves without waiting at least 20 seconds
[17:58:34] <anonnumberanon> rue_shop5, I see your challenge has a chapter #2..
[17:58:40] <anonnumberanon> http://ruemohr.org/~ircjunk/robots/abspos/code/problem.html
[18:01:29] <rue_shop5> thats what I worked out
[18:01:34] <rue_shop5> with a bit of help
[18:02:06] <rue_shop5> I was ill, I spent 72 hours continious on it
[18:02:07] <anonnumberanon> Ill take a long during my 41 minute train ride in a bit. I like geometry.
[18:02:12] <rue_shop5> and came up with that method
[18:02:18] <anonnumberanon> take a look*
[18:02:44] <rue_shop5> the geometry is just part of it, then I run the results thru a 2d library
[18:02:49] <anonnumberanon> may even bring a pencil and paper with me, even though I'm going to a party
[18:03:23] <rue_shop5> which lets me create the lines betwen the beacons, rotate them, and find the intersection
[18:03:49] <rue_shop5> I'm the guy at the party in the corner, having a good time watching everyone have fun...
[18:04:05] * anonnumberanon also has to do this sigh.. https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
[18:04:42] <anonnumberanon> ill probably be writing geometry and UART solutions on the corner of a napkin at the restaurant
[18:04:59] <anonnumberanon> stealing aluminum silverware for my robot's frame
[18:05:36] <rue_shop5> theBear, I hope I said thanks for the shower...
[18:05:45] <anonnumberanon> but it's not really stealing right? recycling?
[18:06:15] <rue_shop5> obviously, a robot frame is better use of metal than cuttlery
[18:09:43] <rue_shop5> hmm, if the controller wiggled the servo, it would just have to look at the phase difference to know which was the force was applied in...
[18:10:02] <rue_shop5> drat, I'm falling asleep
[18:10:03] <veverak> I have
[18:10:08] <veverak> sqrt()sqrt()=...
[18:10:22] <veverak> hmm
[18:16:41] <anonnumberanon> problem with lookup tables is that: you need cos and sin, you need 360 angles for some precision, you need floats to store values, so that's 2 * 360 * bits_to_represent_a_value_between_-1_and_1
[18:16:59] <anonnumberanon> I'd say you can use a byte for each value (floats would break the bank).
[18:17:31] <rue_shop5> an avr does trig just fine,
[18:17:34] <anonnumberanon> so 2 * 360 * 1 = 720 B of ram use
[18:17:38] <rue_shop5> 16 mips is pretty good
[18:17:49] <anonnumberanon> but don't have to store it in the ram, can also store it in the eeprom
[18:17:52] <rue_shop5> anonnumberanon, besides, there are serial eeproms you know
[18:18:01] <anonnumberanon> avr has an eeprom
[18:18:20] <rue_shop5> yea, but even then, lots of options
[18:18:27] <anonnumberanon> yeah
[18:18:42] <rue_shop5> 1k eeproms cost nothing
[18:18:50] <rue_shop5> (get them from CRT monitors)
[18:18:57] <anonnumberanon> but it would still be good to store cos and sin as lookup tables because last time i read about it i was convinced it was massively faster
[18:19:03] <rue_shop5> and 256*16 bits...
[18:19:23] <rue_shop5> dont save sin and cos, just add 90 degrees to the cos lookup
[18:19:25] <rue_shop5> or whatever
[18:19:50] <anonnumberanon> unless according to your writing, you need everything done in 500 milliseconds, which is forever and thus no problem
[18:20:02] <rue_shop5> I still have it in my mind that a linear simotanious equation can solve the distances tho
[18:20:10] <rue_shop5> yea
[18:20:16] <rue_shop5> 16 mips
[18:20:43] <anonnumberanon> well...depends on the instructions :)
[18:20:56] <anonnumberanon> how many ops is a cos operation?
[18:20:58] <rue_shop5> turing machine :)
[18:21:32] <rue_shop5> dunno, but I once threw a really ugly nested trig equation at an avr and it rolled off the answers faster than a hd44780 could keep up
[18:22:57] <rue_shop5> I was impressed
[18:23:10] <rue_shop5> but an apple IIe wasn't that slow with trig either
[18:23:32] <rue_shop5> and it was only about 0.5mips, if that
[18:25:01] <anonnumberanon> yeah but your page seems to show a wall of trig
[18:25:05] <anonnumberanon> i have to read it
[18:25:10] <anonnumberanon> okay I'm off to that party
[18:27:02] <rue_shop5> heh, yea
[18:27:12] <rue_shop5> it hurt my brain good
[19:25:26] <anonnumberanon> very interesting problem indeed...
[19:42:24] <rue_shop5> haha, cmon guys thats the one I already solved
[19:46:34] <rue_shop5> YOUR ALL JUST PROBLEM JUNKIES!
[19:46:35] <rue_shop5> :)
[19:46:50] <rue_shop5> anonnumberanon, the area approach worked great
[19:47:09] <rue_shop5> its not calculating the real area, but a factor of it, which is good enough for grading
[19:47:10] <anonnumberanon> wah? solved? and i was writing so many angles stuff already
[19:47:24] <rue_shop5> hey, if you can find a better way thats great
[19:47:33] <anonnumberanon> using 2 pts and 1 angle but it got a bit confusing
[19:47:50] <rue_shop5> http://ruemohr.org/~ircjunk/robots/abspos/code/problem.html
[19:48:08] <anonnumberanon> but you need the coordinates of a robot at the end right?
[19:48:22] <anonnumberanon> x y?
[19:48:42] <rue_shop5> yes, I have a little C trig lib that does it with the information from that page
[19:51:40] <anonnumberanon> i want my brain to burn into this fore i cheat with a good or bad solution
[19:51:45] <anonnumberanon> brb beer
[19:53:12] <rue_shop5> haha! sweet, my socket-extender-isp-injector works!
[21:19:56] <rue_house> hahaha, its fun watching it choose beacons realtime in a proper 2d field
[21:24:41] <Jak_o_Shadows> You know, the hip young trendy thing to do woul;d be make it all up in javascript, so people can see it as a webpage
[21:26:18] <rue_house> screw that
[21:29:56] <Jak_o_Shadows> also, rue, your video made me want a scope
[21:35:02] <rue_house> haha
[21:36:17] <rue_house> https://www.youtube.com/watch?v=5qCcgSBdfbc&feature=youtu.be
[21:36:53] <Jak_o_Shadows> Neato
[21:37:57] <rue_house> so, next I'll put in the code that takes it back to a position from the angles, and see if they match
[21:38:15] <rue_house> the beacon chooser seems to be behaving
[21:39:43] <rue_house> I thought I'd not written a function to take a point and turn it into an angle, but then I remembered that I didn't cause atan2() already exists
[21:41:23] <rue_house> tho things dont work right if you take its radians results and feed them directly into the degrees system I made