23 #include "message_handler_thread.h"
25 #include <interfaces/OpenRaveInterface.h>
39 :
Thread(
"OpenRaveMessageHandlerThread",
Thread::OPMODE_WAITFORWAKEUP),
41 or_thread_(or_thread),
79 if_openrave_->
write();
90 "AddObject message received: name=%s, path=%s",
116 "AttachObjectMessage received: name=%s, manip_name=%s",
119 bool success =
false;
147 "MoveObjectMessage received: name=%s, x=%f, y=%f, z=%f",
160 "RotateObjectQuatMessage received: name=%s, x=%f, y=%f, z=%f, w=%f",
174 "RotateObjectMessage received: name=%s, x=%f, y=%f, z=%f",
187 "RenameObjectMessage received: name=%s, new_name=%s",
202 if_openrave_->
write();
virtual void finalize()
Finalize the thread.
virtual void loop()
Code to execute in the thread.
virtual ~OpenRaveMessageHandlerThread()
Destructor.
OpenRaveMessageHandlerThread(OpenRaveThread *or_thread)
Constructor.
virtual void init()
Initialize the thread.
virtual void start_viewer() const
Start Viewer.
virtual bool add_object(const std::string &name, const std::string &filename)
Add an object to 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 attach_object(const char *name, fawkes::OpenRaveRobotPtr &robot, const char *manip_name=NULL)
Attach a kinbody to the robot.
virtual bool release_all_objects(fawkes::OpenRaveRobotPtr &robot)
Release all grabbed kinbodys from the robot.
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, fawkes::OpenRaveRobotPtr &robot)
Move object in the environment, relatively to robot.
virtual bool release_object(const std::string &name, fawkes::OpenRaveRobotPtr &robot)
Release a kinbody from the robot.
virtual bool delete_all_objects()
Remove all objects from environment.
virtual bool delete_object(const std::string &name)
Remove object from environment.
BlackBoard * blackboard
This is the BlackBoard instance you can use to interact with the BlackBoard.
virtual Interface * open_for_writing(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for writing.
virtual void close(Interface *interface)=0
Close interface.
Thread aspect to use blocked timing.
Base class for exceptions in Fawkes.
virtual const char * what() const
Get primary string.
bool msgq_first_is()
Check if first message has desired type.
void msgq_pop()
Erase first message from queue.
Message * msgq_first()
Get the first message from the message queue.
void write()
Write from local copy into BlackBoard memory.
bool msgq_empty()
Check if queue is empty.
virtual void log_debug(const char *component, const char *format,...)=0
Log debug message.
virtual void log_warn(const char *component, const char *format,...)=0
Log warning message.
Logger * logger
This is the Logger member used to access the logger.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
unsigned int id() const
Get message ID.
AddObjectMessage Fawkes BlackBoard Interface Message.
char * name() const
Get name value.
char * path() const
Get path value.
AttachObjectMessage Fawkes BlackBoard Interface Message.
char * manip_name() const
Get manip_name value.
char * name() const
Get name value.
DeleteAllObjectsMessage Fawkes BlackBoard Interface Message.
DeleteObjectMessage Fawkes BlackBoard Interface Message.
char * name() const
Get name value.
MoveObjectMessage Fawkes BlackBoard Interface Message.
char * name() const
Get name value.
float x() const
Get x value.
float z() const
Get z value.
float y() const
Get y value.
ReleaseAllObjectsMessage Fawkes BlackBoard Interface Message.
ReleaseObjectMessage Fawkes BlackBoard Interface Message.
char * name() const
Get name value.
RenameObjectMessage Fawkes BlackBoard Interface Message.
char * name() const
Get name value.
char * newName() const
Get newName value.
RotateObjectMessage Fawkes BlackBoard Interface Message.
float y() const
Get y value.
float x() const
Get x value.
char * name() const
Get name value.
float z() const
Get z value.
RotateObjectQuatMessage Fawkes BlackBoard Interface Message.
float x() const
Get x value.
char * name() const
Get name value.
float y() const
Get y value.
float z() const
Get z value.
float w() const
Get w value.
StartViewerMessage Fawkes BlackBoard Interface Message.
OpenRaveInterface Fawkes BlackBoard Interface.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
void set_final(const bool new_final)
Set final value.
void set_success(const bool new_success)
Set success value.
Thread class encapsulation of pthreads.
const char * name() const
Get name of thread.
Fawkes library namespace.