-
Notifications
You must be signed in to change notification settings - Fork 1
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
Importing gz.transport module throws an error message. #18
Comments
Hi @kkishore9891 - this similar to the issue discussed in #17. The problem is the version of the protobuf compiler used in the binary build is not compatible with the version required by pybind11_protobuf. At the moment you'll need a source build of gazebo garden to get everything consistent. |
Got it. I will try that. I will close the issue myself once I get it working. Thank you. |
No prob. I should update the README stating only source builds are supported. |
Hello @srmainwaring . I tried building gz-garden from source and I still got the same error:
|
What version of protoc do you have installed? protoc --version |
libprotoc 3.12.4 |
Ok - it's expecting gz-python/cmake/dependencies/CMakeLists.txt Lines 1 to 14 in c38289b
If you read through #17 you'll see a section on updating cmake and protoc with instructions. Once these are updated you can rebuild |
Hello! I have updated cmake and protoc. CMake suite maintained and supported by Kitware (kitware.com/cmake). Trying to build gz-python by running cmake .. and make commands the build directory throws the following error: I am guessing maybe I should build garden once again from scratch using the new cmake and protoc versions? |
Yes - either a clean build, or remove the gz-msgs and gs-transport subfolder from ./build and ./install and rebuild. Looks like the original proto headers were not regenerated. |
I couldn't even build gz-garden from scratch with the new cmake and protoc anymore. I am getting this error: `--- stderr: gz-math7 Finished <<< gz-math7 [28.0s] Failed <<< sdformat13 [2.47s, exited with code 1] Summary: 4 packages finished [37.0s] |
Odd - unsure why the build is missing Python headers.
which python
python --version
which python3
python3 --version |
1)I am using Ubuntu 22.04 |
@kkishore9891 I've added a GHW to build on Ubuntu 22.04 (#13). There is also an update in the dependency on pybind11_protobuf as the cmake PR was merged yesterday (#19). The CI build is clean against a binary installation of Gazebo Garden, so I am not sure what is different with your environment that is preventing the project from building correctly. The GHW yaml file under |
So I am trying to build gz-garden from scratch after updating the cmake and the protoc versions and I am getting error messages now especially while building the gz-msgs package. Here is the log file: These builds used to work properly with the earlier cmake and protoc versions. So I am suspecting that the update had something to do with it. |
I am trying to build the ros_gz_sim package and even that throws errors. It used to work perfectly fine before updating protoc. |
In which case you should roll back the changes to cmake and protoc. You may need to delete some of the files manually as the cmake builds do not have uninstallers (running make install will show you where all the files are placed). Then re-install cmake and protoc with apt. Apologies that this is causing you difficulties - I'm going through the install on an Ubuntu 22.04 VM to see if I can replicate the first issue you saw. My initial assumption that this was the same issues as seen on Ubuntu 20.04 does not seem to be correct. System$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy $ python --version
Python 3.10.6
$ python -m platform
Linux-5.19.0-35-generic-x86_64-with-glibc2.35 $ cmake --version
cmake version 3.22.1
CMake suite maintained and supported by Kitware (kitware.com/cmake). Build
C++ example
Python example$ ./python/publisher.py
Traceback (most recent call last):
File "/home/rhys/Code/robotics/gz_python_ws/src/gz-python/./python/publisher.py", line 21, in <module>
from gz.transport import AdvertiseMessageOptions
ImportError: /home/rhys/Code/robotics/gz_python_ws/src/gz-python/build/python/gz/transport.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN17pybind11_protobuf21PyProtoDescriptorNameB5cxx11EN8pybind116handleE Ok - so I can replicate the problem. Let me figure out why this is not working. Update It's a runtime dynamic library resolution problem - I'll need to put in a proper fix to install the libs correctly when using fetch content to build, but a quick workaround is to edit # pybind11_native_proto_caster shared library
add_library(pybind11_native_proto_caster SHARED with
|
Hello! Thank you so much. I was just about to comment that I installed the latest versions of protoc and cmake with working build and I still get the same error anyways.
|
Yep - library path. Strange as this has been working so not sure what's changed re. dependent libraries. Also need to add some Python tests to the CI as this is a runtime rather than build issue. A good check that things are working well is to run
|
Exactly! It works now! Thank you! Also could you please guide me on how to call gazebo services using this package? |
For service requests take a look at https://github.com/srmainwaring/gz-python/blob/srmainwaring/service-request/python/pid_service.py There are two examples: the non-blocking call-back example requires an upstream release of |
Hello! Immense thank you for writing these bindings and supporting them! I ran into this issue as well and (since I'm relatively new to cmake) I found that re-running Regards, |
Hi @tblaha - yes you'll have to update it manually after running cmake (as it will detect the change and refetch). I either need to make a change upstream in pybind11_protobuf or add a patch which gets applied during configuration. I haven't got round to that yet. |
Not a problem! Thanks for confirming! |
Hello! First here is the context:
I am trying to work on a project to control a camera gimbal for a drone using python in gazebo garden. I initially tried using the ros2_gz bridge to control the joints but that slows down the real time factor of the simulation by a large amount thus I am trying to use a python binding to directly interface with gz and hence I tried to install this package.
Now to get to the problem:
I have a binary installation of gz-garden and I followed the instructions given in the README.md and when I tried to import the transport submodule of gz I get the following error message:
>>> import gz.transport Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /home/kkishore9891/gz_ws/src/gz-python/build/python/gz/transport.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN17pybind11_protobuf21PyProtoDescriptorNameB5cxx11EN8pybind116handleE
I am not sure if I did something wrong by I followed the instructions several times and this issue wouldn't go away. Can you help fix this issue?
The text was updated successfully, but these errors were encountered: