#garfield Logs

Dec 26 2011

#garfield Calendar


08:18 Tom_itx oldstate = oldstate | ((PIND & 0x03)<<2);
08:18 Tom_itx what port is the quadrature on???
11:57 zhanx rue i knoow your not using c++ anymore, so do no longer use struct? but just typedef struct ?
11:59 Tom_itx that sounds right
11:59 zhanx its right but not compatible with c++
11:59 Tom_itx mmm
12:00 zhanx but if i just use struct and not typedef i will be good for both
12:01 Tom_itx so why not then?
12:01 zhanx its what i am using to start laying out the data structure for the slam
12:01 Tom_itx i used struct for c as well
12:01 zhanx still wish i hadn't lost all that code
12:02 Tom_itx just looked..
12:02 Tom_itx hdd crash?
12:02 zhanx yep
12:02 zhanx struct can be used for c also
12:02 Tom_itx i stuff things on my server and other places i really want
12:02 Tom_itx for those reasons
12:02 zhanx guess its personal pref on that, and i gave rue a copy for a backup
12:03 zhanx he lost it too
12:03 Tom_itx linux can't see the files?
12:03 Tom_itx hmm
12:03 zhanx heads crash on the drive
12:03 Tom_itx oh
12:03 zhanx it got screwed up on my trip home from iraq
12:03 Tom_itx i can imagine
12:04 zhanx i can remember the base of what i did, but not all the code for that slam
12:04 Tom_itx i wonder where your next job will take you
12:04 Tom_itx iran maybe?
12:04 zhanx afghanistan
12:04 zhanx congo?
12:05 Tom_itx err N korea
12:05 zhanx syria
12:05 zhanx dont think so
12:06 Tom_itx i forgot how to do bits in a structure
12:06 Tom_itx and what union regs is for
12:09 zhanx been a minute but if i can get my structs right i can do this easy
12:10 Tom_itx format or data?
12:11 zhanx format
12:11 zhanx the data is kind of known
12:12 zhanx 3d XZY, roll,pitch,yaw and time
12:13 Tom_itx stru{datatype 3dxyz; datatype roll; datatype pitch; datatype yaw; datatype time} var
12:14 Tom_itx struct{ sry
12:14 zhanx yep
12:14 zhanx but with a twist
12:15 zhanx struct 3dPoint {
12:15 zhanx float x;
12:15 zhanx float y;
12:15 zhanx float z;
12:15 zhanx };
12:15 zhanx struct 3dRobotOrientation {
12:15 zhanx 3dPoint xRoll;
12:15 zhanx float xSensorAngle;
12:15 zhanx 3dPoint yPitch;
12:15 zhanx float ySensorAngle;
12:15 zhanx 3dPoint zYaw;
12:15 zhanx float zSensorAngle;
12:15 zhanx };
12:16 zhanx still not done tho
12:16 zhanx once the orientation is done i can do the map etc.
12:17 zhanx but i need to get he position of the robot in order to build a map around that
12:17 zhanx brb
12:17 Tom_itx i'm about to head out
12:17 zhanx k
13:14 rue_house zhanx, do you have my point manipluation library?
13:14 rue_house for 3d points?
13:54 zhanx nope
13:57 rue_house !assist programming/c/
13:57 tobbor Possibly http://eds.dyndns.org/~ircjunk/programming/c/
13:57 rue_house 3d.c 3d.h and danstuff.h
14:01 zhanx typedef struct point3d_s <--- yep i figured you did that, i am gonna use the c/c++ compatible version ok?
14:01 rue_house _s is a struct, _t is a type
14:01 rue_house you can make c++ wrappers really easy for all my new code
14:02 zhanx the typedef struct i was talking about
14:02 zhanx :D
14:02 rue_house ??
14:03 rue_house hmm I need to tear the boiler apart
14:03 zhanx the struct declaration in c "typedef struct" is ok but not c++, but struct point3d will work for both
14:03 rue_house then you have to say 'struct' everywehre
14:04 zhanx mute point i am writing in c anyways
14:04 rue_house struct 3d_point myfunction( struct 3dpoint this, struct 3dpoint that, struct 3dpoint theother) { struct 3dpoint myvar1; ...
14:04 zhanx no you dont
14:04 zhanx all thoses structs aren't needed
14:05 rue_house I typedef it so you dont have to say strct eveywhere
14:05 rue_house iirc they are...
14:05 rue_house maybe they changed it?
14:06 zhanx this works fine struct 3dPoint {
14:06 zhanx float x;
14:06 zhanx float y;
14:06 zhanx float z;
14:06 zhanx };
14:07 rue_house keep going tell me if it gives you grief later
14:07 rue_house a struct is not a type, so you cant use it as a datatype, or so used to be the case
14:07 zhanx well i have to declare it as a type after that
14:07 rue_house ugh
14:08 rue_house typedef struct does it all in one go
14:08 zhanx yea i know. that is why i was asking
14:08 zhanx make it in c and do a wrapper for c++ or just do it the hard way
14:09 anx says screw c++ for
14:09 rue_house why the need for c++?
14:10 zhanx no real need for it
14:11 zhanx http://pastebin.com/1Ug0AnVp
14:11 zhanx think i defined my problem good
14:12 zhanx maybe
14:12 rue_house you can define a struct with two points, one set used for position the other for orientatin
14:13 zhanx thinking 3
14:14 rue_house do you want the map to be stationary or the robot? }:)
14:14 zhanx robot stationary on the map :D
14:15 rue_house so when there is motion the map moves, robot is alwasy at 0,0,0
14:16 zhanx yep
14:19 Tom_itx rue_house did you see ^^
14:20 rue_house no
14:20 rue_house I'd rather just forget it all happened
14:20 Tom_itx <Tom_itx> ok rue_house, you're gonna kick yourself
14:20 Tom_itx <Tom_itx> oldstate = oldstate | ((PIND & 0x03)<<2);
14:20 Tom_itx <Tom_itx> what port is the quadrature on???
14:21 Tom_itx changed to PINB and it worked
14:21 rue_house ugh
14:21 Tom_itx :)
14:21 rue_house I think I didn't want to know
18:16 iamturnip http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=IBCVANCO15 - finally my station is sharing data