#robotics | Logs for 2016-03-03

Back
[00:29:23] <DagoRed> zzz64: I really want to take a peak at your code. Also I am curious if you will use any of the real time extensions to optimize the runtime of your code.
[02:11:04] <z64555> doot
[02:11:16] <z64555> Heh, well that was more of a nap
[02:39:42] <z64555> ok, sooo...
[02:39:49] <z64555> sigma is not a random variable
[02:40:04] * z64555 headdesk
[04:51:17] <z64555> so kalman filters can be tuned
[04:51:31] <z64555> ...and some of them are tuned by other kalman filters
[04:51:50] <z64555> this is getting out of hand. lol
[04:52:14] <jasonj8> kalman filters are literally rocket science
[04:52:51] <veverak> :D
[04:53:04] <Jak_o_Shadows> lots of things are literally rocket science
[04:53:16] <z64555> especially science that involves rockets. :D
[04:53:52] <Jak_o_Shadows> also, brain surgery is harder than rocket science I think
[04:55:00] <z64555> depends on the brain
[04:55:25] <Jak_o_Shadows> Eh. Rocket science is a huge exercise in teamwork
[04:57:31] <Jak_o_Shadows> Which is a different challenge
[04:58:42] <flyback> https://www.youtube.com/watch?v=IvUU8joBb1Q
[04:58:48] <flyback> OWNS YOUR "CANUCK"
[04:58:53] * flyback SLAPS ALL THE CANADIANS
[05:03:35] <veverak> well
[05:04:09] <veverak> I think that "rocket science" starts to be term for something really hard/complex/complicated
[05:04:22] <veverak> not literally being relative to "rocket science" itself
[05:04:30] <veverak> but nah, just my feelings about it
[05:06:32] <Jak_o_Shadows> Oh yeah, that is the common term
[05:15:20] <jasonj8> kalman filters were famously used in some NASA stuff or something
[05:21:24] <Jak_o_Shadows> yes, the moon landings
[05:21:32] <Jak_o_Shadows> and probably almost everything else ever
[06:21:47] <z64555> there's even a continuous version of them, in case you ever wanted to build one out of op amps :)
[06:24:08] <Jak_o_Shadows> That sounds disgusting :P
[06:27:52] <z64555> hm, I think some fancy radios might have them
[07:50:52] <deshipu> veverak: http://nullr0ute.com/2016/03/lipstick-on-a-pig-aka-the-raspberry-pi-3/
[08:16:20] <veverak> lol
[08:16:27] <veverak> deshipu: will see about that, but I am OK with that for now
[08:16:32] <veverak> wanted to order rpi2 anyway, so...
[08:16:34] <veverak> :)
[08:20:46] <z64555> hey, leave Ms. Piggy outta this
[08:21:15] <deshipu> oooh, kermit
[08:22:07] <z64555> :[
[08:47:11] <DagoRed> deshipu: that pi article hits the nail on the head.
[08:57:27] <z64555> DagoRed: thankfully I figured out that sigma is not a delta function
[08:59:05] <DagoRed> No it's not. Sigma I think goes back into the error covariance.
[08:59:44] <DagoRed> Remember, the kalman filter is a statistically defined filter using state space.
[09:04:11] <z64555> sigma is the standard deviation, in my parcular case it shows up as sigma squared, which *might* actually be the variance
[09:04:32] <z64555> at any rate, it's constant
[09:06:43] <z64555> probably will set it to 1/3 of the max range of whatever it's operating on, since 3*sigma is 99.7% on a gaussian bell curve
[09:11:11] <DagoRed> That's 6 sigma I thought
[09:12:37] <z64555> no no, 6 sigma is some sort of upper management certification
[09:13:35] <DagoRed> That has a stastical value to calculate. I know 1 sigma is like 68 something percent.
[09:14:06] <z64555> 68, 95, 99.7
[09:14:12] <z64555> presumably
[09:15:41] <DagoRed> yes
[09:32:33] <z64555> ok, think I got a rough draft of the kalman filter coded, need to move some things around to keep my matrix functions consistant
[09:33:36] <z64555> then there's the matter of making C accept my typedefs
[09:41:59] <DagoRed> that's not hard.
[09:42:06] <DagoRed> Let me know if you need a second eye on things.
[09:42:56] <z64555> will do
[10:04:36] <z64555> DagoRed: http://pastebin.com/NwVv7gzB
[10:04:48] <z64555> http://pastebin.com/cwqr2dpK
[10:05:28] <z64555> http://pastebin.com/BrQuNGqx
[10:06:08] <z64555> http://pastebin.com/KFXiw305
[10:06:14] <z64555> that should be enough context
[10:13:23] <renl> are there any established methods of doing "replication of knowledge" from one robot to another?
[10:15:53] <z64555> save to SD card?
[10:16:29] <renl> im thinking along the lines of multiple robots having shared awareness during operations
[10:17:31] <z64555> hm, well, you could have them periodically update each other on their findings, or have them offload their collective memory to a host
[10:18:25] * z64555 spitballs here
[10:19:16] <renl> roger, was hoping there to be some libraries out that that might have do that while catering to unstable or low bandwidth comms etc
[10:19:19] <z64555> in either case, you'd have to have transformations between local space and shared/global space
[10:19:43] <renl> yup
[10:20:28] <z64555> there'ss probably some libraries out there that estaplish protocols, like what they use on TNC's
[10:20:40] * z64555 looks up the name of the standard
[10:21:17] <z64555> AX.25
[10:21:43] <renl> sorry whats TNC?
[10:21:45] <z64555> there's also TCP, UDP, those are the ones that I know of
[10:22:15] <z64555> Terminal Node Controller, it's a do-hickey that you can connect to an amature radio and have it act like a wireless modem
[10:22:48] <z64555> predessor to text messages :)
[10:22:56] <z64555> *SMS text
[10:23:01] * renl nod
[10:24:54] <renl> anything in the application layer tho? kinda like database replicationish
[10:29:01] <z64555> networking communication protocols isn't my forte, sorry
[10:29:25] <z64555> I'm doing good to remember the distinction between TCP and UDP. :)
[10:37:31] <DagoRed> z64555: Looking now
[10:37:45] <z64555> gah, bummer. I have to cast the float[][] as a matrix to get the compiler to stop complaining
[10:38:39] <z64555> alternatively, I could bust out memset
[10:38:55] <z64555> er, not memset.
[10:39:53] <z64555> malloc
[10:41:10] <DagoRed> calloc
[10:42:47] <z64555> hopefully my doxy is clear. I try to make it a point to have neat code
[10:48:00] <DagoRed> It's very neat.
[10:48:19] <DagoRed> I question if your dt is correct because it's not just simply multiplied.
[10:50:15] <flyback> https://www.youtube.com/watch?v=IvUU8joBb1Q
[10:50:25] <z64555> yeah, tried to save a few flops there by grouping them
[10:50:46] <z64555> in kal_set_Q, correct?
[10:52:57] <z64555> ah, one of the things I wasn't sure of was how R should've been set
[10:53:51] <z64555> Wiki just states "R = [σ^2]"
[10:54:33] <z64555> I don't know if that should be I * σ^2, or if all elements in the matrix should be σ^2
[11:03:46] <DagoRed> Yeah... some of this isn't looking right to me. But that's OK. The documentation takes a few passes to truly understand.
[11:08:25] <z64555> any hints?
[11:10:03] <DagoRed> Still looking and trying to deal with a friend wanting to learn C++ and freaking out over every suggestion and attempt to help.
[11:10:23] <z64555> lol oh boy
[11:11:23] <DagoRed> Yeah... good guy. Deep in the open source world as a producer of parts of the Linux Action Show.
[11:11:45] <DagoRed> Puppy Linux dev (Bash)... but is freaking out about compiled formal languages.
[11:14:39] <z64555> could be worse
[11:14:58] <z64555> he could be a Haskell programmer
[11:15:02] <DagoRed> kal_calc seems spot on.
[11:15:24] <DagoRed> so that much is good... because that is biggest pain of a kalman filter is all those matricies.
[11:15:33] <z64555> both pri and pos?
[11:15:40] <DagoRed> Looks like it.
[11:15:47] <z64555> great. :)
[11:15:58] <DagoRed> I'm not checking for accuracy but it seems logical especially with your comments.
[11:16:23] <DagoRed> Regular kalman, EKF, or UKF?
[11:16:31] <z64555> regular kalman for now
[11:17:35] <DagoRed> Ok, when I saw the S^-1 I couldn't remember if that is doing the inversion or jacobian.
[11:20:10] <rue_house> I think my brain is failing
[11:20:21] <DagoRed> rue_house: why's that?
[11:20:22] <rue_house> I put the cheese sauce in the cuppboard last night...
[11:21:01] <rue_house> I catch myself most of the time
[11:21:10] <z64555> if it's not bleu cheese, then it doesn't need mold
[11:21:12] <rue_house> the freq has been going up
[11:21:44] <rue_house> does a computer feel fear if 3 of 16 processors have failed?
[11:21:50] <z64555> could be stress, could be drop in blood sugar
[11:22:14] <rue_house> I'm always stressed
[11:22:59] <z64555> computer doesn't feel fear, but it'll complain about having its other PU's working a bit harder
[11:24:48] <z64555> DagoRed: thanks for proof reading :)
[11:26:14] <DagoRed> z64555: still looking it over, I have the links you posted saved in a google doc for reference as you go along. I really suggest you start using github on this.
[11:26:24] <DagoRed> Unless you want to keep it proprietary.
[11:28:18] <z64555> eh, haven't decided on licensing just yet. so I'll keep it proprietary for now
[11:29:00] <DagoRed> Until defined all code on github implies GPL
[11:29:33] <DagoRed> I think you're thinking too much about it because until the software does anything nobody gives a damn. Nothing like copying a project that doesn't build.
[11:30:06] <z64555> heh
[11:49:05] <DagoRed> z64555: Why not used a matrix library?
[11:49:44] <DagoRed> z64555: Look into Eigen.
[11:49:51] <DagoRed> .g eigen matrix library c++
[11:49:52] <makepi> DagoRed: http://eigen.tuxfamily.org/
[11:55:46] <veverak> yeah
[11:55:52] <veverak> any tips for friendly library for C++ for math?
[11:56:03] <DagoRed> what kind of math?
[11:56:05] <veverak> vectors/goniometric/quaternions
[11:56:17] <veverak> aaaaaand
[11:56:18] <DagoRed> Fun stuff! Eigen
[11:56:37] <veverak> and linear interpolarization
[11:56:39] <veverak> :)
[11:56:40] <DagoRed> It supports Neon which means arm boards will have their math instruction set used.
[11:57:19] <DagoRed> http://eigen.tuxfamily.org/dox/classEigen_1_1Quaternion.html
[11:57:35] <DagoRed> Props... most people don't know what quaternions are!
[11:57:37] <DagoRed> .info
[11:57:37] <veverak> cool
[11:57:38] <makepi> DagoRed: Eigen: Quaternion< Scalar, Options > Class Template Reference- http://j.mp/1oSjBCT
[11:57:45] <veverak> DagoRed: I don't know either
[11:57:52] <veverak> I just know that I want to use them
[11:57:52] <DagoRed> .... Oh...
[11:57:54] <veverak> :D
[11:58:02] <DagoRed> Ok... in a nutshell...
[11:58:02] <veverak> well, I use them instead of euler angles
[11:58:16] <veverak> sort of vector + rotation around the vector if I understand correctly
[11:58:33] <DagoRed> Quaternions are a 4 dimensional represenatation of 3 dimentional system.
[11:58:42] <veverak> yeah
[11:59:22] <DagoRed> Why is that important? It allows for algorthims in control theory to not get stuck in singularities of a 3 dimensional coordinate system to relate and flip about the 4th axi.
[11:59:24] <DagoRed> *axis.
[11:59:48] <DagoRed> Essentially the single most important aspect needed for optimal and robust control theory.
[12:00:06] <veverak> yeah, I know the fact that it avoids gimbail lock
[12:00:09] <veverak> :)
[12:00:25] <DagoRed> By using quaternions a friend of mine did a Ph.D thesis on how to have a proper launch of the space shuttle with complete rudder failure.
[12:00:33] <veverak> DagoRed: it's not like I am completely not aware what is going on
[12:00:48] <DagoRed> Nope, but now you have the more formal explanation :)
[12:00:57] <veverak> it's more like i don't feel like saying I know exactly what is going on
[12:01:00] <veverak> :)
[12:01:04] <DagoRed> true
[12:01:29] <DagoRed> Anyway, Eigen is the library to play with.
[17:08:54] <z64555> for example, x, y, z, w
[17:09:04] * z64555 scrolls down
[17:09:05] <z64555> doh
[17:09:35] <z64555> Well, good thing I was fiddling with R, I found that I had Q[0][1] wrong
[17:11:47] <z64555> oh, I remember reading somewhere comparing quaternion ops with matrix ops
[17:12:59] <z64555> depending on the operation, matrices do better in some areas while quaternions do better in others, in terms of number of CPU cycles to compute the operation
[17:13:36] <z64555> in particular, translational operations were perfermed better in matrices
[17:20:28] <z64555> R is most likely I * σ^2
[17:24:47] <z64555> Q was derived from G, a vector that was multiplied to the random acceleration scalar, a, to map it into x and v
[17:26:03] <z64555> For my sensors, I have both a position sensor (from cosine of the accelerometer and the gravity vector) and a velocity sensro
[17:26:19] <z64555> which have H as an identity matrix
[17:29:03] <z64555> so, the R matrix gain is also the identity
[22:30:08] <z64555> hm. think I'm done coding the kalman filter for now
[22:30:12] <z64555> onto other bits
[22:32:49] <DagoRed> nice
[22:40:41] <z64555> C still complains about me trying to pass the float[][] to functions that are declared with matrices, but it compiles fine
[22:42:38] <z64555> oo, GNU Scientific library looks interesting
[22:43:45] <z64555> requires *nix libraries, it seems
[22:43:54] <DagoRed> did you look at Eigen?
[22:44:23] <z64555> Yeah, it looks promising, but I'd like to stick with C if I can
[22:48:14] <z64555> 'course I could be shooting myself in the foot with that decision. lol
[22:49:50] <DagoRed> Understood.
[22:50:32] <DagoRed> z64555: I can't remember, are you using vector at all?
[22:50:42] <DagoRed> No wait... that's C++ as well.
[23:03:29] <z64555> meh, there's a gcc for my old chip, so there's nothing stopping me from using C++
[23:03:46] <MrCurious> anyone here tried BrainOS?
[23:03:56] <MrCurious> https://github.com/braincorp/brainos_wiki/wiki/BrainOS-Beta-Overview%3A-How-Apps-Work
[23:04:04] <z64555> means I can't use Codewarrior, but honestly there's nothing to brag about it
[23:05:48] <z64555> hm? whats this note here on Eigen being GCC 4.4 and newer?
[23:06:59] <DagoRed> Oh.. they were affected by glibC
[23:25:59] <z64555> ah, nice, looks like it was resolved in 2009
[23:26:08] <z64555> if not, then I can complain in their ear :)
[23:26:21] <DagoRed> lol
[23:29:56] <z64555> huh, I wonder what blas is doing in there
[23:45:56] * z64555 initiates the conversion to .cpp