Closed Voldivh closed 12 months ago
Merging #411 (2c1f3dd) into main (917bf04) will decrease coverage by
0.33%
. The diff coverage is74.26%
.:exclamation: Current head 2c1f3dd differs from pull request most recent head 5371b41. Consider uploading reports for the commit 5371b41 to get more accurate results
@@ Coverage Diff @@
## main #411 +/- ##
==========================================
- Coverage 87.43% 87.11% -0.33%
==========================================
Files 60 61 +1
Lines 5291 5462 +171
==========================================
+ Hits 4626 4758 +132
- Misses 665 704 +39
Impacted Files | Coverage Δ | |
---|---|---|
python/src/transport/_gz_transport_pybind11.cc | 74.26% <74.26%> (ø) |
This requires https://github.com/gazebosim/gz-msgs/pull/355.
Added the python version example of https://github.com/gazebosim/gz-sim/tree/main/examples/standalone/multi_lrauv_race in https://github.com/gazebosim/gz-transport/pull/411/commits/2f23947262eb71c4b43c6e16705fc5565ee5f2ad using the bindings created on this PR. In order to run it follow the next steps, this takes into account that you have Gazebo installed and gz-transport
package compiled:
main
branch):
gz sim <path_to_ws>/src/gz-sim/examples/worlds/multi_lrauv_race.sdf
PYTHONPATH
variable:
export PYTHONPATH=$PYTHONPATH:<path_to_ws>/install/lib/python
python3 <path_to_ws>/src/gz-transport/python/examples/multi_lrauv_race.py
I have one test failure. Not sure if it's failing for you. Also, I know I asked you to rebase this to work with new message generation framework in
gz-msgs
. But since that's been reverted, could you also revert the change here? I plan to open a gz-msgs PR that uses the old message generation framework and adds python bindings.
No problem, just one question then, should I change this PR to target the main
branch as before then?
I have one test failure. Not sure if it's failing for you. Also, I know I asked you to rebase this to work with new message generation framework in
gz-msgs
. But since that's been reverted, could you also revert the change here? I plan to open a gz-msgs PR that uses the old message generation framework and adds python bindings.No problem, just one question then, should I change this PR to target the
main
branch as before then?
Yes, target the main
branch.
@osrf-jenkins run tests please
I've built gz-msgs10 debians just for Jammy for testing and added a new dependency in https://github.com/gazebosim/gz-transport/pull/411/commits/e1bca5ec9b41c9569618fc83317c9a6f188e9102. It looks like tests are passing on Jenkins 🎉
https://github.com/gazebo-release/gz-msgs10-release/pull/6 is merged and I've built the debs for Focal and Jammy, so I'll run tests again.
@osrf-jenkins run tests please
@osrf-jenkins run tests please
🎉 New feature
Closes #387
Summary
This PR creates the python bindings for the publisher, subscriber and request features from the repository. In order to avoid creating a new dependency to be able to create python bindings from protobuf messages, it was decided to use the methods that publishes, subscribes and make services request with serialized messages, i.e, use the methods
PublishRaw
,SubscribeRaw
andRequestRaw
. The bindings for these methods are wrapped by python methods in order to give the user an API similar to the one we have in C++.We would like to acknowledge and give credit to @srmainwaring for his code which served as a reference and inspiration for this implementation. The main difference with this implementation is that we are using the methods that uses serialized messages instead of creating bindings with the
pybind11_protobuf
library to the non-serialized methods.Test it
There are some examples that were created as smoke test in order to test out the functionality. In order to use them you would have to:
PYTHONPATH
variable:Note: The service requester example will only work if there is a server running that listens to
/echo
topic and expects agz.messages.StringMsg
as the request. One way to do so is to follow the instructions on the examples folder and run theresponser
executable.