This (1) remembers the token by which a model was
defined in the world file, (2) provides little accessor
functions for model.token and model.type, and (3) also
provides a way to iterate over the top-level models
(models with no parents) in the world (with a wrapper
API around g_hash_table_foreach).
Example of the model definition thing: given this world
define p3dx position (
The *type* of the model with name "my_robot" is
"position" (2), but the "typestr" I add will be "p3dx".
I use this in MobileSim to indicate which Pioneer model
you want, so I can send that to the client, and do
other things. An alternative to this scheme would be
to have a way of just throwing stuff into the model's
"props" datalist "property bag" from the world file,
which I may implement anyway to store some very
pioneer-specific conversion factors and other parameters.
Log in to post a comment.