Main Content

Gazebo Subscribe

Receive custom messages from Gazebo server

Since R2020b

  • Gazebo Subscribe block

Libraries:
Robotics System Toolbox / Gazebo Co-Simulation

Description

The Gazebo Subscribe block receives custom messages from Gazebo server based on the topic and message type that the block specifies. The block outputs the latest message received as a bus signal, Msg, and a Boolean, IsNew, which indicates whether a message was received during the previous time step.

To receive custom messages, connect to a Gazebo simulation. Open the block mask and click Configure Gazebo network and simulation settings. For more information see Configure Gazebo Simulation.

This block is part of a co-simulation interface between MATLAB® and Gazebo for exchanging data and sending commands.

Limitations

  • Models that use this block do not support Code Generation or Rapid Accelerator mode.

Ports

Output

expand all

Status of the custom message received, output as a Boolean, which indicates whether the block output Msg was received in the previous time step.

Data Types: Boolean

Gazebo custom message, output as a bus signal, with elements relevant to the specific Topic and Message type.

The Msg output always outputs the most recent message received.

Data Types: bus

Parameters

expand all

To get a topic from an existing Gazebo simulation, select From Gazebo. Click the Select button to see a list of available topics. To connect to a Gazebo simulation, click Configure Gazebo network and simulation settings in the block mask.

To enter a custom topic without an active Gazebo connection, select Specify your own. Use the Topic parameter to type the name of the message.

Topic name of custom message, specified as a string.

To get a topic from an existing Gazebo simulation, select From Gazebo. Click the Select button to see a list of available topics. To connect to a Gazebo simulation, click Configure Gazebo network and simulation settings in the block mask.

To specify a topic without connecting, select Specify your own.

Click Select to get a list of message types available in Gazebo. If you choose your Topic from a connected Gazebo simulation, this parameter is set automatically.

Sample time indicates the interval at which messages are received from the Gazebo simulator.

More About

expand all

Version History

Introduced in R2020b