|
Fawkes API
Fawkes Development Version
|
OpenRaveEnvironment class. More...
#include <>>
Public Member Functions | |
| OpenRaveEnvironment (fawkes::Logger *logger=0) | |
| Constructor. | |
| ~OpenRaveEnvironment () | |
| Destructor. | |
| virtual void | create () |
| Create and lock the environment. | |
| virtual void | destroy () |
| Destroy the environment. | |
| virtual void | lock () |
| Lock the environment to prevent changes. | |
| virtual void | enable_debug (OpenRAVE::DebugLevel level=OpenRAVE::Level_Debug) |
| Enable debugging messages of OpenRAVE. | |
| virtual void | disable_debug () |
| Disable debugging messages of OpenRAVE. | |
| virtual void | start_viewer () |
| Starts the qt viewer in a separate thread. | |
| virtual void | load_IK_solver (OpenRaveRobot *robot, OpenRAVE::IkParameterizationType iktype=OpenRAVE::IKP_Transform6D) |
| Autogenerate IKfast IK solver for robot. | |
| virtual void | run_planner (OpenRaveRobot *robot, float sampling=0.01f) |
| Plan collision-free path for current and target manipulator configuration of a OpenRaveRobot robot. | |
| virtual void | run_graspplanning (const std::string &target_name, OpenRaveRobot *robot, float sampling=0.01f) |
| Run graspplanning script for a given target. | |
| virtual void | add_robot (const std::string &filename) |
| Add a robot into the scene. | |
| virtual void | add_robot (OpenRAVE::RobotBasePtr robot) |
| Add a robot into the scene. | |
| virtual void | add_robot (OpenRaveRobot *robot) |
| Add a robot into the scene. | |
| virtual bool | add_object (const std::string &name, const std::string &filename) |
| Add an object to the environment. | |
| virtual bool | delete_object (const std::string &name) |
| Remove object from environment. | |
| virtual bool | rename_object (const std::string &name, const std::string &new_name) |
| Rename object. | |
| virtual bool | move_object (const std::string &name, float trans_x, float trans_y, float trans_z, OpenRaveRobot *robot=NULL) |
| Move object in the environment. | |
| 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. | |
| virtual bool | rotate_object (const std::string &name, float rot_x, float rot_y, float rot_z) |
| Rotate object along its axis. | |
| virtual OpenRAVE::EnvironmentBasePtr | get_env_ptr () const |
| Get EnvironmentBasePtr. | |
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 45 of file environment.h.
| fawkes::OpenRaveEnvironment::OpenRaveEnvironment | ( | fawkes::Logger * | logger = 0 | ) |
Constructor.
| logger | pointer to fawkes logger |
Definition at line 75 of file environment.cpp.
| fawkes::OpenRaveEnvironment::~OpenRaveEnvironment | ( | ) |
|
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 538 of file environment.cpp.
References lock(), and fawkes::Logger::log_warn().
Referenced by OpenRaveThread::add_object().
|
virtual |
Add a robot into the scene.
| filename | path to robot's xml file |
Definition at line 167 of file environment.cpp.
References fawkes::Logger::log_debug().
Referenced by OpenRaveThread::add_robot(), and add_robot().
|
virtual |
Add a robot into the scene.
| robot | RobotBasePtr of robot to add |
Definition at line 150 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 187 of file environment.cpp.
References add_robot(), and fawkes::OpenRaveRobot::get_robot_ptr().
|
virtual |
Create and lock the environment.
Definition at line 89 of file environment.cpp.
References fawkes::Logger::log_debug().
Referenced by OpenRaveThread::init().
|
virtual |
Remove object from environment.
| name | name of the object |
Definition at line 559 of file environment.cpp.
References lock(), and fawkes::Logger::log_warn().
Referenced by OpenRaveThread::delete_object().
|
virtual |
Destroy the environment.
Definition at line 110 of file environment.cpp.
References fawkes::Logger::log_debug(), and fawkes::Logger::log_warn().
Referenced by OpenRaveThread::finalize(), and ~OpenRaveEnvironment().
|
virtual |
Disable debugging messages of OpenRAVE.
Definition at line 140 of file environment.cpp.
|
virtual |
Enable debugging messages of OpenRAVE.
| level | debug level to set for OpenRAVE |
Definition at line 133 of file environment.cpp.
Referenced by OpenRaveThread::init().
|
virtual |
Get EnvironmentBasePtr.
Definition at line 197 of file environment.cpp.
Referenced by fawkes::OpenRaveRobot::attach_object(), fawkes::OpenRaveRobot::load(), fawkes::OpenRaveRobot::release_object(), and OpenRaveThread::set_target_object().
|
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 225 of file environment.cpp.
References fawkes::OpenRaveRobot::get_robot_ptr().
Referenced by OpenRaveThread::add_robot().
|
virtual |
Lock the environment to prevent changes.
Definition at line 124 of file environment.cpp.
Referenced by add_object(), delete_object(), OpenRaveThread::init(), move_object(), rename_object(), rotate_object(), and run_planner().
|
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 | if given, move relatively to robot (in most simple cases robot is at position (0,0,0) anyway, so this has no effect) |
Definition at line 605 of file environment.cpp.
References fawkes::OpenRaveRobot::get_robot_ptr(), lock(), and fawkes::Logger::log_warn().
Referenced by OpenRaveThread::move_object().
|
virtual |
Rename object.
| name | current name of the object |
| new_name | new name of the object |
Definition at line 580 of file environment.cpp.
References lock(), and fawkes::Logger::log_warn().
Referenced by OpenRaveThread::rename_object().
|
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 638 of file environment.cpp.
References lock(), and fawkes::Logger::log_warn().
Referenced by rotate_object(), and OpenRaveThread::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 668 of file environment.cpp.
References rotate_object(), fawkes::Vector::x(), fawkes::Vector::y(), and fawkes::Vector::z().
|
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 390 of file environment.cpp.
References fawkes::OpenRaveRobot::display_planned_movements(), fawkes::OpenRaveRobot::get_robot_ptr(), fawkes::OpenRaveRobot::get_trajectory(), and fawkes::Logger::log_debug().
Referenced by OpenRaveThread::run_graspplanning().
|
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 243 of file environment.cpp.
References fawkes::OpenRaveRobot::display_planned_movements(), fawkes::OpenRaveManipulator::get_angles(), fawkes::OpenRaveRobot::get_basemanip(), fawkes::OpenRaveRobot::get_planner_params(), fawkes::OpenRaveRobot::get_robot_ptr(), fawkes::OpenRaveRobot::get_target(), fawkes::OpenRaveRobot::get_trajectory(), fawkes::target_t::ikparam, lock(), 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_IKPARAM, fawkes::TARGET_JOINTS, 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.
Referenced by OpenRaveThread::run_planner().
|
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 207 of file environment.cpp.
References fawkes::Logger::log_error(), and fawkes::SetViewer().
Referenced by OpenRaveThread::start_viewer().