ContactWorldPlugin Class Reference

Contact manager world plugin. More...

#include <ContactWorldPlugin.hh>

Public Member Functions

 ContactWorldPlugin ()
 Constructs the object. More...
 
virtual ~ContactWorldPlugin ()
 Destroys the object. More...
 
virtual void Load (physics::WorldPtr _world, sdf::ElementPtr _sdf)
 Loads the plugin. More...
 
void onUpdate ()
 Callback on world update event Processes stored request, unsubscribes from contacts topic and clears messages. More...
 
void onContact (ConstContactsPtr &_msg)
 Callback on contact message received event Stores message for later processing in update callback. More...
 
void onRequest (ContactRequestPtr &_msg)
 Callback function for handling incoming requests Subscribes to "~/physics/contacts" topic, which decreases performance. Incoming contact messages are monitored in onContact callback function. More...
 
void onResponse (ContactResponsePtr &_msg)
 Callback function for handling outgoing responses. More...
 
void checkCollision (ContactResponse &_msg)
 Check for collisions and update response message. More...
 
void changeSurface (ContactResponse &_msg)
 Changes surface property from message. More...
 

Private Attributes

std::unique_ptr< ContactWorldPluginPrivatedata_ptr
 Class with private attributes. More...
 
physics::WorldPtr world
 World pointer. More...
 
event::ConnectionPtr update_connection
 Connection to world update event. More...
 
bool recv_msg {false}
 Flag for message received. More...
 
bool enabled {false}
 Flag for resetting contacts topic subscriber. More...
 
boost::shared_ptr< ContactRequest const > msg_req
 Last received request message. More...
 

Detailed Description

Contact manager world plugin.

Constructor & Destructor Documentation

Constructs the object.

~ContactWorldPlugin ( )
virtual

Destroys the object.

Member Function Documentation

void changeSurface ( ContactResponse _msg)

Changes surface property from message.

Parameters
_msgInput message
Deprecated:
Redundant feature already implemented in external dependency
void checkCollision ( ContactResponse _msg)

Check for collisions and update response message.

Parameters
_msgOutput message
void Load ( physics::WorldPtr  _world,
sdf::ElementPtr  _sdf 
)
virtual

Loads the plugin.

Parameters
_worldThe world pointer
_sdfThe sdf element pointer
void onContact ( ConstContactsPtr &  _msg)

Callback on contact message received event Stores message for later processing in update callback.

Parameters
_msgReceived message
void onRequest ( ContactRequestPtr _msg)

Callback function for handling incoming requests Subscribes to "~/physics/contacts" topic, which decreases performance. Incoming contact messages are monitored in onContact callback function.

Parameters
_msgThe message
void onResponse ( ContactResponsePtr _msg)

Callback function for handling outgoing responses.

Parameters
_msgThe message
void onUpdate ( )

Callback on world update event Processes stored request, unsubscribes from contacts topic and clears messages.

Member Data Documentation

std::unique_ptr<ContactWorldPluginPrivate> data_ptr
private

Class with private attributes.

bool enabled {false}
private

Flag for resetting contacts topic subscriber.

boost::shared_ptr<ContactRequest const> msg_req
private

Last received request message.

bool recv_msg {false}
private

Flag for message received.

event::ConnectionPtr update_connection
private

Connection to world update event.

physics::WorldPtr world
private

World pointer.


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