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< ContactWorldPluginPrivate > | data_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... | |
Contact manager world plugin.
Constructs the object.
|
virtual |
Destroys the object.
| void changeSurface | ( | ContactResponse & | _msg | ) |
Changes surface property from message.
| _msg | Input message |
| void checkCollision | ( | ContactResponse & | _msg | ) |
Check for collisions and update response message.
| _msg | Output message |
|
virtual |
Loads the plugin.
| _world | The world pointer |
| _sdf | The sdf element pointer |
| void onContact | ( | ConstContactsPtr & | _msg | ) |
Callback on contact message received event Stores message for later processing in update callback.
| _msg | Received 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.
| _msg | The message |
| void onResponse | ( | ContactResponsePtr & | _msg | ) |
Callback function for handling outgoing responses.
| _msg | The message |
| void onUpdate | ( | ) |
Callback on world update event Processes stored request, unsubscribes from contacts topic and clears messages.
|
private |
Class with private attributes.
|
private |
Flag for resetting contacts topic subscriber.
|
private |
Last received request message.
|
private |
Flag for message received.
|
private |
Connection to world update event.
|
private |
World pointer.