Git Product home page Git Product logo

Comments (5)

jlblancoc avatar jlblancoc commented on June 24, 2024

Ok, I see. I have verified it on a u20.04 system with the latest packages from the ROS build farm for Noetic.

Two different things here:

  1. python3 not finding the library. That's "easy" to hack away, as you probably have already done, either creating symlinks under /opt/ros/noetic/lib/python3/dist-packages (not recommended) or by temporarily adding:

     export PYTHONPATH=$PYTHONPATH:/opt/ros/noetic/lib/python3.8/site-packages/
    
  2. With MRPT 2.9.0, there has been a massive change in the Python bindings: it formerly was hand-written and only exported part of the API. It's now automated via pybind11 and most parts of MRPT are now available via pymrpt. The names and such changed a bit, though.
    Please, see:

    • Examples like se3-poses-example.py or hwdriver-tao-imu-usb.py for a possible way to import the module (first few lines), and
    • The only (ugly) pydoc reference docs of all existing classes, modules and methods. If you use the interactive python3 interpreter, tab will help you to autocomplete, but I wasn't able to make Visual Studio Code to autocomplete pymrpt classes, and couldn't find the reason...

Any help with testing, improving, adding/correcting Python examples, etc. would be more than welcome, since we normally develop with the C++ libs and the python part is far less tested...

I'm leaving this ticket open to remember trying to fix the installation path of pymrpt in noetic.

from mrpt.

jlblancoc avatar jlblancoc commented on June 24, 2024

PS: I realized the logic to determine the install directory for pymrpt is inverted! python3 is used for ROS2, python3.X for ROS1, while it should be the other way around.
I'll fix it asap.

from mrpt.

jlblancoc avatar jlblancoc commented on June 24, 2024

The latest release v2.9.2 should fix these issues in ROS 1 and ROS 2, as well as in the PPA python3-pymrpt package.
Note there are now also a few examples online to help with code migration with former versions, hope it helps!

from mrpt.

ihadzic avatar ihadzic commented on June 24, 2024

Thanks for fixing this. I am still struggling to find everything I need in the new API. Specifically, I need to go back and forth between ROS1 messages and MRPT types. In the old API I would use something like this:

p1mrpt = CPose3DPDFGaussian()
p1mrpt.from_ROS_PoseWithCovariance_msg(p1)

where p1 is PoseWithCovariance type from geometry_msgs.msg

In the new API, I understand I should use ros1bridge that is documented here:

https://docs.mrpt.org/reference/latest/group_mrpt_ros1bridge_grp.html

and call toROS and fromROS to do the conversion. Assuming that Python bindings follow the hierarchy that C++ follows, I would expect to find ros1bridge under pymrpt.mrpt, but I don't see it:

>>> from mrpt import pymrpt
>>> dir(pymrpt.mrpt)
['Clock', 'DEG2RAD', 'RAD2DEG', 'Stringifyable', 'TCallStackBackTrace', 'TCallStackEntry', 'WorkerThreadsPool', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'aligned_calloc', 'aligned_free', 'aligned_malloc', 'apps', 'bayes', 'callStackBackTrace', 'comms', 'config', 'containers', 'cpu', 'd2f', 'expr', 'f2u8', 'global_settings', 'graphs', 'gui', 'hwdrivers', 'hypot_fast', 'ignored_copy_ptr_mrpt_maps_COctoMapBase_octomap_ColorOcTree_octomap_ColorOcTreeNode_t', 'ignored_copy_ptr_mrpt_maps_COctoMapBase_octomap_OcTree_octomap_OcTreeNode_t', 'img', 'int_select_by_bytecount_1_t', 'int_select_by_bytecount_2_t', 'int_select_by_bytecount_3_t', 'int_select_by_bytecount_4_t', 'int_select_by_bytecount_8_t', 'io', 'keep_max', 'keep_min', 'kinematics', 'maps', 'math', 'nav', 'non_copiable_ptr_basic_void_t', 'obs', 'opengl', 'poses', 'ptr_cast_mrpt_serialization_CSerializable_t', 'random', 'round', 'rtti', 'safe_ptr_basic_mrpt_opengl_Scene_t', 'safe_ptr_basic_mrpt_rtti_TRuntimeClassId_t', 'safe_ptr_mrpt_opengl_Scene_t', 'safe_ptr_mrpt_rtti_TRuntimeClassId_t', 'serialization', 'sign', 'signWithZero', 'slam', 'square', 'system', 'tfest', 'toNativeEndianness', 'to_string', 'topography', 'typemeta', 'u8tof', 'uint_select_by_bytecount_1_t', 'uint_select_by_bytecount_2_t', 'uint_select_by_bytecount_3_t', 'uint_select_by_bytecount_4_t', 'uint_select_by_bytecount_8_t', 'vision']

I do see other modules that I recognize from docs (e.g. poses, slam, etc..), but no ros1bridge. Am I missing something or has this binding been omitted?

from mrpt.

jlblancoc avatar jlblancoc commented on June 24, 2024

Oh my! You are right, it was totally left out (!).

Following up in #1276.

from mrpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.