ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Solved it. Just added these lines
//import statements for the publisher
import org.ros.concurrent.CancellableLoop;
import org.ros.node.topic.Publisher;
final Publisher<std_msgs.String> publisher =
connectedNode.newPublisher("chatter", std_msgs.String._TYPE);//added this line above the try block
//added the following lines of code below log.info("Classifier's output: \"" + da + "\"");
std_msgs.String str = publisher.newMessage();
str.setData(da);
publisher.publish(str);
2 | No.2 Revision |
Solved it. Just added these lines
//import statements statement for the publisher
import org.ros.concurrent.CancellableLoop;
import org.ros.node.topic.Publisher;
final Publisher<std_msgs.String> publisher =
connectedNode.newPublisher("chatter", std_msgs.String._TYPE);//added this line above the try block
//added the following lines of code below log.info("Classifier's output: \"" + da + "\"");
std_msgs.String str = publisher.newMessage();
str.setData(da);
publisher.publish(str);