IntrospectionManager Class Reference

addtogroup gazebo_util More...

#include <util/util.hh>

Inherits SingletonT< IntrospectionManager >.

Public Member Functions

void Clear ()
 Unregister all items. More...
 
std::string Id () const
 Get the unique ID of this manager. More...
 
std::set< std::string > Items () const
 Get a copy of the items already registered in this manager. More...
 
void NotifyUpdates ()
 If there are changes in the items list since the last update, a new message is published under the topic "/introspection/<manager_id>/items_update". More...
 
template<typename T >
bool Register (const std::string &_item, const std::function< T()> &_cb)
 Register a new item in the introspection manager. More...
 
bool Unregister (const std::string &_item)
 Unregister an existing item from the introspection manager. More...
 
void Update ()
 Update all the items under observation and publish updates through all the topics. More...
 

Static Public Member Functions

static IntrospectionManagerInstance ()
 Get an instance of the singleton. More...
 

Detailed Description

addtogroup gazebo_util

Member Function Documentation

◆ Clear()

void Clear ( )

Unregister all items.

◆ Id()

std::string Id ( ) const

Get the unique ID of this manager.

Returns
Manager ID.

◆ Instance()

static IntrospectionManager * Instance ( )
inlinestaticinherited

Get an instance of the singleton.

◆ Items()

std::set<std::string> Items ( ) const

Get a copy of the items already registered in this manager.

Returns
Set of registered items.

◆ NotifyUpdates()

void NotifyUpdates ( )

If there are changes in the items list since the last update, a new message is published under the topic "/introspection/<manager_id>/items_update".

◆ Register()

bool Register ( const std::string &  _item,
const std::function< T()> &  _cb 
)
inline

Register a new item in the introspection manager.

Parameters
[in]_itemNew item. E.g.: /default/world/model1/pose
[in]_cbCallback used to get the last update for this item.
Returns
True when the registration succeed or false otherwise (item already existing).

References gazebo::msgs::ConvertAny().

◆ Unregister()

bool Unregister ( const std::string &  _item)

Unregister an existing item from the introspection manager.

Parameters
[in]_itemItem to remove.
Returns
True if the unregistration succeed or false otherwise (the item was not previously registered).

◆ Update()

void Update ( )

Update all the items under observation and publish updates through all the topics.

The message received in the update will contain the name and latest values of all the items specified in the filter. If there are changes in the items list since the last update, a new message is published under the topic "/introspection/<manager_id>/items_update".


The documentation for this class was generated from the following file: