@Override protected void onMessageReceived(visualization_msgs.Marker msg) { super.onMessageReceived(msg); String ns = msg.getNs(); int id = msg.getId(); synchronized (lockObj) { switch (msg.getAction()) { case visualization_msgs.Marker.ADD: if (!markers.containsKey(ns)) { markers.put(ns, new HashMap<Integer, Marker>()); enabledNamespaces.add(ns); namespaceList.add(ns); } markers.get(ns).put(id, new Marker(msg, super.camera, ftt)); break; case visualization_msgs.Marker.DELETE: Log.i("MarkerLayer", "Deleting marker " + ns + ":" + id); if (markers.containsKey(ns)) markers.get(ns).remove(id); break; default: Log.e("MarkerLayer", "Received a message with unknown action " + msg.getAction()); return; } } }
@Override protected String getMessageFrameId(visualization_msgs.Marker msg) { return msg.getHeader().getFrameId(); }