Flatland
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
flatland_server::ModelPlugin Class Reference

#include <model_plugin.h>

Inheritance diagram for flatland_server::ModelPlugin:
Inheritance graph
[legend]
Collaboration diagram for flatland_server::ModelPlugin:
Collaboration graph
[legend]

Public Member Functions

ModelGetModel ()
 Get model.
 
void Initialize (const std::string &type, const std::string &name, Model *model, const YAML::Node &config)
 The method to initialize the ModelPlugin, required since Pluginlib require the class to have a default constructor. More...
 
bool FilterContact (b2Contact *contact, Entity *&entity, b2Fixture *&this_fixture, b2Fixture *&other_fixture)
 Helper function check if this model is part of the contact, and extracts all the useful information. More...
 
bool FilterContact (b2Contact *contact)
 Helper function check if this model is part of the contact. More...
 
- Public Member Functions inherited from flatland_server::FlatlandPlugin
const PluginType Type ()
 
const std::string & GetName () const
 Get plugin name.
 
const std::string & GetType () const
 Get type of plugin.
 
virtual void OnInitialize (const YAML::Node &config)=0
 The method for the particular model plugin to override and provide its own initialization. More...
 
virtual void BeforePhysicsStep (const Timekeeper &timekeeper)
 This method is called before the Box2D physics step. More...
 
virtual void AfterPhysicsStep (const Timekeeper &timekeeper)
 This method is called after the Box2D physics step. More...
 
virtual void BeginContact (b2Contact *contact)
 A method that is called for all Box2D begin contacts. More...
 
virtual void EndContact (b2Contact *contact)
 A method that is called for all Box2D end contacts. More...
 
virtual void PreSolve (b2Contact *contact, const b2Manifold *oldManifold)
 A method that is called for Box2D presolve. More...
 
virtual void PostSolve (b2Contact *contact, const b2ContactImpulse *impulse)
 A method that is called for Box2D postsolve. More...
 
virtual ~FlatlandPlugin ()=default
 Flatland plugin destructor.
 

Public Attributes

ros::NodeHandle nh_
 ROS node handle.
 
- Public Attributes inherited from flatland_server::FlatlandPlugin
std::string type_
 type of the plugin
 
std::string name_
 name of the plugin
 
ros::NodeHandle nh_
 
PluginType plugin_type_
 

Protected Member Functions

 ModelPlugin ()=default
 Model plugin default constructor.
 

Additional Inherited Members

- Public Types inherited from flatland_server::FlatlandPlugin
enum  PluginType { Invalid, Model, World }
 

Detailed Description

This class defines a model plugin. All implemented model plugins will inherit from it A model plugin is a plugin that is directly tied to a single model in the world

Member Function Documentation

bool flatland_server::ModelPlugin::FilterContact ( b2Contact *  contact,
Entity *&  entity,
b2Fixture *&  this_fixture,
b2Fixture *&  other_fixture 
)

Helper function check if this model is part of the contact, and extracts all the useful information.

Parameters
[in]contactBox2D contact
[out]entityThe entity that collided with this model
[out]this_fixtureThe fixture from this model involved in the collision
[out]other_fixtureThe fixture from the other entity involved in the collision
Returns
True or false depending on if this model is involved. If false is returned, none of the entity, this_fixture, other_fixture pointers will be populated
bool flatland_server::ModelPlugin::FilterContact ( b2Contact *  contact)

Helper function check if this model is part of the contact.

Parameters
[in]contactBox2D contact
Returns
True or false depending on if this model is involved
void flatland_server::ModelPlugin::Initialize ( const std::string &  type,
const std::string &  name,
Model model,
const YAML::Node &  config 
)

The method to initialize the ModelPlugin, required since Pluginlib require the class to have a default constructor.

Parameters
[in]typeType of the plugin
[in]nameName of the plugin
[in]modelThe model associated with this model plugin
[in]configThe plugin YAML node

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