Flatland
|
#include <model.h>
Public Member Functions | |
Model (b2World *physics_world, CollisionFilterRegistry *cfr, const std::string &ns, const std::string &name) | |
Constructor for the model. More... | |
~Model () | |
Destructor for the layer class. | |
EntityType | Type () const |
Return the type of entity. More... | |
void | LoadBodies (YamlReader &bodies_reader) |
load bodies to this model, throws exceptions upon failure More... | |
void | LoadJoints (YamlReader &joints_reader) |
load joints to this model, throws exceptions upon failure More... | |
ModelBody * | GetBody (const std::string &name) |
Get a body in the model using its name. More... | |
Joint * | GetJoint (const std::string &name) |
Get a body in the model using its name. More... | |
const std::vector< ModelBody * > & | GetBodies () |
const std::vector< Joint * > & | GetJoints () |
const std::string & | GetNameSpace () const |
std::string | NameSpaceTF (const std::string &frame_id) const |
std::string | NameSpaceTopic (const std::string &topic) const |
const std::string & | GetName () const |
const CollisionFilterRegistry * | GetCfr () const |
void | DebugVisualize () const override |
Publish debug visualizations for model. | |
void | DebugOutput () const override |
log debug messages for the layer | |
void | DumpBox2D () const |
Dump box2d data for debugging. | |
void | TransformAll (const Pose &pose_delta) |
transform all bodies in the model More... | |
void | SetPose (const Pose &pose) |
Explicitly set the model pose in world coordinates. More... | |
Public Member Functions inherited from flatland_server::Entity | |
Entity (b2World *physics_world, const std::string &name) | |
Constructor for the entity. More... | |
const std::string & | GetName () const |
b2World * | GetPhysicsWorld () |
Get Box2D physics world. More... | |
Entity (const Entity &)=delete | |
Entity & | operator= (const Entity &)=delete |
Static Public Member Functions | |
static Model * | MakeModel (b2World *physics_world, CollisionFilterRegistry *cfr, const std::string &model_yaml_path, const std::string &ns, const std::string &name) |
Create a model, throws exceptions upon failure. More... | |
Public Attributes | |
std::string | namespace_ |
namespace of the model | |
std::vector< ModelBody * > | bodies_ |
list of bodies in the model | |
std::vector< Joint * > | joints_ |
list of joints in the model | |
YamlReader | plugins_reader_ |
for storing plugins when paring YAML | |
CollisionFilterRegistry * | cfr_ |
Collision filter registry. | |
std::string | viz_name_ |
used for visualization | |
Public Attributes inherited from flatland_server::Entity | |
b2World * | physics_world_ |
Box2D physics world. | |
std::string | name_ |
name of the entity | |
Additional Inherited Members | |
Public Types inherited from flatland_server::Entity | |
enum | EntityType { LAYER, MODEL } |
Defines the type of entity. | |
This class defines a Model. It can be used to repsent any object in the environment such robots, chairs, deskes etc.
flatland_server::Model::Model | ( | b2World * | physics_world, |
CollisionFilterRegistry * | cfr, | ||
const std::string & | ns, | ||
const std::string & | name | ||
) |
Constructor for the model.
[in] | physics_world | Box2D physics world |
[in] | cfr | Collision filter registry |
[in] | name | Name of the model |
const std::vector< ModelBody * > & flatland_server::Model::GetBodies | ( | ) |
ModelBody * flatland_server::Model::GetBody | ( | const std::string & | name | ) |
Get a body in the model using its name.
[in] | name | Name of the body |
const CollisionFilterRegistry * flatland_server::Model::GetCfr | ( | ) | const |
Joint * flatland_server::Model::GetJoint | ( | const std::string & | name | ) |
Get a body in the model using its name.
[in] | name | Name of the joint |
const std::vector< Joint * > & flatland_server::Model::GetJoints | ( | ) |
const std::string & flatland_server::Model::GetName | ( | ) | const |
const std::string & flatland_server::Model::GetNameSpace | ( | ) | const |
void flatland_server::Model::LoadBodies | ( | YamlReader & | bodies_reader | ) |
load bodies to this model, throws exceptions upon failure
[in] | bodies_reader | YAML reader for node containing the list of bodies |
void flatland_server::Model::LoadJoints | ( | YamlReader & | joints_reader | ) |
load joints to this model, throws exceptions upon failure
[in] | joints_reader | YAML reader for node containing the list of joints |
|
static |
Create a model, throws exceptions upon failure.
[in] | physics_world | Box2D physics world |
[in] | cfr | Collision filter registry |
[in] | model_yaml_path | Absolute path to the model yaml file |
[in] | ns | Namespace of the robot |
[in] | name | Name of the model |
std::string flatland_server::Model::NameSpaceTF | ( | const std::string & | frame_id | ) | const |
std::string flatland_server::Model::NameSpaceTopic | ( | const std::string & | topic | ) | const |
void flatland_server::Model::SetPose | ( | const Pose & | pose | ) |
Explicitly set the model pose in world coordinates.
[in] | pose | world x, world y, world yaw |
void flatland_server::Model::TransformAll | ( | const Pose & | pose_delta | ) |
transform all bodies in the model
[in] | pose_delta | dx, dy, dyaw |
|
inlinevirtual |