ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rizasif92's profile - activity

2017-04-03 08:47:14 -0500 received badge  Enthusiast
2017-03-25 04:18:35 -0500 received badge  Supporter (source)
2016-07-12 04:23:27 -0500 received badge  Famous Question (source)
2016-04-05 06:00:32 -0500 received badge  Notable Question (source)
2016-03-11 11:11:33 -0500 received badge  Popular Question (source)
2016-03-10 14:38:36 -0500 commented answer Visualizing Octomaps on RVIZ

About the file path; I'm pretty sure there is not problem with that. Because I created my own ".bt" file and placed it in the same folder. My own file was read successfully by this very code (just by changing the file name in the initializer).

2016-03-10 14:35:14 -0500 commented answer Visualizing Octomaps on RVIZ

Hi Felix, thanks for the comment. About the file type yes I made sure that I'm using the right code as provided in the reference link. I tried to use both ".ot" and ".bt" files downloaded from the same site and relevant approach; but the result is same.

2016-03-09 16:44:14 -0500 asked a question Visualizing Octomaps on RVIZ

Hi, I am using the following link as a reference.

http://www2.informatik.uni-freiburg.d...

I wanted to display an octomap on RVIZ using a data set provided on

http://ais.informatik.uni-freiburg.de...

My code is provided below:

#include <ros/ros.h>
#include <octomap_msgs/conversions.h>
#include <octomap_msgs/Octomap.h>
#include <octomap_msgs/GetOctomap.h>
#include <octomap_ros/conversions.h>

int main(int argc, char** argv){
  ros::init(argc, argv, "octomap_read");
  ros::AsyncSpinner spinner(1);
  spinner.start();
  ros::NodeHandle nh;

  std::cout<<"Reading File"<<std::endl;

  octomap::OcTree* octree = new octomap::OcTree("freiburg1_360.bt");
  std::cout << "File Read Sccessfully" << std::endl;

  for(octomap::OcTree::leaf_iterator it = octree->begin_leafs(),
        end=octree->end_leafs(); it!= end; ++it)
    { 
        std::cout << "Node center: " << it.getCoordinate();
        std::cout << " value: " << it->getValue() << "\n";
    }

  octomap_msgs::Octomap bmap_msg;
  octomap_msgs::binaryMapToMsg(*octree, bmap_msg);

  ros::Publisher octomap_publisher = nh.advertise<octomap_msgs::Octomap>("display_env",1);

  octomap_publisher.publish(bmap_msg);

  while(octomap_publisher.getNumSubscribers() < 1)
  {
       ROS_WARN("Waiting for Subscribers");
  }

  ros::shutdown();
  return 0;
}

According to the reference link the file should be read correctly but the error I receive is:

ERROR: Filestream to freiburg1_360.bt not open, nothing read.

It is an error from within octomap::OcTree can someone help?