Common Used System Plugin API¶
important part in api doc:
- gz::sim
- gz::sim::EntityComponentManager
- gz::sim::components
Understand Component¶
using X = Component<DataType, class Tag>;
// or
using X = Component<DataType, class Tag, Serializer>;
to access component: components::X , X is the component Name
Datatype: data type of that component
Serializer: use for data transfer (not so important)



access:
- components::Name
- components::LinearVelocity
- components::Model
System Plugin Steps¶

1. Find The Entity¶
We will take help of components to find entity integer value like:
- has
Namecomponent of valuexyz - has both
EntityandNamecomponents
a. plugin is directly attached to entity
in world file .sdf codeb. search the entity by its name
c. find multiple entity
//check for such components which has Light, Name components
// each
_ecm.Each<components::Light, components::Name>(
[&](const Entity &_entity,
const components::Light *,
const components::Name *_name) -> bool
{
this->lightEntites.push_back(_entity);
// gzmsg << "Found light: " << _name->Data()
// << " (entity " << _entity << ")\n";
return true;
});
d. find EntityByComponents
uing ```EntityByComponents()``` find such a joint entity which has all of the followings components: parent entity is ***model component*** to which plugin is attached, has a ***name component*** of value ```joint_1``` ***joint compenent*** is attach on it [reference code](https://github.com/gazebosim/gz-sim/blob/gz-sim8/src/Model.cc#L132C1-L133C1)2. Read/Write on the Component value¶

...Cmd means to command to change that container value like LinearVelocityCmd, WorldPoseCmd, VisualCmd