From 1c219e64d7e98cc622b4fbae8662a578ffc57053 Mon Sep 17 00:00:00 2001 From: Martin Miller Date: Fri, 31 Mar 2017 16:36:05 -0500 Subject: height measurement flags --- src/main.cpp | 9 +++++---- src/main.h | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 1de5b29..c7ed177 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,12 +31,12 @@ double aboveWater(const Quaterniond &q) { Vector3d tip; -#ifdef DOHEIGHT +#ifdef HEIGHT_FROM_ATTITUDE tip << CANOECENTER*3.43, 0, CANOEHEIGHT; tip = q._transformVector(tip); -#else /* ----- not DOHEIGHT ----- */ +#else /* ----- not HEIGHT_FROM_ATTITUDE ----- */ tip[2] = CANOEHEIGHT; -#endif /* ----- not DOHEIGHT ----- */ +#endif /* ----- not HEIGHT_FROM_ATTITUDE ----- */ return tip[2]; } @@ -78,11 +78,12 @@ imgCallback(message &msg, State &mu, Camera &cam, const Quaterniond &q) { if (seenutm && seenpva && seencov) { std::vector z; - +#ifdef MEASURE_HEIGHT measurement_t height; height.z_type = HEIGHT; height.height = aboveWater(q); z.push_back(height); +#endif strcat(msg.image_names[0],".txt"); FILE *fin; diff --git a/src/main.h b/src/main.h index 8235b98..746e187 100644 --- a/src/main.h +++ b/src/main.h @@ -37,7 +37,8 @@ #define CANOECENTER 0.65 /* center of gravity of canoe */ #define CANOEHEIGHT -0.55 #define DOWNSAMPLE 1 /* */ -#define DOHEIGHT /* */ +//#define HEIGHT_FROM_ATTITUDE /* use the attitude to measure the height */ +//#define MEASURE_HEIGHT #if ROS_PUBLISH #include -- cgit v1.1