56 int main(
int argc,
char **argv) {
90 paramloader.
load(
"~/pcd_voxel_explicit_relative_resolution",
92 paramloader.
load(
"~/pcd_explicit_transform",
96 paramloader.
loadTopic(
"~/topic_in_cloud" ,
98 paramloader.
loadTopic(
"~/topic_in_cloud_old",
100 paramloader.
loadTopic(
"~/topic_in_laser" ,
104 paramloader.
loadTopic(
"~/topic_out_octomap" ,
106 paramloader.
loadTopic(
"~/topic_out_octomap_full" ,
108 paramloader.
loadTopic(
"~/topic_out_cloud_free" ,
110 paramloader.
loadTopic(
"~/topic_out_cloud_occupied",
149 std::string str_service(
"~/");
195 const sensor_msgs::PointCloud2ConstPtr &msg) {
206 msg->header.frame_id, msg->header.stamp,
ros::Duration(0.2));
208 msg->header.frame_id, msg->header.stamp, transform);
222 const sensor_msgs::PointCloudConstPtr &msg) {
233 msg->header.frame_id, msg->header.stamp,
ros::Duration(0.2));
235 msg->header.frame_id, msg->header.stamp, transform);
249 const sensor_msgs::LaserScanConstPtr &msg) {
260 msg->header.frame_id, msg->header.stamp,
ros::Duration(0.2));
262 msg->header.frame_id, msg->header.stamp, transform);
278 std_srvs::Empty::Response &res) {
294 octomap_pa::OctomapPaGetSize::Request &req,
295 octomap_pa::OctomapPaGetSize::Response &res) {
297 ROS_INFO(
"cOctreePaNode::getsize()");
311 octomap_pa::OctomapPaFileName::Request &req,
312 octomap_pa::OctomapPaFileName::Response &res) {
317 filename = req.filename;
322 res.ok = this->
write(filename);
329 octomap_pa::OctomapPaFileName::Request &req,
330 octomap_pa::OctomapPaFileName::Response &res) {
335 filename = req.filename;
sensor_msgs::PointCloud2Ptr getOctomapPcdFree(const int tree_depth=0, const bool expand=false) const
similar to getOctomapPcd, but only returning just empty voxels
void setResolution(double r)
std::string topic_out_octomap_full_
name of the topic for publishing the octomap ("~out_octomap_full")
ros::Publisher pub_octomap_
puplisher for the octomap (binary data)
void addPointcloudOldCallbackSub(const sensor_msgs::PointCloudConstPtr &msg)
callback function for receiving a pointcloud (old format)
std::string output_frame_
name of the output frame ("map")
octomap_msgs::OctomapPtr getOctomapFull(void) const
function for getting the full octomap
std::string topic_out_cloud_occupied_
double map_prob_miss_
octomap parameter: probability for a "miss"
ros::ServiceServer srv_load_
service for loading a octomap
int count_cloud_old_
number of inserted pointclouds (old format)
ros::ServiceServer srv_clear_
service for clearing the octomap
void publish(const boost::shared_ptr< M > &message) const
virtual void clear(void)
clear local timestamps with octomap
ros::Subscriber sub_cloud_old_
subscriber for a pointcloud (old format)
virtual size_t memoryUsage() const
void setClampingThresMax(double thresProb)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
bool updateTime(const ros::Time &time)
bool clearCallbackSrv(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
std::string topic_out_cloud_free_
ros::Subscriber sub_cloud_
subscriber for a pointcloud
octomap_msgs::OctomapPtr getOctomap(void) const
function for getting the binary octomap
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
int count_laser_
number of inserted laser scans
bool loadTopic(const std::string name, std::string &value, const bool print_default=true) const
int main(int argc, char **argv)
cAddCloudParameter addparams_
bool load(const std::string name, bool &value, const bool print_default=true) const
ROSCPP_DECL void spin(Spinner &spinner)
static bool replaceFindpack(std::string &path)
double map_prob_hit_
octomap parameter: probability for a "hit"
bool addCloud(const sensor_msgs::PointCloud2ConstPtr &cloud, const cAddCloudParameter ¶ms, const tf::Transform transform=tf::Transform::getIdentity())
bool pcd_voxel_active_
pointcloud insertion parameter: use voxel-filter (speeds up)
ros::ServiceServer srv_getsize_
service for receiving the size of the octomap
bool pcd_explicit_transform_
bool write(const std::string &filename) const
bool saveCallbackSrv(octomap_pa::OctomapPaFileName::Request &req, octomap_pa::OctomapPaFileName::Response &res)
bool loadCallbackSrv(octomap_pa::OctomapPaFileName::Request &req, octomap_pa::OctomapPaFileName::Response &res)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
cOctreePaNode()
default constructor
cOctreeBasePaRosParameter rosparams_base_
parameters
static std::string resolveRessourcename(const std::string name)
std::string topic_out_octomap_
name of the topic for publishing the octomap ("~out_octomap")
ros::ServiceServer srv_save_
service for saving the octomap
sensor_msgs::PointCloud2Ptr getOctomapPcd(const int tree_depth=0, const bool expand=false) const
function for getting the pointcloud equivalent of the octomap
void setOccupancyThres(double prob)
tf::TransformListener tf_listener_
transformation of different frames
uint32_t getNumSubscribers() const
#define ROS_INFO_STREAM(args)
std::string topic_in_laser_
name of the topic for subscribing a laserscan ("~in_laser")
~cOctreePaNode()
default destructor
void addPointcloudCallbackSub(const sensor_msgs::PointCloud2ConstPtr &msg)
callback function for receiving a pointcloud
ros::Publisher pub_octomap_full_
puplisher for the octomap (full data)
std::string topic_in_cloud_old_
ros::Subscriber sub_laser_
subscriber for a laserscan
bool readFull(const std::string &filename)
trying to read the given file into the current OcTree
void publishOctomap(void)
function for publishing the octomap
ros::Publisher pub_cloud_occupied_
puplisher for occupied voxels as pointcloud
cOctreeBasePaNodeParameter nodeparams_
parameters
std::string topic_in_cloud_
int count_cloud_
number of inserted pointclouds
bool getSizeCallbackSrv(octomap_pa::OctomapPaGetSize::Request &req, octomap_pa::OctomapPaGetSize::Response &res)
void addLaserCallbackSub(const sensor_msgs::LaserScanConstPtr &msg)
callback function for receiving a laserscan
ros::NodeHandle nh_
node handler for topic subscription and advertising
double pcd_voxel_explicit_relative_resolution_
pointcloud insertion parameter: relative resolution of pcl-filter
virtual size_t size() const
ros::Publisher pub_cloud_free_
puplisher for free voxels as pointcloud
void setClampingThresMin(double thresProb)