topic is already advertised as md5sum [...] and datatype [...]
I'm trying to get output from a remote node to the /rosout topic and view it with 'rostopic echo rosout' running on the master. I have a roscore running on hostA brought up by starting roslaunch. On hostB, I have a node built from roscpp.
My nodes code is as follows:
int func1()
{
if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME,
ros::console::levels::Debug) ) {
ros::console::notifyLoggerLevelsChanged();
}
map<string, string> remap;
remap.emplace("__ip", get_ip());
remap.emplace("__master", get_master_uri());
ros::init(remap, "test-node");
ros::Time::init();
while (!ros::master::check()) {
ros::Duration(1.0).sleep();
}
nh = boost::make_shared<ros::NodeHandle>();
ros::spinOnce();
return 0;
}
int func2()
{
ROS_INFO("point A");
ros::Publisher pub =
nh->advertise<std_msgs::String>("rosout", 1000);
ROS_INFO("point B");
std_msgs::String msg;
stringstream ss;
ss << "Using stringstream.";
msg.data = ss.str();
pub.publish(msg);
ROS_INFO("point C");
ROS_INFO_STREAM("ss data: " << msg.data);
ROS_INFO_STREAM("ROS Node Namespace: " << ros::this_node::getNamespace());
ROS_INFO_STREAM("ROS Node Name: " << ros::this_node::getName());
ROS_INFO("point 4");
return 0;
}
The only thing I ever see show up on the master node is "point A", "point B" never prints and I get the following message on the master node.
Tried to advertise on topic [/rosout] with md5sum [992ce8a1687cec8c8bd883ec973ca4131] and datatype [std_msgs/String], but the topic is already advertised as md5sum [acffd30cd6b6de30f120938c17c593fb] and datatype [rosgraph_msgs/Log]
No where's have I used a datatype of rosgraph_msgs and I'm not sure why the message says so. rqt_console shows me the message is coming from the node "test-node" as an error. Sometimes the "point A" message will come through with severity 'Info' and shows up properly, but won't go beyond the error above.
Also, how is it that ROS_INFO("point A") shows up on the /rosout of the master, yet the topic hasn't even been advertised yet?
Thoughts?