#robotics Logs
Sep 07 2017
#robotics Calendar
12:04 AM rue_house: less code to maintain
12:14 AM rue_house: should I ditch the project() fn for the 2d library?
12:14 AM rue_house: I cant think of a reason to project a 2d array into a 1d
12:29 AM anonnumberanon: I use Linux to make copies of disk partitions if I want to move installations to other disks.
12:29 AM anonnumberanon: Then usually the Windows bootloader breaks or gets nuked and I use a Windows install USB and do a few commands such as fixboot.
12:29 AM rue_house: yay! the 2d pointgroup library works!
12:29 AM anonnumberanon: Always install Windows first.
12:29 AM anonnumberanon: I gotta do a voice recognition app for work.
12:31 AM rue_house: yea
12:31 AM rue_house: I need one that I can put on a device I talk into at a reasonable speed and it can repeat back to people slowly, repeating as many times as they need while I carry on with my life
12:32 AM rue_house: its 50/50 half the time they cant understand the rate I'm talking at, and half the time they cant grasp what I'm saying
12:33 AM anonnumberanon: it could also sort the stuff you say into two groups, the babbling and the reasonable
12:33 AM rue_house: #define __frustrating__
12:33 AM rue_house: well, I been thinking a lot about it
12:33 AM anonnumberanon: ^that's babbling
12:33 AM rue_house: one part of speech is the vocal tone, but thats not important, the rest is noise
12:34 AM anonnumberanon: ^that's reasonable
12:34 AM rue_house: so, you need someting that can classify and reproduce white and pink noise
12:34 AM anonnumberanon: can you speak slower, or repeat pls?
12:34 AM * rue_house throws a chair at anonnumberanon
12:34 AM rue_house: NO
12:35 AM anonnumberanon: Mycroft
12:35 AM * anonnumberanon goes to get a drinku
12:35 AM rue_house: there is a lady in town by the nickname of "mile a minute Marrion", she can hit autioneer speeds when she talks, and I can understand her just fine,
12:36 AM rue_house: one day I did a test and replied back to her at the same speed, and she got it all just fine
12:36 AM rue_house: she's about 75
12:37 AM rue_house: auctioneer
12:38 AM rue_house: :) had to write a library for my library
12:38 AM rue_house: weeeeeee
12:38 AM anonnumberanon: ^babbling again
12:39 AM anonnumberanon: oops sorry my bot said that
12:39 AM anonnumberanon: i have to tune down the setting
12:39 AM rue_house: I'll have yo know I'm the only one around to talk to for like 90% of my life
12:39 AM rue_house: the sound of even my own voice is kinda nice
12:39 AM anonnumberanon: I read IRC outloud.
12:39 AM rue_house: I'm not going crazy, I always been this way
12:39 AM rue_house: kjasflkjaslk;dfjl;ksajdflkjsdf sdfkjlsk;djf
12:40 AM rue_house: good luck on that
12:40 AM rue_house: :)
12:40 AM anonnumberanon: i can just yell for that one
12:40 AM anonnumberanon: like goats that sound like humans
12:40 AM anonnumberanon: https://www.youtube.com/watch?v=PpccpglnNf0
12:57 AM rue_house: ok, so the goal is to take 2 sets of points, one is a scale, translate and rotate of the other
12:57 AM rue_house: and figure out how to match them
12:58 AM anonnumberanon: what is the rotation function
12:58 AM anonnumberanon: what is the translation function
12:58 AM anonnumberanon: provide data sample
01:07 AM rue_house: point2d_t * rotatez (point2d_t *p, double by) ;
01:07 AM rue_house: do you know what I mean tho?
01:07 AM rue_house: 3 points? a scale and translate and rotat of each other?
01:08 AM rue_house: how about a practical example
01:08 AM rue_house: lets say I have a drill file for a pcb
01:08 AM rue_house: and I have a mill with the pcb arbitrarily placed
01:08 AM rue_house: I tell the mill where 3 of the holes should be
01:08 AM rue_house: it knows the 3 holes from the drill file
01:09 AM rue_house: so it has to work out the position and rotation between the actual pcb and the drill file
01:09 AM rue_house: and maybe the scale
01:09 AM rue_house: cause by then, whatever
01:09 AM anonnumberanon: yeah easy
01:10 AM rue_house: tell me how you would do it
01:10 AM rue_house: I know how I'm gonan do it
01:10 AM anonnumberanon: first figure out the translation and rotation to do, then use it on every point, then drill the points that are rotatedtranslated
01:13 AM rue_bed: yea, refine that first step
01:13 AM anonnumberanon: there is no recognizable position?
01:13 AM anonnumberanon: just points?
01:13 AM rue_bed: yup
01:13 AM anonnumberanon: so the pcb was drilled already, 3 points, and then the whole pcb was moved a little, and you want to keep it in place and keep drilling, but with different points now since the original list of points won't be at the right positions?
01:16 AM rue_bed: no, the pcb was just placed anyhow on the table, the system was told where 3 of the points are
01:17 AM anonnumberanon: what if the holes to drill have 2 sets of 3 points that are exactly spaced out the same from each other, as in the same exact triangle?
01:17 AM anonnumberanon: then you're fugged
01:18 AM rue_bed: nope
01:18 AM rue_bed: not if you give it 3 registration points that are identified in the file
01:20 AM rue_house: have to stop leaving files open everywhere...
01:20 AM anonnumberanon: there is no such thing for a hole
01:20 AM anonnumberanon: a hole is a hole
01:21 AM synja: hey!
01:21 AM synja: that's my motto
01:23 AM anonnumberanon: so how would you do it rue_house ?
01:23 AM rue_house: - find the centroid of each
01:23 AM rue_house: (you get two triangles in)
01:24 AM rue_house: then make sure their both in clockwise order (no flipping one triangle!)
01:24 AM rue_house: then work out the angles between the points from the centroid
01:25 AM rue_house: work out the translation to match the centroids
01:25 AM rue_house: match up the angles and thats the rotation req'd
01:26 AM rue_house: then take two points (as you by then know who's who) and get the distance, get a scale to match it
01:26 AM rue_house: then your done
01:26 AM anonnumberanon: very good
01:26 AM anonnumberanon: how how to use it in real robot life
01:27 AM rue_house: I'v just been meaning to make a pcb driller for years now
01:27 AM rue_house: need that code
01:27 AM rue_house: it will likley come up in all sorts of things
01:28 AM rue_house: 3d versions are good for locating yourself in a starchart
01:28 AM anonnumberanon: if i write it will you make me a pcb driller and ship it to me too?
01:28 AM rue_house: no
01:28 AM rue_house: but I'll finish writing it, give you the code and you can make your own
01:29 AM rue_house: point2d_t * centroid (point2d_t *c, point2d_t this, point2d_t that, point2d_t other) {
01:29 AM rue_house: c->x = (this.x)+(that.x)+(other.x)/3;
01:29 AM rue_house: c->y = (this.y)+(that.y)+(other.y)/3;
01:29 AM rue_house: return c;
01:29 AM rue_house: }
01:29 AM rue_house: today I wrote a centroid fn
01:29 AM rue_house: :)
01:29 AM rue_house: verrry difficult math
01:29 AM rue_house: haha which I blew
01:29 AM rue_house: c->x = ((this.x)+(that.x)+(other.x))/3;
01:29 AM rue_house: c->y = ((this.y)+(that.y)+(other.y))/3;
01:30 AM rue_house: lets try that
01:30 AM anonnumberanon: wats the maf formula?
01:31 AM rue_house: triangle centroid
01:32 AM anonnumberanon: http://www.dummies.com/education/math/trigonometry/how-to-pinpoint-the-center-of-a-triangle/
01:33 AM anonnumberanon: seems fun
01:34 AM anonnumberanon: 1) find the coordinates of the middle of a side, then do it again for a 2nd side
01:34 AM anonnumberanon: 2) from those middles to the opposite vertex, draw lines (note the line's equation)
01:34 AM anonnumberanon: 3) the intersection of those 2 lines is the centroid
01:35 AM anonnumberanon: so ax + b = cx + d
01:35 AM anonnumberanon: is the equation that needs to be solved
01:35 AM anonnumberanon: if those are the 2 equations of the lines
01:36 AM anonnumberanon: (each side is one)
01:36 AM KimK is now known as KimK_
01:36 AM KimK_ is now known as KimK
01:36 AM anonnumberanon: it is easy to then see that the point is at x = (d-b) / (a - c)
01:37 AM anonnumberanon: then plug in x into either equation to get y
01:39 AM anonnumberanon: your code really is a trick to get the centroid? just get the average of the 3 x coordinates then same for y?
01:39 AM anonnumberanon: rue_house,
01:41 AM rue_house: work out the math if you like
01:41 AM anonnumberanon: not really
01:42 AM anonnumberanon: but it's nice
01:44 AM rue_house: find me some example data so I can test the centroid fn
01:46 AM anonnumberanon: one triangle?
01:46 AM rue_house: yea
01:47 AM anonnumberanon: k
01:47 AM anonnumberanon: hang on
02:02 AM anonnumberanon: geez it's not trivial
02:03 AM rue_house: no online solved examples?
02:03 AM anonnumberanon: I'm doing the math.
02:04 AM * rue_house coughs "librecad"
02:05 AM anonnumberanon: if i do the math that means I'll have a good proof to turn into code later if need be
02:07 AM rue_house: geez, I think there are more lines of errors than lines of code...
02:11 AM orlock: The two are not mutually exclusive
02:11 AM orlock: Went downstairs to assist the mech. engineering lead here with stuff
02:11 AM orlock: he had an ESP8266 in his bag heh
02:11 AM rue_house: :)
02:11 AM orlock: i think there's more wireless microcontrollers in this building than there are people
02:12 AM Luminax-Work is now known as LuminaxWk
02:12 AM polprog: that's possible
02:13 AM orlock: Entirely possible. especially if we actually use them for something
02:13 AM orlock: (Because then it would be warehouse stock)
02:13 AM orlock: There's def. more Nema23's than people
02:14 AM orlock: fuck i should have checked the bin before it rained
02:16 AM rue_house: you got rain!?
02:16 AM rue_house: I want rain too!
02:16 AM orlock: It's just gone spring, it's been pissing down
02:20 AM orlock: one of the engineers had a 3d printed marble run on his desk
02:20 AM orlock: pretty cool
02:28 AM anonnumberanon: rue_house, (2, 1) (1, 10) (10, 8)
02:28 AM anonnumberanon: what do you get for this?
02:28 AM anonnumberanon: this triangle?
02:29 AM anonnumberanon: 2 1 1 10 10 8
02:29 AM anonnumberanon: that should be a better input data format
02:30 AM rue_house: centroid: 4.333, 6.333
02:30 AM rue_house: setPoint (&p1, pt(2,1));
02:30 AM rue_house: setPoint (&p2, pt(1,10));
02:30 AM rue_house: setPoint (&p3, pt(10,8));
02:30 AM rue_house: printf("centroid: %s \n", point2s( s, 254, centroid(&p, p1, p2, p3)));
02:31 AM anonnumberanon: I get = (3.68, 4.85)
02:31 AM anonnumberanon: I think I may be wrong in my math.
02:32 AM anonnumberanon: (because on the drawing it looks like not that)
02:33 AM rue_house: https://www.easycalculation.com/analytical/centroid.php
02:33 AM anonnumberanon: yeah your coordinates look correct on my drawing, they have to be right
02:33 AM rue_house: https://www.easycalculation.com/analytical/centroid.php
02:33 AM rue_house: https://www.easycalculation.com/analytical/centroid.php
02:33 AM rue_house: https://www.easycalculation.com/analytical/centroid.php
02:33 AM rue_house: https://www.easycalculation.com/analytical/centroid.php
02:34 AM anonnumberanon: let me see your code?
02:38 AM rue_house: k
02:38 AM rue_house: point2d_t * centroid (point2d_t *c, point2d_t this, point2d_t that, point2d_t other) {
02:38 AM rue_house: c->x = ((this.x)+(that.x)+(other.x))/3;
02:38 AM rue_house: c->y = ((this.y)+(that.y)+(other.y))/3;
02:38 AM rue_house: return c;
02:38 AM rue_house: }
02:39 AM anonnumberanon: no a fully compilable test cast pls
02:39 AM anonnumberanon: I'm not copying down all these lines and fixing the code file for it to compile.
02:39 AM rue_house: hahah
02:39 AM rue_house: its split over like 4 libraries
02:40 AM anonnumberanon: Here we go again.
02:40 AM rue_house: oh piff, I'll just tar it sup
02:40 AM anonnumberanon: My first hate in programming.
02:40 AM rue_house: I build bricks
02:40 AM rue_house: sorry, makes projects go togethor really fast, complex ones
02:42 AM anonnumberanon: yeah but does it calculate the centroid correctly?
02:42 AM rue_house: gcc *.c -lm
02:42 AM rue_house: http://ruemohr.org/~ircjunk/programming/c/transform2d.tgz
02:43 AM rue_house: http://www.mathopenref.com/coordcentroid.html
02:43 AM anonnumberanon: oh: http://www.mathopenref.com/coordcentroid.html
02:43 AM anonnumberanon: the formula is right yeah
02:43 AM rue_house: anonnumberanon, welcome back
02:44 AM anonnumberanon: conclusion i shouldnt try to do algebra at 3 in the morning
02:44 AM anonnumberanon: basic algebra
02:44 AM rue_house: now, the next question
02:44 AM rue_house: why is my inscribed angle negitive!?
02:44 AM rue_house: and mor than 180 degrees
02:46 AM anonnumberanon: ok i rechecked my math and still the same, I'm gonna stop now
02:47 AM rue_house: hmmmm
02:49 AM rue_house: maybe my cart2polar needs work
03:03 AM rue_house: AHA
03:04 AM rue_house: http://paste.debian.net/984905/
03:04 AM rue_house: after 180, it snaps to negitive angles
03:05 AM anonnumberanon: why
03:11 AM rue_house: (*p).y = rad2deg(atan2(cart.y, cart.x));
03:14 AM rue_house: correcting it dosn't seem to have broken my other function that does the robot positioning
03:14 AM rue_house: oh
03:14 AM rue_house: anonnumberanon, there is a gold nugget in that tar file
03:14 AM rue_house: test 7
03:14 AM rue_house: its the absolute robot positioning function
03:15 AM rue_house: you give it the angles of 3 beacons of known position around a robot, and it tells you the robots position
03:15 AM anonnumberanon: it's good stuff?
03:15 AM rue_house: the limit is that the robot MUST lie in the triangle of the beacons
03:15 AM rue_house: do you understand?
03:15 AM rue_house: its this...
03:16 AM rue_house: http://ruemohr.org/~ircjunk/robots/abspos/problem.html
03:17 AM rue_house: somewhere I have code to select 3 beacons out of a pallette of a bunch of them
03:18 AM anonnumberanon: yeah just pull it from MobileSuitTech on Github ;)
03:18 AM rue_house: its angle based lidar
03:19 AM rue_house: anyhow, thats what test7 is
03:19 AM rue_house: in the 2d.c file
03:19 AM anonnumberanon: ok cool
03:23 AM rue_house: PointCount: 3
03:23 AM rue_house: -1.000, -1.000
03:23 AM rue_house: 1.000, 1.000
03:23 AM rue_house: 0.000, -1.000
03:23 AM rue_house: -160.559965
03:23 AM rue_house: 143.130102
03:23 AM rue_house: -56.309932
03:23 AM rue_house: why is the sign of one of the inscribed angles comming up opposite
03:25 AM anonnumberanon: that reminds me of the pain it was to debug the am pm to 24h time translating program
03:25 AM rue_house: hah
03:26 AM rue_house: yea, clock time is insane when you put it under a micrcoscope
03:26 AM rue_house: 12 < 11
03:26 AM anonnumberanon: all it does is made me realize how weird am and pm is
03:27 AM anonnumberanon: compared with 00:00 to 23:59
03:31 AM rue_house: I cant... understand... this...
03:31 AM rue_house: 77.000, 100.000
03:31 AM rue_house: 168.974, 100.304
03:31 AM rue_house: 123.250, 20.500
03:31 AM rue_house: -119.999889
03:31 AM rue_house: 120.000203
03:31 AM rue_house: -119.999909
03:31 AM anonnumberanon: does your lego brick have 6 or 8 studs
03:31 AM rue_house: tahts from the drafting program, the angles are ~120
03:31 AM rue_house: but...
03:32 AM rue_house: why are the signs different
03:32 AM anonnumberanon: my prog?
03:32 AM rue_house: the sign should indicate the direction the angle is drawn out in
03:32 AM rue_house: no, its my inscribed() fn
03:32 AM rue_house: its supposed to tell me the inscribed angle of 3 points
03:44 AM rue_house: I'm not correcting the result properly
03:45 AM rue_house: http://paste.debian.net/984910/
03:45 AM anonnumberanon: yeah that's it man
03:45 AM rue_house: if the angles comes out to more than 180, I take the opposite angle
03:45 AM rue_house: which isn't right
03:46 AM rue_house: how do you know which point, of two on an inscribed angle, is more clockwise than the other?
03:48 AM anonnumberanon: draw it?
03:50 AM rue_house: I might not have enough brainpower tonight for this
03:50 AM rue_house: its going to be about adjusting the sign
03:51 AM rue_house: if I ahve to reverse the angle, I know the ...
03:51 AM rue_house: points lie over the 0 degre mark
03:51 AM rue_house: in reverse
04:38 AM anonnumberanon: bed
06:54 AM orlock: rue: https://github.com/esp8266/Arduino/blob/master/doc/esp8266wifi/udp-examples.rst
06:55 AM orlock: that works
06:55 AM orlock: i think i barely need to modify it for my needs
09:13 AM rue_house: ok, so then all I need to work out is how to reload the firmware on it
09:14 AM orlock: on the esp?
09:14 AM orlock: should have buttons, one for flash one for reset?
09:14 AM orlock: or is it one of the esp07's?
09:44 AM rue_house: AAAAAAAAAARRRRRRRRRRRGGGGGGGGGG
09:44 AM rue_house: cant get this damn accute fn to work properly
12:19 PM kristhian: Any tips on how to build my own robot? Or how to start building one?
12:20 PM synja: learn about microcontrollers, servos, serial communication & programming
12:20 PM synja: kristhian,
12:20 PM synja: i think there are kits out there that can teach you all of them at once
12:21 PM kristhian: Ok, ill try to learn the basics first
12:22 PM synja: the basics are always a self-proving predicate ;)
12:25 PM SpeedEvil: kristhian: probably a first reasonable step is to think carefully about goals.
12:26 PM SpeedEvil: What are you doing this for - to have a working robot, or to learn about robotics, or to have a way to do a given task.
12:26 PM SpeedEvil: In some cases, a special purpose machine may be enormously cheaper, for example.
12:32 PM kristhian: Actually it's just for a hobby, curious on how does it works and made
12:33 PM kristhian: So i guess wanted to build a working robot and to learn as well
12:35 PM deshipu: kristhian: we don't even know what you mean by "robot", it's a very wide category
12:39 PM synja: don't be pedantic guys
12:40 PM synja: the connotation of what she asked for can be easily inferred
12:40 PM synja: she/he*
12:49 PM SpeedEvil: Not being pedantic - thinking about what you want is a good step going in.
12:50 PM SpeedEvil: kristhian: what do you already know? programming, electronics, ...
12:52 PM kristhian: Actually zero knowledge, with both programming and electronics
12:56 PM SpeedEvil: Arduino is a popular way in to programmable electronics, and you can hook up various motors and ... to it with external boards
12:57 PM SpeedEvil: http://www.instructables.com/id/James-Your-first-Arduino-Robot/ is probably representative
12:57 PM kristhian: Ok, i think ill do that
12:58 PM kristhian: And sorry btw, does lacking of knowledge in both programmimg and electronics sounds stupid?
12:58 PM kristhian: Then jumping into robotics
12:58 PM SpeedEvil: Nope
12:59 PM weyland|yutani: but its hard
12:59 PM polprog: you have to start somewhere
12:59 PM polprog: there's a big mistake you can make and you have to be cautious though
01:00 PM synja: And sorry btw, does lacking of knowledge in both programmimg and electronics sounds stupid?
01:00 PM SpeedEvil: all-in-one kits may not teach you miuch
01:00 PM synja: yes
01:00 PM synja: but that doesn't mean you shouldn't learn it
01:00 PM polprog: dont jump into the deep water at the very beginning, start with simple things, robotics, and tech in general, can become very frustrating if you dont understand it
01:02 PM * weyland|yutani looks at his FPGA books smiles that weird smile and dumps them back into his drawer
10:34 PM orlock: Got traffic flowing across the serial - wireless - serial bridge
10:35 PM orlock: It's not "working" though. i'll have to add a softwareserial port and dump the packets that arrive at the other end
10:54 PM youngiif: orlock: i'm just tuning it, but you piqued my interested, what sort of wireless serial bridge are you working on?
10:54 PM youngiif: just tuning in*
10:54 PM orlock: esp8266 on each side, sending data via UDP
11:02 PM youngiif: i hadn't seen those (i'm new to this stuff), but it looks like something I could definitely use
11:10 PM orlock: youngiif: The purpose is to act as a remote control for a robot. INput/control device handheld, and the other eides on a robot with serial interface
11:18 PM youngiif: orlock: yeah right now I connect to my motor controller via usb and send serial commands via python; I'm thinking I may be able to use one of these to bypass the usb cable?
11:19 PM orlock: youngiif: Thats what i was doing during testing
11:19 PM orlock: even had the ESP8266 talking to python at one point
11:20 PM orlock: youngiif: What sort of motor controller?
11:20 PM youngiif: ahh, i wonder what sort of latency the wireless introduces
11:20 PM youngiif: Roboclaw
11:21 PM orlock: Interesting, havent heard of that one - I'm using a TReX
11:21 PM youngiif: http://www.ionmc.com/RoboClaw-2x30A-Motor-Controller_p_9.html
11:21 PM orlock: <10ms it seems
11:23 PM orlock: youngiif: i made my own quadrature encoder wheel setup for the "input" side
11:23 PM youngiif: these are very nice little devices, they're a bit pricey compared to what you could probably build your own for, but my time is worth a lot more than that to me so I use these
11:23 PM alic1a: orlock: What is put in, taken in, or operated on by any process or system. perceptions and sensory input
11:24 PM orlock: youngiif: Yeah, the device i'm using was $100 a decade ago. it's STILl selling for $100
11:25 PM youngiif: orlock, that sounds nice, what sort of resolution do you get? I'm using some encoders from CUI inc., I've been really pleased with them, at around $20 each, I get millions of pulses per second, so pretty amazing resolution
11:26 PM youngiif: orlock, it looks like the TReX is very similar to the controller I'm using
11:26 PM orlock: 144 pulses per revolution
11:26 PM orlock: and i'm turning it by hand
11:27 PM orlock: i printed the encoder wheel and brackets, etc. Using optical inturruptors i bought for my 3d printer for the encoders
11:27 PM orlock: http://en.crypt.net.au/Controller/
11:28 PM youngiif: ah nice!
11:29 PM youngiif: i tried to use some hall effect encoders and there was just too much noise in the line that the circuitry i had to build to make it work right wasn't worth it, so i just switched to optical encoders, couldn't be happier
11:32 PM youngiif: the problem i may run into with the esp8266 is that my controller uses a 10ms timeout to clear it's command buffer, so if i issued a command and then went to read the result, and that gap was >10ms, I'd be out of luck
11:33 PM orlock: Ahh, i treat mine as unidirectional basically
11:36 PM orlock: i will be doing bidirectional comms to the motor controller to the esp8266
11:36 PM orlock: but from the hand controller across the wireless will only be unidirectional
11:37 PM orlock: The motor controller has a set of analog inputs you can poll via serial, so i'll try and use that for edge detection - but that data wont need to go back across the wireless link
11:37 PM youngiif: that makes sense
11:38 PM orlock: the hand-controller would not have anything to do with it anyway
11:38 PM orlock: (though an LED or haptic buzer is tempting)
11:41 PM youngiif: mind me asking what you're building?