Fawkes API  Fawkes Development Version
qa_env.cpp
1 
2 /***************************************************************************
3  * qa_env.cpp - QA for OpenRAVE Environment class
4  *
5  * Created: Thu Sep 16 14:50:34 2010
6  * Copyright 2010 Bahram Maleki-Fard, AllemaniACs RoboCup Team
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 // Do not include in api reference
25 ///@cond QA
26 
27 //#include <openrave-core.h>
28 #include <logging/console.h>
29 #include <plugins/openrave/environment.h>
30 
31 #include <cstdio>
32 #include <iostream>
33 #include <vector>
34 
35 using namespace fawkes;
36 using namespace std;
37 
38 void
39 printVector(std::vector<float> &v)
40 {
41  printf("## size:%zu \n", v.size());
42  for (unsigned int i = 0; i < v.size(); i++) {
43  printf("## %u:)%f \n", i, v[i]);
44  }
45 }
46 
47 int
48 main(int argc, char **argv)
49 {
50  printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
51 
52  ConsoleLogger *cl = new ConsoleLogger();
53 
54  //OpenRAVE::RaveInitialize(true); //optional..should be done automatically if not explicitly implemented
55 
57  env = new OpenRaveEnvironment(cl);
58  env->create();
59 
60  env->enable_debug();
61 
62  string robotFile = SRCDIR "/../manipulators/katana.robot.xml";
63  env->add_robot(robotFile);
64 
65  env->lock();
66 
67  env->start_viewer();
68 
69  usleep(1000 * 10000);
70 
71  env->destroy();
72 
73  return 0;
74 }
75 
76 /// @endcond
fawkes::OpenRaveEnvironment::start_viewer
virtual void start_viewer()
Starts the qt viewer in a separate thread.
Definition: environment.cpp:267
fawkes::ConsoleLogger
Interface for logging to stderr.
Definition: console.h:37
fawkes::OpenRaveEnvironment
OpenRaveEnvironment class.
Definition: environment.h:44
fawkes::OpenRaveEnvironment::enable_debug
virtual void enable_debug(OpenRAVE::DebugLevel level=OpenRAVE::Level_Debug)
Enable debugging messages of OpenRAVE.
Definition: environment.cpp:188
fawkes::OpenRaveEnvironment::create
virtual void create()
Create and lock the environment.
Definition: environment.cpp:111
fawkes
Fawkes library namespace.
fawkes::OpenRaveEnvironment::add_robot
virtual void add_robot(const std::string &filename)
Add a robot into the scene.
Definition: environment.cpp:224
fawkes::OpenRaveEnvironment::destroy
virtual void destroy()
Destroy the environment.
Definition: environment.cpp:138