Skip to content

jpieper/pygazebo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c3047cf · Nov 18, 2016

History

78 Commits
Jul 4, 2014
Nov 15, 2016
Jun 8, 2014
Feb 10, 2014
Feb 11, 2014
Feb 9, 2014
Feb 10, 2014
Feb 10, 2014
Jul 4, 2014
Feb 8, 2014
Feb 8, 2014
Jul 4, 2014
Aug 14, 2014
Feb 11, 2014
Nov 30, 2014
Nov 30, 2014
Feb 9, 2014

Repository files navigation

pygazebo

https://travis-ci.org/jpieper/pygazebo.png?branch=develop https://pypip.in/d/pygazebo/badge.png https://coveralls.io/repos/jpieper/pygazebo/badge.png?branch=develop

pygazebo provides python bindings for the Gazebo (http://gazebosim.org) multi-robot simulator.

Features

  • Supports publishing and subscribing to any Gazebo topics using a straightforward python API.
  • Python versions of all defined Gazebo protobuf messages are included.
  • Based on asyncio/trollius for flexible concurrency support.

Simple Usage

The following example shows how easy it is to publish a message repeatedly to control a single joint in a Gazebo model running on the local machine on the default port.

import trollius
from trollius import From

import pygazebo
import pygazebo.msg.joint_cmd_pb2

@trollius.coroutine
def publish_loop():
    manager = yield From(pygazebo.connect())

    publisher = yield From(
        manager.advertise('/gazebo/default/model/joint_cmd',
                          'gazebo.msgs.JointCmd'))

    message = pygazebo.msg.joint_cmd_pb2.JointCmd()
    message.name = 'robot::joint_name'
    message.axis = 0
    message.force = 1.0

    while True:
        yield From(publisher.publish(message))
        yield From(trollius.sleep(1.0))

loop = trollius.get_event_loop()
loop.run_until_complete(publish_loop())