|
Fawkes API
Fawkes Development Version
|
OpenRaveEnvironment class. More...
#include <>>
Public Member Functions | |
| OpenRaveEnvironment (fawkes::Logger *logger=0) | |
| Constructor. More... | |
| OpenRaveEnvironment (const OpenRaveEnvironment &src) | |
| Copy constructor. More... | |
| virtual | ~OpenRaveEnvironment () |
| Destructor. More... | |
| virtual void | create () |
| Create and lock the environment. More... | |
| virtual void | destroy () |
| Destroy the environment. More... | |
| virtual void | set_name (const char *name) |
| Set name of environment. More... | |
| virtual void | enable_debug (OpenRAVE::DebugLevel level=OpenRAVE::Level_Debug) |
| Enable debugging messages of OpenRAVE. More... | |
| virtual void | disable_debug () |
| Disable debugging messages of OpenRAVE. More... | |
| virtual void | start_viewer () |
| Starts the qt viewer in a separate thread. More... | |
| virtual void | load_IK_solver (OpenRaveRobotPtr &robot, OpenRAVE::IkParameterizationType iktype=OpenRAVE::IKP_Transform6D) |
| Autogenerate IKfast IK solver for robot. More... | |
| virtual void | run_planner (OpenRaveRobotPtr &robot, float sampling=0.01f) |
| Plan collision-free path for current and target manipulator configuration of a OpenRaveRobot robot. More... | |
| virtual void | run_graspplanning (const std::string &target_name, OpenRaveRobotPtr &robot, float sampling=0.01f) |
| Run graspplanning script for a given target. More... | |
| virtual void | add_robot (const std::string &filename) |
| Add a robot into the scene. More... | |
| virtual void | add_robot (OpenRAVE::RobotBasePtr robot) |
| Add a robot into the scene. More... | |
| virtual void | add_robot (OpenRaveRobotPtr &robot) |
| Add a robot into the scene. More... | |
| virtual bool | add_object (const std::string &name, const std::string &filename) |
| Add an object to the environment. More... | |
| virtual bool | delete_object (const std::string &name) |
| Remove object from environment. More... | |
| virtual bool | delete_all_objects () |
| Remove all objects from environment. More... | |
| virtual bool | rename_object (const std::string &name, const std::string &new_name) |
| Rename object. More... | |
| virtual bool | move_object (const std::string &name, float trans_x, float trans_y, float trans_z) |
| Move object in the environment. More... | |
| virtual bool | move_object (const std::string &name, float trans_x, float trans_y, float trans_z, OpenRaveRobotPtr &robot) |
| Move object in the environment. More... | |
| virtual bool | rotate_object (const std::string &name, float quat_x, float quat_y, float quat_z, float quat_w) |
| Rotate object by a quaternion. More... | |
| virtual bool | rotate_object (const std::string &name, float rot_x, float rot_y, float rot_z) |
| Rotate object along its axis. More... | |
| virtual void | clone_objects (OpenRaveEnvironmentPtr &env) |
| Clone all non-robot objects from a referenced OpenRaveEnvironment to this one. More... | |
| virtual OpenRAVE::EnvironmentBasePtr | get_env_ptr () const |
| Get EnvironmentBasePtr. More... | |
OpenRaveEnvironment class.
Class handling interaction with the OpenRAVE::EnvironmentBase class.
This class loads a scene and handles robots/objects etc in it. All calculations in OpenRAVE (IK, planning, etc) are done based on the current scene.
Definition at line 43 of file environment.h.
| fawkes::OpenRaveEnvironment::OpenRaveEnvironment | ( | fawkes::Logger * | logger = 0 | ) |
Constructor.
| logger | pointer to fawkes logger |
Definition at line 71 of file environment.cpp.
References set_name().
| fawkes::OpenRaveEnvironment::OpenRaveEnvironment | ( | const OpenRaveEnvironment & | src | ) |
Copy constructor.
This also clones the environment in OpenRAVE, including all bodies! BiRRT planner and IKFast module are also created.
| src | The OpenRaveEnvironment to clone |
Definition at line 82 of file environment.cpp.
References fawkes::Logger::log_debug(), and set_name().
|
virtual |
|
virtual |
Add an object to the environment.
| name | name that should be given to that object |
| filename | path to xml file of that object (KinBody) |
Definition at line 635 of file environment.cpp.
References fawkes::Logger::log_warn().
|
virtual |
Add a robot into the scene.
| filename | path to robot's xml file |
Definition at line 224 of file environment.cpp.
References fawkes::Logger::log_debug().
Referenced by add_robot().
|
virtual |
Add a robot into the scene.
| robot | RobotBasePtr of robot to add |
Definition at line 204 of file environment.cpp.
References fawkes::Logger::log_debug().
|
virtual |
Add a robot into the scene.
| robot | pointer to OpenRaveRobot object of robot to add |
Definition at line 248 of file environment.cpp.
References add_robot().
|
virtual |
Clone all non-robot objects from a referenced OpenRaveEnvironment to this one.
The environments should contain the same objects afterwards. Therefore objects in current environment that do not exist in the reference environment are deleted as well.
| env | The reference environment |
Definition at line 843 of file environment.cpp.
|
virtual |
Create and lock the environment.
Definition at line 111 of file environment.cpp.
References fawkes::Logger::log_debug(), and set_name().
|
virtual |
Remove all objects from environment.
Definition at line 678 of file environment.cpp.
References fawkes::Logger::log_warn().
|
virtual |
Remove object from environment.
| name | name of the object |
Definition at line 656 of file environment.cpp.
References fawkes::Logger::log_warn().
|
virtual |
Destroy the environment.
Definition at line 138 of file environment.cpp.
References fawkes::Logger::log_debug(), and fawkes::Logger::log_warn().
Referenced by ~OpenRaveEnvironment().
|
virtual |
Disable debugging messages of OpenRAVE.
Definition at line 195 of file environment.cpp.
|
virtual |
Enable debugging messages of OpenRAVE.
| level | debug level to set for OpenRAVE |
Definition at line 188 of file environment.cpp.
|
virtual |
Get EnvironmentBasePtr.
Definition at line 257 of file environment.cpp.
|
virtual |
Autogenerate IKfast IK solver for robot.
| robot | pointer to OpenRaveRobot object |
| iktype | IK type of solver (default: Transform6D; use TranslationDirection5D for 5DOF arms) |
Definition at line 297 of file environment.cpp.
|
virtual |
Move object in the environment.
Distances are given in meters
| name | name of the object |
| trans_x | transition along x-axis |
| trans_y | transition along y-axis |
| trans_z | transition along z-axis |
Definition at line 732 of file environment.cpp.
References fawkes::Logger::log_warn().
Referenced by move_object().
|
virtual |
Move object in the environment.
Distances are given in meters
| name | name of the object |
| trans_x | transition along x-axis |
| trans_y | transition along y-axis |
| trans_z | transition along z-axis |
| robot | move relatively to robot (in most simple cases robot is at position (0,0,0) anyway, so this has no effect) |
Definition at line 764 of file environment.cpp.
References move_object().
|
virtual |
Rename object.
| name | current name of the object |
| new_name | new name of the object |
Definition at line 704 of file environment.cpp.
References fawkes::Logger::log_warn().
|
virtual |
Rotate object by a quaternion.
| name | name of the object |
| quat_x | x value of quaternion |
| quat_y | y value of quaternion |
| quat_z | z value of quaternion |
| quat_w | w value of quaternion |
Definition at line 788 of file environment.cpp.
References fawkes::Logger::log_warn().
Referenced by rotate_object().
|
virtual |
Rotate object along its axis.
Rotation angles should be given in radians.
| name | name of the object |
| rot_x | 1st rotation, along x-axis |
| rot_y | 2nd rotation, along y-axis |
| rot_z | 3rd rotation, along z-axis |
Definition at line 825 of file environment.cpp.
References rotate_object().
|
virtual |
Run graspplanning script for a given target.
Script loads grasping databse, checks if target is graspable for various grasps and on success returns a string containing trajectory data. Currently the grasping databse can only be accessed via python, so we use a short python script (shortened and modified from officiel OpenRAVE graspplanning.py) to do the work.
| target_name | name of targeted object (KinBody) |
| robot | pointer to OpenRaveRobot object of robot to use |
| sampling | sampling time between each trajectory point (in seconds) |
Definition at line 472 of file environment.cpp.
References fawkes::RefPtr< T_CppObject >::clear(), and fawkes::Logger::log_debug().
|
virtual |
Plan collision-free path for current and target manipulator configuration of a OpenRaveRobot robot.
| robot | pointer to OpenRaveRobot object of robot to use |
| sampling | sampling time between each trajectory point (in seconds) |
Definition at line 318 of file environment.cpp.
References fawkes::RefPtr< T_CppObject >::clear(), fawkes::OpenRaveManipulator::get_angles(), fawkes::target_t::ikparam, fawkes::Logger::log_debug(), fawkes::target_t::manip, fawkes::target_t::plannerparams, fawkes::target_t::qw, fawkes::target_t::qx, fawkes::target_t::qy, fawkes::target_t::qz, fawkes::target_t::raw_cmd, fawkes::TARGET_IKPARAM, fawkes::TARGET_JOINTS, fawkes::TARGET_RAW, fawkes::TARGET_RELATIVE, fawkes::TARGET_RELATIVE_EXT, fawkes::TARGET_TRANSFORM, fawkes::target_t::type, fawkes::target_t::x, fawkes::target_t::y, and fawkes::target_t::z.
|
virtual |
Set name of environment.
Nothing important, but helpful for debugging etc.
| name | The name of the environment. Can be an empty string. |
Definition at line 169 of file environment.cpp.
References fawkes::Logger::log_debug().
Referenced by create(), and OpenRaveEnvironment().
|
virtual |
Starts the qt viewer in a separate thread.
Use this mainly for debugging purposes, as it uses a lot of CPU/GPU resources.
Definition at line 267 of file environment.cpp.
References fawkes::Logger::log_error(), and fawkes::run_viewer().