Skip to content

ci-group/pygazebo

 
 

Repository files navigation

pygazebo

https://travis-ci.org/ci-group/pygazebo.png?branch=develop https://coveralls.io/repos/ci-group/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 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 asyncio

import pygazebo
import pygazebo.msg.joint_cmd_pb2


async def publish_loop():
    manager = await pygazebo.connect()

    publisher = await 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:
        await publisher.publish(message)
        await asyncio.sleep(1.0)

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

About

Python bindings for the Gazebo multi-robot simulator.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.9%
  • Makefile 4.1%