-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds the python bindings tutorial #450
Changes from 1 commit
da3094b
80212ae
d1de32d
b774eb6
e407bf5
46e050b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
|
||
from gz.msgs10.stringmsg_pb2 import StringMsg | ||
from gz.msgs10.vector3d_pb2 import Vector3d | ||
from gz.transport13 import AdvertiseMessageOptions | ||
from gz.transport13 import Node | ||
|
||
import time | ||
|
@@ -39,10 +38,11 @@ def main(): | |
while True: | ||
count += 1 | ||
vector3d_msg.x = count | ||
if not (pub_stringmsg.publish(stringmsg_msg) or pub_vector3d.publish(vector3d_msg)): | ||
if not (pub_stringmsg.publish(stringmsg_msg)): | ||
break | ||
|
||
print("Publishing 'Hello' on topic [{}]".format(stringmsg_topic)) | ||
if not (pub_vector3d.publish(vector3d_msg)): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
break | ||
print("Publishing a Vector3d on topic [{}]".format(vector3d_topic)) | ||
time.sleep(0.1) | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -20,5 +20,5 @@ combination of custom code and [ZeroMQ] (http://zeromq.org/). | |||||
|
||||||
## What programming language can I use with Gazebo Transport? | ||||||
|
||||||
C++ is the native implementation and so far the only way to use the library. | ||||||
We hope to offer different wrappers for the most popular languages in the future. | ||||||
C++ is the native implementation and the only language that have available all library features. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
Python implementation is a wrapper around C++ methods using pybind11. It does not support all features like C++, but, contains the main features such as publication, subscription and service request. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can drop the parens now that there is a single condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.