Fawkes API  Fawkes Development Version
fawkes::OpenRaveConnector Class Referenceabstract

Interface for a OpenRave connection creator. More...

#include <>>

Inheritance diagram for fawkes::OpenRaveConnector:

Public Member Functions

virtual ~OpenRaveConnector ()
 Virtual empty destructor. More...
 
virtual void clone (OpenRaveEnvironmentPtr &env, OpenRaveRobotPtr &robot, OpenRaveManipulatorPtr &manip) const =0
 Clone basically everything We pass pointers to pointer as parameters, so the pointers we create before calling this clone() method will point to the new objects. More...
 
virtual void start_viewer () const =0
 Start OpenRave viewer. More...
 
virtual void run_planner (OpenRaveRobotPtr &robot, float sampling=0.01f)=0
 Run planner on previously set target. More...
 
virtual void run_planner (float sampling=0.01f)=0
 Run planner on previously set target. More...
 
virtual void run_graspplanning (const std::string &target_name, OpenRaveRobotPtr &robot)=0
 Run graspplanning script for a given target. More...
 
virtual void run_graspplanning (const std::string &target_name)=0
 Run graspplanning script for a given target. More...
 
virtual OpenRaveEnvironmentPtr get_environment () const =0
 Get pointer to OpenRaveEnvironment object. More...
 
virtual OpenRaveRobotPtr get_active_robot () const =0
 Get pointer to currently used OpenRaveRobot object. More...
 
virtual void set_active_robot (OpenRaveRobotPtr robot)=0
 Set robot to be used. More...
 
virtual void set_active_robot (OpenRaveRobot *robot)=0
 Set robot to be used. More...
 
virtual OpenRaveRobotPtr add_robot (const std::string &filename_robot, bool autogenerate_IK)=0
 Add a new robot to the environment, and set it as the currently active one. More...
 
virtual void set_manipulator (OpenRaveRobotPtr &robot, OpenRaveManipulatorPtr &manip, float trans_x=0.f, float trans_y=0.f, float trans_z=0.f, bool calibrate=0)=0
 Set OpenRaveManipulator object for robot, and calculate coordinate-system offsets or set them directly. More...
 
virtual void set_manipulator (OpenRaveManipulatorPtr &manip, float trans_x=0.f, float trans_y=0.f, float trans_z=0.f, bool calibrate=0)=0
 Set OpenRaveManipulator object for robot, and calculate coordinate-system offsets or set them directly. More...
 
virtual bool add_object (const std::string &name, const std::string &filename)=0
 Add an object to the environment. More...
 
virtual bool delete_object (const std::string &name)=0
 Remove object from environment. More...
 
virtual bool rename_object (const std::string &name, const std::string &new_name)=0
 Rename object. More...
 
virtual bool move_object (const std::string &name, float trans_x, float trans_y, float trans_z, OpenRaveRobotPtr &robot)=0
 Move object in the environment. More...
 
virtual bool move_object (const std::string &name, float trans_x, float trans_y, float trans_z)=0
 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)=0
 Rotate object by a quaternion. More...
 
virtual bool rotate_object (const std::string &name, float rot_x, float rot_y, float rot_z)=0
 Rotate object along its axis. More...
 
virtual bool attach_object (const char *name, OpenRaveRobotPtr &robot, const char *manip_name)=0
 Attach a kinbody to the robot. More...
 
virtual bool attach_object (const char *name, const char *manip_name)=0
 Attach a kinbody to the robot. More...
 
virtual bool release_object (const std::string &name, OpenRaveRobotPtr &robot)=0
 Release a kinbody from the robot. More...
 
virtual bool release_object (const std::string &name)=0
 Release a kinbody from the robot. More...
 
virtual bool release_all_objects (OpenRaveRobotPtr &robot)=0
 Release all grabbed kinbodys from the robot. More...
 
virtual bool release_all_objects ()=0
 Release all grabbed kinbodys from the robot. More...
 
virtual bool set_target_object (const std::string &name, OpenRaveRobotPtr &robot, float rot_x=0)=0
 Set an object as the target. More...
 

Detailed Description

Interface for a OpenRave connection creator.

Author
Bahram Maleki-Fard

Definition at line 51 of file openrave_connector.h.

Constructor & Destructor Documentation

◆ ~OpenRaveConnector()

Member Function Documentation

◆ add_object()

virtual bool fawkes::OpenRaveConnector::add_object ( const std::string &  name,
const std::string &  filename 
)
pure virtual

Add an object to the environment.

Parameters
namename that should be given to that object
filenamepath to xml file of that object (KinBody)
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ add_robot()

virtual OpenRaveRobotPtr fawkes::OpenRaveConnector::add_robot ( const std::string &  filename_robot,
bool  autogenerate_IK 
)
pure virtual

Add a new robot to the environment, and set it as the currently active one.

Parameters
filename_robotpath to robot's xml file
autogenerate_IKif true: autogenerate IKfast IK solver for robot
Returns
pointer to new OpenRaveRobot object

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ attach_object() [1/2]

virtual bool fawkes::OpenRaveConnector::attach_object ( const char *  name,
OpenRaveRobotPtr robot,
const char *  manip_name 
)
pure virtual

Attach a kinbody to the robot.

Parameters
namename of the object
robotpointer to OpenRaveRobot that the target is set for
manip_namename of the manipulator to attach the object to
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ attach_object() [2/2]

virtual bool fawkes::OpenRaveConnector::attach_object ( const char *  name,
const char *  manip_name 
)
pure virtual

Attach a kinbody to the robot.

Uses currently active robot.

Parameters
namename of the object
manip_namename of the manipulator to attach the object to
Returns
true if successful

Implemented in OpenRaveThread.

◆ clone()

virtual void fawkes::OpenRaveConnector::clone ( OpenRaveEnvironmentPtr env,
OpenRaveRobotPtr robot,
OpenRaveManipulatorPtr manip 
) const
pure virtual

Clone basically everything We pass pointers to pointer as parameters, so the pointers we create before calling this clone() method will point to the new objects.

Parameters
envPointer to pointer of the copied environment
robotPointer to pointer of the copied robot
manipPointer to pointer of the copied manipulator

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ delete_object()

virtual bool fawkes::OpenRaveConnector::delete_object ( const std::string &  name)
pure virtual

Remove object from environment.

Parameters
namename of the object
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ get_active_robot()

virtual OpenRaveRobotPtr fawkes::OpenRaveConnector::get_active_robot ( ) const
pure virtual

Get pointer to currently used OpenRaveRobot object.

Returns
pointer

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ get_environment()

virtual OpenRaveEnvironmentPtr fawkes::OpenRaveConnector::get_environment ( ) const
pure virtual

Get pointer to OpenRaveEnvironment object.

Returns
pointer

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ move_object() [1/2]

virtual bool fawkes::OpenRaveConnector::move_object ( const std::string &  name,
float  trans_x,
float  trans_y,
float  trans_z,
OpenRaveRobotPtr robot 
)
pure virtual

Move object in the environment.

Distances are given in meters

Parameters
namename of the object
trans_xtransition along x-axis
trans_ytransition along y-axis
trans_ztransition along z-axis
robotif given, move relatively to robot (in most simple cases robot is at position (0,0,0) anyway, so this has no effect)
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ move_object() [2/2]

virtual bool fawkes::OpenRaveConnector::move_object ( const std::string &  name,
float  trans_x,
float  trans_y,
float  trans_z 
)
pure virtual

Move object in the environment.

Uses currently active robot. Distances are given in meters

Parameters
namename of the object
trans_xtransition along x-axis
trans_ytransition along y-axis
trans_ztransition along z-axis
Returns
true if successful

Implemented in OpenRaveThread.

◆ release_all_objects() [1/2]

virtual bool fawkes::OpenRaveConnector::release_all_objects ( OpenRaveRobotPtr robot)
pure virtual

Release all grabbed kinbodys from the robot.

Parameters
robotpointer to OpenRaveRobot that objects are released from
Returns
true if successful

Implemented in OpenRaveThread.

◆ release_all_objects() [2/2]

virtual bool fawkes::OpenRaveConnector::release_all_objects ( )
pure virtual

Release all grabbed kinbodys from the robot.

Uses currently active robot.

Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ release_object() [1/2]

virtual bool fawkes::OpenRaveConnector::release_object ( const std::string &  name,
OpenRaveRobotPtr robot 
)
pure virtual

Release a kinbody from the robot.

Parameters
namename of the object
robotpointer to OpenRaveRobot that object is released from
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ release_object() [2/2]

virtual bool fawkes::OpenRaveConnector::release_object ( const std::string &  name)
pure virtual

Release a kinbody from the robot.

Uses currently active robot.

Parameters
namename of the object
Returns
true if successful

Implemented in OpenRaveThread.

◆ rename_object()

virtual bool fawkes::OpenRaveConnector::rename_object ( const std::string &  name,
const std::string &  new_name 
)
pure virtual

Rename object.

Parameters
namecurrent name of the object
new_namenew name of the object
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ rotate_object() [1/2]

virtual bool fawkes::OpenRaveConnector::rotate_object ( const std::string &  name,
float  quat_x,
float  quat_y,
float  quat_z,
float  quat_w 
)
pure virtual

Rotate object by a quaternion.

Parameters
namename of the object
quat_xx value of quaternion
quat_yy value of quaternion
quat_zz value of quaternion
quat_ww value of quaternion
Returns
true if successful

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ rotate_object() [2/2]

virtual bool fawkes::OpenRaveConnector::rotate_object ( const std::string &  name,
float  rot_x,
float  rot_y,
float  rot_z 
)
pure virtual

Rotate object along its axis.

Rotation angles should be given in radians.

Parameters
namename of the object
rot_x1st rotation, along x-axis
rot_y2nd rotation, along y-axis
rot_z3rd rotation, along z-axis
Returns
true if successful

Implemented in OpenRaveThread.

◆ run_graspplanning() [1/2]

virtual void fawkes::OpenRaveConnector::run_graspplanning ( const std::string &  target_name,
OpenRaveRobotPtr robot 
)
pure virtual

Run graspplanning script for a given target.

Parameters
target_namename of targeted object (KinBody)
robotrobot to use planner on. If none is given, the currently used robot is taken

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ run_graspplanning() [2/2]

virtual void fawkes::OpenRaveConnector::run_graspplanning ( const std::string &  target_name)
pure virtual

Run graspplanning script for a given target.

Uses currently active robot.

Parameters
target_namename of targeted object (KinBody)

Implemented in OpenRaveThread.

◆ run_planner() [1/2]

virtual void fawkes::OpenRaveConnector::run_planner ( OpenRaveRobotPtr robot,
float  sampling = 0.01f 
)
pure virtual

Run planner on previously set target.

Parameters
robotrobot to use planner on. If none is given, the currently used robot is taken
samplingsampling time between each trajectory point (in seconds)

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ run_planner() [2/2]

virtual void fawkes::OpenRaveConnector::run_planner ( float  sampling = 0.01f)
pure virtual

Run planner on previously set target.

Uses currently active robot.

Parameters
samplingsampling time between each trajectory point (in seconds)

Implemented in OpenRaveThread.

◆ set_active_robot() [1/2]

virtual void fawkes::OpenRaveConnector::set_active_robot ( OpenRaveRobotPtr  robot)
pure virtual

Set robot to be used.

Parameters
robotOpenRaveRobot that should be used implicitly in other methods

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ set_active_robot() [2/2]

virtual void fawkes::OpenRaveConnector::set_active_robot ( OpenRaveRobot robot)
pure virtual

Set robot to be used.

Parameters
robotOpenRaveRobot that should be used implicitly in other methods

Implemented in OpenRaveThread.

◆ set_manipulator() [1/2]

virtual void fawkes::OpenRaveConnector::set_manipulator ( OpenRaveRobotPtr robot,
OpenRaveManipulatorPtr manip,
float  trans_x = 0.f,
float  trans_y = 0.f,
float  trans_z = 0.f,
bool  calibrate = 0 
)
pure virtual

Set OpenRaveManipulator object for robot, and calculate coordinate-system offsets or set them directly.

Make sure to update manip angles before calibrating!

Parameters
robotpointer to OpenRaveRobot object, explicitly set
manippointer to OpenRAVManipulator that is set for robot
trans_xtransition offset on x-axis
trans_ytransition offset on y-axis
trans_ztransition offset on z-axis
calibratedecides whether to calculate offset (true )or set them directly (false; default)

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ set_manipulator() [2/2]

virtual void fawkes::OpenRaveConnector::set_manipulator ( OpenRaveManipulatorPtr manip,
float  trans_x = 0.f,
float  trans_y = 0.f,
float  trans_z = 0.f,
bool  calibrate = 0 
)
pure virtual

Set OpenRaveManipulator object for robot, and calculate coordinate-system offsets or set them directly.

Make sure to update manip angles before calibrating! Uses default OpenRaveRobot object.

Parameters
manippointer to OpenRAVManipulator that is set for robot
trans_xtransition offset on x-axis
trans_ytransition offset on y-axis
trans_ztransition offset on z-axis
calibratedecides whether to calculate offset (true )or set them directly (false; default)

Implemented in OpenRaveThread.

◆ set_target_object()

virtual bool fawkes::OpenRaveConnector::set_target_object ( const std::string &  name,
OpenRaveRobotPtr robot,
float  rot_x = 0 
)
pure virtual

Set an object as the target.

Currently the object should be cylindric, and stand upright. It may also be rotated on its x-axis, but that rotation needs to be given in an argument to calculate correct position for endeffecto. This is only temporary until proper graps planning for 5DOF in OpenRave is provided.

Parameters
namename of the object
robotpointer to OpenRaveRobot that the target is set for
rot_xrotation of object on x-axis (radians)
Returns
true if IK solvable

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().

◆ start_viewer()

virtual void fawkes::OpenRaveConnector::start_viewer ( ) const
pure virtual

Start OpenRave viewer.

Implemented in OpenRaveThread.

Referenced by ~OpenRaveConnector().


The documentation for this class was generated from the following file: