Ask Your Question

Do marker namespaces and ids actually do anything?

asked 2015-08-10 15:35:14 -0500

Sebastian gravatar image

I am having trouble understanding the purpose of namespaces and ids as applied to markers. I am specifically referring to some of the info provided on this wiki page.

It says that if a marker has the same namespace and id as an existing marker, then it will clear the existing marker. I have not found this to be the case. In fact, I had been setting all of my markers to the same namespace and id without any problem.

Additionally, I don't understand how this behavior could even be achieved. A publisher can only publish a single topic and hence can only publish a single marker. Isn't the topic name the true unique identifier for markers?

The reason I am asking is because I am writing a class that "manages" a bunch of markers.

edit retag flag offensive close merge delete


" A publisher can only publish a single topic and hence can only publish a single marker." No. The publisher can first publish a marker with id 0 and then a marker with id 1 on the same topic. How have you published your markers with the same namespace and id?

NEngelhard gravatar image NEngelhard  ( 2015-08-10 17:16:13 -0500 )edit

I published them with different publishers. I have my marker topic latched, maybe that is the problem...?

Sebastian gravatar image Sebastian  ( 2015-08-10 17:21:09 -0500 )edit

The namespace/id-combination only has to be unique within a single topic. Otherwise someone else could overwrite your markers to easy. So if you send two markers on different topics, they will never interfere.

NEngelhard gravatar image NEngelhard  ( 2015-08-10 17:49:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-11 01:24:09 -0500

I'm not sure what the details of your use-case are, but here are a few points to consider:

  • Depending on the subscriber queue size and the rate at which you publish, publishing single Markers can either work well (if you don't overwhelm the subscriber queue) or not well (when you overwhelm the subscriber queue). In the latter case, messages get lost and not processed on the subscriber side.
  • If you set Marker to have the same namespace and id as a previous one, the previous one should indeed disappear (as it gets overwritten by the new one if the action is set to "add/modify", which is the default).
  • If you publish multiple markers it is recommended to use a MarkerArray publisher, as this allows publishing an array of Markers. This avoids the problem with potentially unpredictable behavior mentioned in the first bullet.
  • I'd recommend getting rid of the latching for your publishers you mentioned, at least for testing. If you have multiple latched publishers in a node (or multiple nodes latching the same topic), the behavior can be counterintuitive.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-08-10 15:35:14 -0500

Seen: 1,255 times

Last updated: Aug 11 '15