23 #ifndef __PLUGINS_OPENRAVE_OPENRAVE_THREAD_H_ 24 #define __PLUGINS_OPENRAVE_OPENRAVE_THREAD_H_ 28 #include <plugins/openrave/aspect/openrave_connector.h> 29 #include <plugins/openrave/aspect/openrave_inifin.h> 31 #include <core/threading/thread.h> 32 #include <aspect/blocked_timing.h> 33 #include <aspect/logging.h> 34 #include <aspect/configurable.h> 35 #include <aspect/aspect_provider.h> 66 float trans_x=0.f,
float trans_y=0.f,
float trans_z=0.f,
bool calibrate=0);
68 float trans_x=0.f,
float trans_y=0.f,
float trans_z=0.f,
bool calibrate=0);
77 virtual bool add_object(
const std::string&
name,
const std::string& filename);
80 virtual bool rename_object(
const std::string& name,
const std::string& new_name);
82 virtual bool move_object(
const std::string& name,
float trans_x,
float trans_y,
float trans_z);
83 virtual bool rotate_object(
const std::string& name,
float quat_x,
float quat_y,
float quat_z,
float quat_w);
84 virtual bool rotate_object(
const std::string& name,
float rot_x,
float rot_y,
float rot_z);
88 virtual bool attach_object(
const char* name,
const char* manip_name = NULL);
95 protected:
virtual void run() { Thread::run(); }
virtual void set_manipulator(fawkes::OpenRaveManipulatorPtr &manip, float trans_x=0.f, float trans_y=0.f, float trans_z=0.f, bool calibrate=0)
Set OpenRaveManipulator object for robot, and calculate coordinate-system offsets or set them directl...
OpenRaveThread()
Constructor.
virtual void set_active_robot(fawkes::OpenRaveRobotPtr robot)
Set robot to be used.
virtual void init()
Initialize the thread.
virtual bool attach_object(const char *name, fawkes::OpenRaveRobotPtr &robot, const char *manip_name=NULL)
Attach a kinbody to the robot.
Thread class encapsulation of pthreads.
virtual bool delete_all_objects()
Remove all objects from environment.
virtual void finalize()
Finalize the thread.
virtual ~OpenRaveThread()
Destructor.
virtual bool release_object(const std::string &name, fawkes::OpenRaveRobotPtr &robot)
Release a kinbody from the robot.
virtual bool move_object(const std::string &name, float trans_x, float trans_y, float trans_z, fawkes::OpenRaveRobotPtr &robot)
Move object in the environment, relatively to robot.
Thread aspect to use blocked timing.
virtual bool delete_object(const std::string &name)
Remove object from environment.
virtual void clone(fawkes::OpenRaveEnvironmentPtr &env, fawkes::OpenRaveRobotPtr &robot, fawkes::OpenRaveManipulatorPtr &manip) const
Clone basically everything We pass pointers to pointer as parameters, so the pointers we create befor...
OpenRaveAspect initializer/finalizer.
virtual bool release_all_objects()
Release all grabbed kinbodys from the robot.
virtual fawkes::OpenRaveRobotPtr get_active_robot() const
Get RefPtr to currently used OpenRaveRobot object.
virtual bool set_target_object(const std::string &name, fawkes::OpenRaveRobotPtr &robot, float rot_x=0)
Set an object as the target.
virtual void run_planner(fawkes::OpenRaveRobotPtr &robot, float sampling=0.01f)
Run planner on previously set target.
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.
const char * name() const
Get name of thread.
Thread aspect to log output.
Thread aspect provide a new aspect.
Thread aspect to access configuration data.
virtual void run()
Stub to see name in backtrace for easier debugging.
Interface for a OpenRave connection creator.
virtual void run_graspplanning(const std::string &target_name, fawkes::OpenRaveRobotPtr &robot)
Run graspplanning script for a given target.
RefPtr<> is a reference-counting shared smartpointer.
virtual void loop()
Code to execute in the thread.
virtual void start_viewer() const
Start Viewer.
virtual bool rename_object(const std::string &name, const std::string &new_name)
Rename object.
virtual fawkes::OpenRaveEnvironmentPtr get_environment() const
Get pointer to OpenRaveEnvironment object.
virtual bool add_object(const std::string &name, const std::string &filename)
Add an object to the environment.
virtual fawkes::OpenRaveRobotPtr add_robot(const std::string &filename_robot, bool autogenerate_IK)
Add a new robot to the environment, and set it as the currently active one.