8 #ifndef OCTOMAPSENSORSYSTEM_H_ 9 #define OCTOMAPSENSORSYSTEM_H_ 11 #include <openrave/openrave.h> 12 #include <octomap_server/OctomapServer.h> 14 #include <ros/node_handle.h> 15 #include <ros/callback_queue.h> 16 #include <boost/thread/mutex.hpp> 18 #include <std_msgs/ColorRGBA.h> 22 class OctomapCollisionChecker;
23 class OctomapInterface :
public OpenRAVE::SensorSystemBase,
public octomap_server::OctomapServer
26 OctomapInterface(ros::NodeHandle& nodeHandle, OpenRAVE::EnvironmentBasePtr env);
29 virtual bool SendCommand(std::ostream &os, std::istream &is);
35 octomap::OcTree*
GetTree() {
return m_octree; }
39 virtual OpenRAVE::KinBody::ManageDataPtr
AddKinBody(OpenRAVE::KinBodyPtr pbody,
40 OpenRAVE::XMLReadableConstPtr pdata)
42 return OpenRAVE::KinBody::ManageDataPtr();
44 virtual bool RemoveKinBody(OpenRAVE::KinBodyPtr pbody) {
return false; }
46 virtual bool EnableBody(OpenRAVE::KinBodyPtr pbody,
bool bEnable) {
return false; }
47 virtual bool SwitchBody (OpenRAVE::KinBodyPtr pbody1, OpenRAVE::KinBodyPtr pbody2) {
return false; }
52 bool MaskObject(std::ostream &os, std::istream &i);
53 bool SaveTree(std::ostream &os, std::istream &i);
54 bool ResetTree(std::ostream &os, std::istream &i);
55 bool ResetTopic(std::ostream &os, std::istream &i);
57 bool ResetFrame(std::ostream &os, std::istream &i);
virtual bool EnableBody(OpenRAVE::KinBodyPtr pbody, bool bEnable)
virtual void AddRegisteredBodies(const std::vector< OpenRAVE::KinBodyPtr > &vbodies)
boost::mutex m_cloudQueueMutex
bool MaskObject(std::ostream &os, std::istream &i)
virtual bool RemoveKinBody(OpenRAVE::KinBodyPtr pbody)
bool TogglePause(std::ostream &os, std::istream &i)
virtual ~OctomapInterface()
bool Disable(std::ostream &os, std::istream &i)
virtual bool SwitchBody(OpenRAVE::KinBodyPtr pbody1, OpenRAVE::KinBodyPtr pbody2)
bool ResetTopic(std::ostream &os, std::istream &i)
octomap::OcTree * GetTree()
virtual bool IsBodyPresent(OpenRAVE::KinBodyPtr pbody)
bool Enable(std::ostream &os, std::istream &i)
std::vector< sensor_msgs::PointCloud2ConstPtr > m_cloudQueue
bool ResetTree(std::ostream &os, std::istream &i)
ros::CallbackQueue m_queue
OctomapCollisionChecker * m_collisionChecker
void InsertCloudWrapper(const sensor_msgs::PointCloud2::ConstPtr &cloud)
bool SaveTree(std::ostream &os, std::istream &i)
bool ResetFrame(std::ostream &os, std::istream &i)
virtual OpenRAVE::KinBody::ManageDataPtr AddKinBody(OpenRAVE::KinBodyPtr pbody, OpenRAVE::XMLReadableConstPtr pdata)
void SetEnabled(bool enabled)
bool ResetResolution(std::ostream &os, std::istream &i)
boost::mutex & GetMutex()
OctomapInterface(ros::NodeHandle &nodeHandle, OpenRAVE::EnvironmentBasePtr env)
virtual bool SendCommand(std::ostream &os, std::istream &is)