Ejemplo n.º 1
0
 public void updateTopic(Node node, long seq) {
   message.header.seq = seq;
   message.header.stamp = node.getCurrentTime();
   message.header.frame_id = "/robot";
   pressed = touch.isPressed();
   message.contact = pressed;
   topic.publish(message);
 }
 private void publish(byte level, Object message) {
   org.ros.message.rosgraph_msgs.Log m = new org.ros.message.rosgraph_msgs.Log();
   m.header.stamp = node.getCurrentTime();
   m.level = level;
   m.name = node.getName().toString();
   m.msg = message.toString();
   // TODO(damonkohler): Should return list of all published and subscribed
   // topics for the node that created this logger. This helps filter the
   // rosoutconsole.
   m.topics = Lists.newArrayList();
   publisher.publish(m);
 }