Apartment Navigation
Gazebo Sim plugin for apartment robot navigation
Loading...
Searching...
No Matches
boris_apartment::RobotPlugin Class Reference

Gazebo Sim plugin for differential drive robot via cmd_vel. More...

Inheritance diagram for boris_apartment::RobotPlugin:

Public Member Functions

void Configure (const gz::sim::Entity &p_entity, const std::shared_ptr< const sdf::Element > &_sdf, gz::sim::EntityComponentManager &p_ecm, gz::sim::EventManager &_eventMgr) override
 Called once when the plugin is loaded.
void PreUpdate (const gz::sim::UpdateInfo &p_info, gz::sim::EntityComponentManager &p_ecm) override
 Called every simulation step before physics integration. Called repeadedly, even when simulation is paused.

Detailed Description

Gazebo Sim plugin for differential drive robot via cmd_vel.

Subscribes to /model/<name>/cmd_vel (gz.msgs.Twist) and uses differential drive kinematics to map to left and right wheel angular velocities:

  • linear.x → forward/backward speed (m/s)
  • angular.z → rotation speed (rad/s)

Register in your SDF with:

<plugin filename="librobot_plugin.so" name="boris_apartment::RobotPlugin"/>

Member Function Documentation

◆ Configure()

void boris_apartment::RobotPlugin::Configure ( const gz::sim::Entity & p_entity,
const std::shared_ptr< const sdf::Element > & _sdf,
gz::sim::EntityComponentManager & p_ecm,
gz::sim::EventManager & _eventMgr )
inlineoverride

Called once when the plugin is loaded.

Resolves the model entity and subscribes to its cmd_vel topic.

Parameters
p_entitySDF entity that owns this plugin.
_sdfParsed SDF element (unused).
p_ecmEntity-component manager for the simulation world.
_eventMgrEvent manager (unused).

◆ PreUpdate()

void boris_apartment::RobotPlugin::PreUpdate ( const gz::sim::UpdateInfo & p_info,
gz::sim::EntityComponentManager & p_ecm )
inlineoverride

Called every simulation step before physics integration. Called repeadedly, even when simulation is paused.

Reads the latest velocity command (under mutex) and applies differential drive kinematics to compute left and right wheel velocities, then commands both wheels via JointVelocityCmd components.

Parameters
p_infoSimulation step metadata (time, paused flag, …).
p_ecmEntity-component manager for the simulation world.

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