Fawkes API  Fawkes Development Version
environment.h
1 
2 /***************************************************************************
3  * environment.h - Fawkes to OpenRAVE Environment
4  *
5  * Created: Sun Sep 19 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.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __PLUGINS_OPENRAVE_ENVIRONMENT_H_
24 #define __PLUGINS_OPENRAVE_ENVIRONMENT_H_
25 
26 #include "types.h"
27 
28 #include <openrave/openrave.h>
29 #include <string>
30 
31 namespace OpenRAVE {
32  class EnvironmentBase;
33  class RobotBase;
34 }
35 
36 namespace fawkes {
37 #if 0 /* just to make Emacs auto-indent happy */
38 }
39 #endif
40 
41 class Logger;
42 class OpenRaveRobot;
43 
44 /** OpenRaveEnvironment class */
46 {
47  public:
50  virtual ~OpenRaveEnvironment();
51 
52 
53  virtual void create();
54  virtual void destroy();
55 
56  virtual void set_name(const char* name);
57 
58  virtual void enable_debug(OpenRAVE::DebugLevel level=OpenRAVE::Level_Debug);
59  virtual void disable_debug();
60 
61  virtual void start_viewer();
62  virtual void load_IK_solver(OpenRaveRobotPtr& robot, OpenRAVE::IkParameterizationType iktype=OpenRAVE::IKP_Transform6D);
63  virtual void run_planner(OpenRaveRobotPtr& robot, float sampling=0.01f);
64  virtual void run_graspplanning(const std::string& target_name, OpenRaveRobotPtr& robot, float sampling=0.01f);
65 
66  virtual void add_robot(const std::string& filename);
67  virtual void add_robot(OpenRAVE::RobotBasePtr robot);
68  virtual void add_robot(OpenRaveRobotPtr& robot);
69 
70  virtual bool add_object(const std::string& name, const std::string& filename);
71  virtual bool delete_object(const std::string& name);
72  virtual bool delete_all_objects();
73  virtual bool rename_object(const std::string& name, const std::string& new_name);
74  virtual bool move_object(const std::string& name, float trans_x, float trans_y, float trans_z);
75  virtual bool move_object(const std::string& name, float trans_x, float trans_y, float trans_z, OpenRaveRobotPtr& robot);
76  virtual bool rotate_object(const std::string& name, float quat_x, float quat_y, float quat_z, float quat_w);
77  virtual bool rotate_object(const std::string& name, float rot_x, float rot_y, float rot_z);
78 
79  virtual void clone_objects(OpenRaveEnvironmentPtr& env);
80 
81  //virtual RobotBasePtr getRobot() const;
82  virtual OpenRAVE::EnvironmentBasePtr get_env_ptr() const;
83 
84  private:
85  fawkes::Logger* __logger;
86 
87  std::string __name;
88  std::string __name_str;
89 
90  OpenRAVE::EnvironmentBasePtr __env;
91  OpenRAVE::PlannerBasePtr __planner;
92  OpenRAVE::ModuleBasePtr __mod_ikfast;
93 
94  boost::thread* __viewer_thread;
95  bool __viewer_running;
96 
97  std::vector<OpenRAVE::GraphHandlePtr> __graph_handle;
98 
99  virtual const char* name() const;
100 
101 };
102 } // end of namespace fawkes
103 
104 #endif
Fawkes library namespace.
OpenRaveEnvironment class.
Definition: environment.h:45
RefPtr<> is a reference-counting shared smartpointer.
Definition: refptr.h:49
Interface for logging.
Definition: logger.h:34