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

Revision history [back]

click to hide/show revision 1
initial version

We see this:

std::vector<std::vector<float> > grid;    //vector of vectors 

...

void mapCallback(...)
{
  ...

  map_pub.publish(grid[i][j]);

  ...
}

you cannot publish(..) floats directly. That's what the error message is telling you.

We see this:

std::vector<std::vector<float> > grid;    //vector of vectors 

...

void mapCallback(...)
{
  ...

  map_pub.publish(grid[i][j]);

  ...
}


int main(int argc, char **argv){
  ...

  ros::Publisher map_pub = n.advertise<nav_msgs::OccupancyGrid>("map",100);

  ...
}

you cannot publish(..) floats directly. That's what the error message is telling you.