Fawkes API  Fawkes Development Version
qa_tf_transformer.cpp
00001 
00002 /***************************************************************************
00003  *  qa_tf_transformer.cpp - QA for tf transformer
00004  *
00005  *  Created: Thu Oct 20 18:18:39 2011
00006  *  Copyright  2011  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 // Do not include in api reference
00025 ///@cond QA
00026 
00027 #include <tf/transformer.h>
00028 #include <cstdio>
00029 
00030 using namespace fawkes::tf;
00031 
00032 int
00033 main(int argc, char **argv)
00034 {
00035 
00036   printf("Populating data\n");
00037   Quaternion q(0, 0, 0, 1);
00038   Vector3 v(1, 0, 0);
00039   Transform t(q, v);
00040 
00041   fawkes::Time time;
00042 
00043   StampedTransform st(t, time, "/world", "/robot");
00044 
00045   printf("Setting transform\n");
00046   Transformer transformer;
00047   transformer.set_transform(st);
00048 
00049   printf("Looking up transform\n");
00050   StampedTransform res;
00051   transformer.lookupTransform("/robot", "/world", time, res);
00052 
00053   Quaternion res_q(res.getRotation());
00054   Vector3 res_v(res.getOrigin());
00055   printf("Read transform Q (%f,%f,%f,%f) V (%f,%f,%f)\n",
00056          res_q.x(), res_q.y(), res_q.z(), res_q.w(),
00057          res_v.x(), res_v.y(), res_v.z());
00058   printf("Done\n");
00059 
00060   return 0;
00061 }
00062 
00063 /// @endcond