Package: roslibpy
Python ROS Bridge libraryallows to use Python and IronPython to interact
withROS, the open-source robotic middleware.
It uses WebSockets to connect torosbridge 2.0and provides publishing,
subscribing, service calls, actionlib, TF, and other essential ROS functionality.Unlike therospylibrary, this does not require a
local ROS environment, allowing usage from platforms other than Linux.The API ofroslibpyis modeled to closely match that ofroslibjs.Main featuresTopic publishing and subscribing.Service calls (client).Service advertisement (server).ROS parameter management (get/set/delete).ROS API services for getting ROS meta-information.Actionlib support for interfacing with preemptable tasks.TF Client via thetf2_web_republisher.Roslibpyruns on Python 3.x and IronPython 2.7.InstallationTo installroslibpy, simply usepip:pip install roslibpyFor IronPython, thepipcommand is slightly different:ipy -X:Frames -m pip install --user roslibpyRemember that you will need a working ROS setup including therosbridge serverandTF2 web republisheraccessible within your network.DocumentationThe full documentation, including examples and API reference
is available onreadthedocs.ContributingMake sure you setup your local development environment correctly:Clone theroslibpyrepository.Create a virtual environment.Install development dependencies:pip install -r requirements-dev.txtYou’re ready to start coding!During development, usepyinvoketasks on the
command prompt to ease recurring operations:invoke clean: Clean all generated artifacts.invoke check: Run various code and documentation style checks.invoke docs: Generate documentation.invoke test: Run all tests and checks in one swift command.invoke: Show available tasks.For more details, check theContributor’s Guideavailable as part ofthe documentation.The default branch was recently renamed tomain. If you’ve already cloned this repository,
you’ll need to update your local repository structure with the following lines:git branch -m master main
git fetch origin
git branch -u origin/main mainReleasing this projectReady to release a new versionroslibpy? Here’s how to do it:We usesemver, i.e. we bump versions as follows:patch: bugfixes.minor: backwards-compatible features added.major: backwards-incompatible changes.Update theCHANGELOG.rstwith all novelty!Ready? Release everything in one command:invoke release [patch|minor|major]Profit!CreditsThis library is based onroslibjsand to a
large extent, it is a line-by-line port to Python, changing only where a more
idiomatic form makes sense, so a huge part of the credit goes to theroslibjs authors.ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelogand this project adheres toSemantic Versioning.1.6.0AddedAdded authentication functionality described in [rosauth](http://wiki.ros.org/rosauth).ChangedFixedDeprecatedRemoved1.5.0AddedAdded a wait event to close on IronPython to ensure the close request is sent before returning.ChangedFixedFixed reconnection behavior on IronPython which would trigger reconnects even after a manual disconnect.DeprecatedRemoved1.4.2AddedChangedAddedtlsto the twisted requirement (#111).FixedDeprecatedRemoved1.4.1AddedChangedFixedFixed bug with action client/server and now they work as expected.Fixed Python 2.7 incompatibilities introduced in 1.4.0.DeprecatedRemoved1.4.0AddedChangedSwitched toblackfor python code formatting.Fix incompatible settings betweenblackandflake8.Updated Github Actions workflows to remove python 3.6 builds.Replaced occurrences ofraise Exceptionwith more specificExceptionsubclasses.FixedDeprecatedRemoved1.3.0AddedAdded function to set the default timeout value.Added ROS host and port parameters to the command-line interface.FixedFixed #87 where a goal could be marked as terminal on result alone rather
than both result and status.Ensure input ofTimeis always two integers.1.2.1AddedChangedFixedFixed blocking issues on the Twisted/Autobahn-based implementation of websockets.DeprecatedRemoved1.2.0ChangedChanged behavior: Advertising services automatically reconnect when websockets is reconnected.References to ROS master change to ROS.AddedAddedHeaderandTimedata types.Added ROS API method to retrieve current ROS time:ros.get_time.1.1.0AddedAddedset_initial_delay,set_max_delayandset_max_retriestoRosBridgeClientFactoryto control reconnection parameters.Addedclosingevent toRosclass that gets triggered right before closing the connection.1.0.0ChangedChanged behavior: Topics automatically reconnect when websockets is reconnected.AddedAdded blocking behavior to more ROS API methods:ros.get_nodesandros.get_node_details.Added reconnection support to IronPython implementation of websockets.Added automatic topic reconnection support for both subscribers and publishers.FixedFixed reconnection issues on the Twisted/Autobahn-based implementation of websockets.0.7.1FixedFixed blocking service calls for Mac OS.0.7.0ChangedThe non-blocking event loop runnerrun()now defaults to 10 seconds timeout before raising an exception.AddedAdded blocking behavior to ROS API methods, e.g.ros.get_topics.Added command-line mode to ROS API, e.g.roslibpy topic list.Added blocking behavior to theParamclass.Added parameter manipulation methods toRosclass:get_param,set_param,delete_param.0.6.0ChangedFor consistency,timeoutparameter ofGoal.send()is now expressed inseconds, instead of milliseconds.DeprecatedThetimeoutparameter ofActionClient()is ignored in favor of blocking until the connection is established.FixedRaise exceptions when timeouts expire on ROS connection or service calls.AddedSupport for calling a function in a thread from the Ros client.Added implementation of a Simple Action Server.0.5.0ChangedThe non-blocking event loop runner now waits for the connection to be established in order to minimize the need foron_readyhandlers.AddedSupport blocking and non-blocking service calls.FixedFixed an internal unsubscribing issue.0.4.1FixedResolve reconnection issues.0.4.0AddedAdd a non-blocking event loop runner.0.3.0ChangedUnsubscribing from a listener no longer requires the original callback to be passed.0.2.1FixedFix JSON serialization error on TF Client (on Python 3.x).0.2.0AddedAdd support for IronPython 2.7.ChangedHandleron_readynow defaults to run the callback in thread.DeprecatedRenamerun_event_loopto the more fittingrun_forever.0.1.1FixedMinimal documentation fixes.0.1.0AddedInitial version.