Gazebo Gazebo

API Reference

6.16.0
TouchPlugin Class Reference

Plugin which checks if a model has touched some specific target for a given time continuously and exclusively. After the touch is completed, the plugin is disabled. It can be re-enabled through an Ignition transport service. More...

#include <TouchPlugin.hh>

Public Member Functions

 TouchPlugin ()
 Constructor. More...
 
 ~TouchPlugin () override=default
 Destructor. More...
 
void Configure (const Entity &_entity, const std::shared_ptr< const sdf::Element > &_sdf, EntityComponentManager &_ecm, EventManager &_eventMgr) override
 Configure the system. More...
 
void PostUpdate (const gz::sim::UpdateInfo &_info, const gz::sim::EntityComponentManager &_ecm) override
 
void PreUpdate (const UpdateInfo &_info, EntityComponentManager &_ecm) final
 Documentation inherited. More...
 
- Public Member Functions inherited from System
 System ()=default
 Constructor. More...
 
virtual ~System ()=default
 Destructor. More...
 

Detailed Description

Plugin which checks if a model has touched some specific target for a given time continuously and exclusively. After the touch is completed, the plugin is disabled. It can be re-enabled through an Ignition transport service.

It requires that contact sensors be placed in at least one link on the model on which this plugin is attached.

Parameters:

  • <target> Scoped name of the desired collision entity that is checked to see if it's touching this model. This can be a substring of the desired collision name so we match more than one collision. For example, using the name of a model will match all its collisions.
  • <time> Target time in seconds to maintain contact.
  • <namespace> Namespace for transport topics/services:
    • /<namespace>/enable : Service used to enable and disable the plugin.
    • /<namespace>/touched : Topic where a message is published once the touch event occurs.
  • <enabled> Set this to true so the plugin works from the start and doesn't need to be enabled.

Constructor & Destructor Documentation

◆ TouchPlugin()

Constructor.

◆ ~TouchPlugin()

~TouchPlugin ( )
overridedefault

Destructor.

Member Function Documentation

◆ Configure()

void Configure ( const Entity _entity,
const std::shared_ptr< const sdf::Element > &  _sdf,
EntityComponentManager _ecm,
EventManager _eventMgr 
)
overridevirtual

Configure the system.

Parameters
[in]_entityThe entity this plugin is attached to.
[in]_sdfThe SDF Element associated with this system plugin.
[in]_ecmThe EntityComponentManager of the given simulation instance.
[in]_eventMgrThe EventManager of the given simulation instance.

Implements ISystemConfigure.

◆ PostUpdate()

void PostUpdate ( const gz::sim::UpdateInfo _info,
const gz::sim::EntityComponentManager _ecm 
)
overridevirtual

Implements ISystemPostUpdate.

◆ PreUpdate()

void PreUpdate ( const UpdateInfo _info,
EntityComponentManager _ecm 
)
finalvirtual

Documentation inherited.

Implements ISystemPreUpdate.


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