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

Revision history [back]

Before a message has been received, your global const pointer will not contain a valid reference which means you cannot use it for publishing. Before calling publish, you need to check if the pointer is valid:

if(mensaje) {
  pub.publish(mensaje);
}