29 : is_initialized_(false),
36 if (
pubs_.size() != sonar_msgs.size() )
38 std::cerr <<
"Incorrect number of sonar range messages in sonar publisher. " << sonar_msgs.size() <<
"/" <<
pubs_.size() << std::endl;
42 for(
size_t i=0; i<sonar_msgs.size(); ++i)
44 pubs_[i].publish( sonar_msgs[i] );
50 pubs_ = std::vector<ros::Publisher>();
51 for(
size_t i=0; i<
topics_.size(); ++i)
std::vector< ros::Publisher > pubs_
void reset(ros::NodeHandle &nh)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
SonarPublisher(const std::vector< std::string > &topics)
void publish(const std::vector< sensor_msgs::Range > &sonar_msgs)
std::vector< std::string > topics_