Fawkes API  Fawkes Development Version
qa_env.cpp
00001 
00002 /***************************************************************************
00003  *  qa_env.cpp - QA for OpenRAVE Environment class
00004  *
00005  *  Created: Thu Sep 16 14:50:34 2010
00006  *  Copyright  2010  Bahram Maleki-Fard, AllemaniACs RoboCup Team
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 <openrave-core.h>
00028 #include <plugins/openrave/environment.h>
00029 #include <logging/console.h>
00030 #include <cstdio>
00031 #include <iostream>
00032 #include <vector>
00033 
00034 using namespace fawkes;
00035 using namespace std;
00036 
00037 void
00038 printVector(std::vector<float> &v)
00039 {
00040   printf("## size:%lu \n", v.size());
00041   for(unsigned int i=0; i<v.size(); i++)
00042   {
00043     printf("## %u:)%f \n", i, v[i]);
00044   }
00045 }
00046 
00047 int
00048 main(int argc, char **argv)
00049 {
00050   printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
00051 
00052   ConsoleLogger* cl = new ConsoleLogger();
00053 
00054   //OpenRAVE::RaveInitialize(true); //optional..should be done automatically if not explicitly implemented
00055 
00056   OpenRaveEnvironment* env;
00057   env = new OpenRaveEnvironment(cl);
00058   env->create();
00059 
00060   env->enable_debug();
00061 
00062   string robotFile = SRCDIR"/../manipulators/katana.robot.xml";
00063   env->add_robot(robotFile);
00064 
00065   env->lock();
00066 
00067   env->start_viewer();
00068 
00069   usleep(1000*10000);
00070 
00071   env->destroy();
00072 
00073   return 0;
00074 }
00075 
00076 
00077 /// @endcond