@Override public void run() { Topic echoBack = new Topic(ros, this.topic, topicType); echoBack.subscribe(new TopicCallback() { @Override public void handleMessage(Message message) { events.add(message.toString().getBytes()); } }); }
@Override public void startAdapter() throws AdapterException { this.ros = new Ros(this.host); this.ros.connect(); String topicType = getMethodType(this.ros, this.topic); Topic echoBack = new Topic(ros, this.topic, topicType); echoBack.subscribe(new TopicCallback() { @Override public void handleMessage(Message message) { InputStream stream = new ByteArrayInputStream(message.toString().getBytes(StandardCharsets.UTF_8)); jsonObjectParser.parse(stream, new ParseData()); } }); }