#robotics Logs

Nov 06 2018

#robotics Calendar

12:28 AM rue_mohr: ok I need to write a world-to-screen and screen-to-world co-ord translator
12:32 AM rue_mohr: --
01:12 AM rue_mohr: so, the question is, when your zooming into the mouse location, what are you doing
01:12 AM rue_mohr: you obviously increasing the zoom level
01:12 AM rue_mohr: everyone in the world is dead dude
01:13 AM rue_mohr: I'd like to keep ignoring that if you dont mind
01:13 AM rue_mohr: ok, I just wanted to make sure you knew
01:13 AM rue_mohr: yea, I'm trying to not be depressed
01:13 AM rue_mohr: ok, carry on
01:13 AM rue_mohr: you threw me off
01:13 AM rue_mohr: you were saying that obviously the zoom level changes
01:14 AM rue_mohr: yea and then you pointed out that everyone is dead
01:14 AM rue_mohr: right, but you were GOING TO say...
01:14 AM rue_mohr: *sigh* I was going to say that ... uh,..... mouse position
01:15 AM rue_mohr: the model position of the mouse pointer doesn't change
01:15 AM rue_mohr: right
01:15 AM rue_mohr: so we need to translate back and forth
01:15 AM rue_mohr: no, you need to do the math right
01:15 AM rue_mohr: OR just make a mess of transofrmations
01:15 AM rue_mohr: instead of doing it right
01:15 AM Jak_o_Shadows: are you zooming to the mouse location?
01:15 AM rue_mohr: yea, cause you aint tellin me the mathz!
01:15 AM rue_mohr: yea, were zooming in on the mouse location
01:16 AM Jak_o_Shadows: good, thats a really intuitive thing I think
01:16 AM rue_mohr: I'v *just* created the screen2drawing and drawing2screen fn's
01:16 AM rue_mohr: so, in theroy, I get the drawing loc of the mouse, do the zoom, and fix the tralslation to match the mouse loc
01:17 AM Jak_o_Shadows: yeah
01:17 AM rue_mohr: this might be the first peice of software (for me) that would benifit from matrix math
01:17 AM rue_mohr: or a form there in
01:18 AM Jak_o_Shadows: yes
01:18 AM Jak_o_Shadows: 4x4 matrices
01:18 AM rue_mohr: cause I can do the trig calcs once, and apply the results to a list of points
01:18 AM rue_mohr: but the transformations can be arbitrarily applied to different shapes
01:18 AM rue_mohr: and they can be arbitrary transformations
01:19 AM rue_mohr: arbitrary seem to be a new thing
01:19 AM rue_mohr: int main(void) { return doProgram(); }
01:20 AM rue_mohr: #include <softwareThatDoesEverything.h>
01:21 AM rue_mohr: case LINE:
01:21 AM rue_mohr:
01:21 AM rue_mohr: setLineLine (&V.shape.line, E.shape.line);
01:21 AM rue_mohr: transLine (&V.shape.line, pt(viewT.x,viewT.y));
01:21 AM rue_mohr: scaleLine (&V.shape.line, pt(viewZ,-viewZ));
01:21 AM rue_mohr:
01:21 AM rue_mohr: transLine (&V.shape.line, pt(width/2,height/2));
01:21 AM rue_mohr: XDrawLine (dpy, pixmap, gc, V.shape.line.p1.x, V.shape.line.p1.y, V.shape.line.p2.x, V.shape.line.p2.y);
01:21 AM rue_mohr: so far, I have to have unique fn's that do operations on every entity type
01:22 AM rue_mohr: it would be nice if I didn't have to care what it was or what I was doing to it
01:23 AM rue_mohr: Jak_o_Shadows, do you have a good C matrix library?
01:23 AM Jak_o_Shadows: nup
01:23 AM rue_mohr: oh :/
01:23 AM Jak_o_Shadows: at work I think we wrote our own
01:23 AM rue_mohr: well, its on about every 3rd page ont eh internet
01:23 AM rue_mohr: in c++ anyhow
01:23 AM Jak_o_Shadows: It's cause they can be opiniatoed? and we're doing embedded stuff
01:24 AM rue_mohr: somewhere I have FOF (flights of fantasy) and somewhere I have a backup of the cd that came with it
01:24 AM rue_mohr: yea, just a matter of cleaning and phrasing things in a way I like
01:24 AM Jak_o_Shadows: Yeah. We have an in-house matrix library that just has:
01:25 AM rue_mohr: initTransfomation (& transform2d_t)
01:25 AM Jak_o_Shadows: equality, zero, duplicate, identiy matrix, froebenius norm, addtion, subtraction, transpose, scalar multiplication, vector multiplicatin, matrix multiplication, and cholesky factorisation
01:25 AM rue_mohr: TransfomationRotate (& transform2d_t, double z)
01:26 AM rue_mohr: addition AND subtraction?!!?
01:26 AM Jak_o_Shadows: Then there's some stuff which is a bit about UKF's specifically
01:26 AM Jak_o_Shadows: yeah? I mean, otherwise you have to multiply by -1?
01:27 AM Jak_o_Shadows: and i think it was originally written for a platform without hardware floats
01:27 AM rue_mohr: I'd be shooting for translate, rotate, scale, copy, identity
01:27 AM rue_mohr: Jak_o_Shadows, sounds like you do cool stuff! :)
01:27 AM Jak_o_Shadows: It'd be a fun little task
01:27 AM Jak_o_Shadows: I haven't been on that side of things lately, but I am looking forward to doing more in the future
01:28 AM Jak_o_Shadows: But yeah, it is cool
01:28 AM rue_mohr: but then the more important part is like applyTransform(transform2d_t op, point2d_t *list)
01:29 AM rue_mohr: tho, it'd get complex
01:29 AM rue_mohr: things like circles need their radius modified, and I'd have to pull the scale out of the transform, or have it kept kiddycar to the matrix
01:30 AM rue_mohr: AND I'M NOT EVEN GONNA THINK ABOUT THE DAMN ELLIPCICAL ARCS
01:31 AM rue_mohr: ok, this shouldn't be too bad
01:32 AM rue_mohr: I get the drawing loc of the cursor, do the zoom, and get it again, then apply the difference to the tranlsate value
01:32 AM rue_mohr: assuing my translate value is in drawing co-ords
01:33 AM rue_mohr: translate (&viewT, pt(-(x-bevent->x)/viewZ,(y-bevent->y)/viewZ)) ;
01:33 AM rue_mohr: which it must be
01:33 AM rue_mohr: sadly, I'm working myself away from being able to also rotate the view
01:33 AM rue_mohr: I trust these things will become clear later
01:34 AM rue_mohr: :) how many dxf viewers let you rotate tho
01:48 AM rue_mohr: ok its centering the drawing on the mouse loc
01:49 AM rue_mohr: oh!
01:49 AM rue_mohr: wrong variable
01:50 AM rue_mohr: YES!
01:50 AM rue_mohr: that only took 3 days
01:51 AM rue_mohr: screen2model(&b, pt(bevent->x,bevent->y)); // we want to know where the cursor is in drawing terms before the zoom
01:51 AM rue_mohr: if (0) {
01:51 AM rue_mohr: } else if (strcmp (args[0], "down")) { viewZ *= 1.08;
01:51 AM rue_mohr: } else if (strcmp (args[0], "up")) { viewZ *= 0.926;
01:51 AM rue_mohr: }
01:51 AM rue_mohr: screen2model(&a, pt(bevent->x,bevent->y)); // this is where we are after the zoom.
01:51 AM rue_mohr: getOffset (&b, a, b);
01:51 AM rue_mohr: translate (&viewT, b) ;
01:54 AM rue_mohr: I think thats progress for a night
01:57 AM rue_mohr: yay, I'm catching up with the 21 years of procrastination!
01:58 AM rue_mohr: --
01:59 AM rue_mohr: http://paste.debian.net/1050540/
04:08 AM Jak_o_Shadows: sorry rue, i went and dead exercise things
04:08 AM Jak_o_Shadows: I wonder when you hit precision issues
08:32 AM rue_bed: --
09:06 AM rue_mohr: Jak_o_Shadows, their all doubles, so it shouldn't be an issue
09:09 AM rue_mohr: the precision issues with X and its 1/64 of a degree circle resolution hit pretty quick
09:11 AM rue_mohr: oh interesting, X drawing objects that are prettymuch completely clipped out is slow
01:01 PM patr0clus is now known as s3nd1v0g1us
07:33 PM patr0clus is now known as s3nd1v0g1us
09:16 PM rue_mohr: ok
09:16 PM rue_mohr: so, the test of the matrix
09:17 PM rue_mohr: ok, not using the multiply works
09:21 PM rue_mohr: wtf
09:21 PM rue_mohr: how does a 90 degree rotation of 2,2 result in 0,4
09:22 PM orlock: depends on where it was rotating around? what were you expecting?
09:22 PM rue_mohr: oooh, the multiply is backwards
09:23 PM rue_mohr: matrix2d_t * multiplyMatrix2d( matrix2d_t * that, matrix2d_t * this) {
09:23 PM rue_mohr: I had this and that mixed up
09:25 PM rue_mohr: I have to turn it into a library, but
09:26 PM rue_mohr: http://paste.debian.net/1050704/
09:26 PM rue_mohr: its doing quite well
09:26 PM orlock: i printed out a "weak" version of my mounting bracket
09:26 PM orlock: i found a better threading library
09:26 PM rue_mohr: the matricies are STILL slower!
09:26 PM orlock: now OpenSCAD renders faster than it takes to print ;)
09:26 PM rue_mohr: BUT, I can use them to can a series of ops, so, ok
09:27 PM rue_mohr: good show
09:27 PM orlock: there's one thing not right
09:27 PM rue_mohr: why dont you just design them around extrusions like I was showing you?
09:27 PM rue_mohr: ... you got the redesign I slaved over, right??!?!??!
09:28 PM orlock: yes, yes i did, good job
09:28 PM rue_mohr: hmm
09:28 PM orlock: and i'd considered it, but honestly it's just the threads that cause me issues
09:28 PM rue_mohr: no, its a horrid program
09:28 PM rue_mohr: that should render/compile in 1/120 of a second
09:29 PM orlock: the one issue i have is one of the holes is out of place by a few mm at most
09:29 PM rue_mohr: that why i like the dxf thing
09:29 PM rue_mohr: I can position stuff properly
09:29 PM rue_mohr: for sure
09:29 PM orlock: you know how cameras have a threaded hole on the bottom for tripod mount?
09:29 PM rue_mohr: yup
09:29 PM orlock: video cameras have enough hole at the front for anti-rotation
09:29 PM orlock: but still cameras generally dont as a standard
09:30 PM rue_mohr: I'm sad you didn't see the light in the way I was showing ya
09:30 PM orlock: this camera, EOS40D, has a locating hole or two
09:31 PM orlock: rue: http://www.betterbatt.com.au/media/catalog/product/cache/15/image/9df78eab33525d08d6e5fb8d27136e95/b/e/better-batt-bbbg-0001-1.jpg
09:31 PM orlock: big threaded bolt, and then to the left there's the small locating pin
09:31 PM rue_mohr: the only way I can think to track the scale of a transform is to have a unit vector that I measure the length of after the transform
09:32 PM rue_mohr: yup
09:32 PM orlock: i've got the distance from the threaded bolt OK, but the camera doesnt sit square to the mounting plate
09:32 PM orlock: i'll fix it tonight by trial and error - its only a degree or so out
09:32 PM orlock: but it's annoying i cant seem to find a schematic with the location of that pin
09:40 PM rue_mohr: <rue_mohr> I'd be shooting for translate, rotate, scale, copy, identity
09:40 PM rue_mohr: but then the more important part is like applyTransform(transform2d_t op, point2d_t *list)
09:41 PM rue_mohr: I didn't do copy yet
09:46 PM rue_mohr: ok, copy is done
09:49 PM rue_mohr: ok, well... there....
09:56 PM rue_mohr: ok, and *ding* its a library
10:37 PM rue_mohr: I probaly wrote the matrix library casue of the way I have to series apply the transforms to each entity of the drawing everytimes its refreshed
10:37 PM rue_mohr: BUT I should be able to swap in my dxf library soon
11:58 PM rue_mohr: jhahah serves me
11:58 PM rue_mohr: I added all my new stuff to an old version of my 2d library
11:58 PM rue_mohr: hahaha