pygazebo package

Python bindings to the Gazebo multi-robot simulator

This package provides a python API to interact with the Gazebo multi-robot simulator, http://www.gazebosim.org. Gazebo is a multi-robot simulator for outdoor environments. Like Stage, it is capable of simulating a population of robots, sensors and objects, but does so in a three-dimensional world. It generates both realistic sensor feedback and physically plausible interactions between objects (it includes an accurate simulation of rigid-body physics).

pygazebo implements the Gazebo network publish-subscribe protocol, so that python applications can seamlessly interact with Gazebo entities.

pygazebo is based on eventlet for asynchronous network operations.

pygazebo.connect(address=('127.0.0.1', 11345))

Create a connection to the Gazebo server.

The Manager instance creates a connection to the Gazebo server, then allows the client to either advertise topics for publication, or to listen to other publishers.

Parameters:address (a tuple of (‘host’, port)) – destination TCP server
Returns:a Future indicating when the connection is ready
class pygazebo.Publisher

Publishes data to the Gazebo publish-subscribe bus.

Variables:
  • topic – (string) the topic name this publisher is using
  • msg_type – (string) the Gazebo message type
publish(msg)

Publish a new instance of this data.

Parameters:msg (google.protobuf.Message instance) – the message to publish
Returns:a future which completes when the data has been written
remove()

Stop advertising this topic.

Note: Once remove() is called, no further methods should be called.

wait_for_listener()

Return a Future which is complete when at least one listener is present.

class pygazebo.Subscriber(local_host, local_port)

Receives data from the Gazebo publish-subscribe bus.

Variables:
  • topic – (str) The topic name this subscriber is listening for.
  • msg_type – (str) The Gazebo message type.
  • callback – (function) The current function to invoke.
remove()

Stop listening for this topic.

Note: Once remove() is called, the callback will no longer be invoked.

Table Of Contents

Previous topic

History

Next topic

pygazebo.msg package

This Page