Giter Site home page Giter Site logo

Comments (10)

gbiggs avatar gbiggs commented on May 26, 2024 2

I think it's better to work on fixing colcon-cargo so that we can build rclrs more "natively" within a colcon workspace. This is something I hope to work on over the next few weeks.

from ros2_rust.

gbiggs avatar gbiggs commented on May 26, 2024 1

colcon is completely unspecific to ROS. It's an entirely separate project - it isn't even an OSRF project.

Like any other ROS client library, it's perfectly fine to build rclrs with colcon-cargo. Absolutely everything in ROS 2 is built using colcon, even colcon itself is built using colcon. That would eliminate an extra translation step that corrosion would introduce.

from ros2_rust.

esteve avatar esteve commented on May 26, 2024 1

@jhdcs depends on the language of the client library. For example, the Python client library does not compile the Python source file, but it compiles the C bridge between ROS 2 and Python. Whereas the Java client library needs to compile the Java files to distribute them as JARs to the downstream packages. rclrs does not use an intermediate layer between ROS 2 and Rust as it uses FFI via bindgen.

from ros2_rust.

jhdcs avatar jhdcs commented on May 26, 2024

Ah, perhaps I misunderstood, but I thought colcon-cargo was going to be used for importing non rclrs projects? If we are going to use colcon-cargo to build rclrs, though, I can stop working on the corrosion branch on my fork. I was getting stuck on getting the generated outputs into the install folder anyways...

Though part of me still wants to press on so I know the right way to do it, lol.

from ros2_rust.

nnarain avatar nnarain commented on May 26, 2024

I think the concept is that colcon (and extensions such as colcon-cargo) are not necessarily ROS2 build tools. colcon-cargo doesn't appear to do anything specific to ROS2. It integrates cargo into colcon. For example colcon-ros appears to be the plugin that actually builds cmake ROS packages.

So if a ROS2 Rust project is build-able via cargo. colcon-cargo can be used to integrate that in a normal colcon build command.

If corrosion is used, colcon-cargo is not necessary since colcon-ros will build it as a cmake package.

from ros2_rust.

jhdcs avatar jhdcs commented on May 26, 2024

Ah, excellent. Thank you both for the information.

I have additionally found that corrosion creates cargo libraries as interface libraries. Which is fine when you're linking that library to another existing library or executable, but exceedingly annoying if you're just trying to build it standalone (if you're interested, my efforts can be viewed here). As such, in addition to your comments above, I will agree that corrosion is probably not the best fit here.

I will begin looking at colcon-cargo. Thank you both very much for your help!

from ros2_rust.

esteve avatar esteve commented on May 26, 2024

Like any other ROS client library, it's perfectly fine to build rclrs with colcon-cargo. Absolutely everything in ROS 2 is built using colcon, even colcon itself is built using colcon. That would eliminate an extra translation step that corrosion would introduce.

@gbiggs @jhdcs That's not how it works. Take rclpy for example, it's built using CMake (https://github.com/ros2/rclpy/blob/master/rclpy/CMakeLists.txt), not setuptools. The reason for that is that all the ament machinery is fully implemented in CMake (i.e. registering the rcl implementation, typesupport, exporting dependencies, etc.). However, packages that consume rclrs should be built via colcon-cargo-ros (which does not exist yet), which would expose the ROS extensions to cargo (see for reference https://github.com/colcon/colcon-ros/blob/master/colcon_ros/task/ament_python/build.py#L22 for a colcon task that builds ament_python packages).

from ros2_rust.

jhdcs avatar jhdcs commented on May 26, 2024

So in that case, I should continue working on getting corrosion to work? If so, I may require some help, since I'm getting a bit stuck getting the build outputs into the install folder...

from ros2_rust.

esteve avatar esteve commented on May 26, 2024

The rclrs CMake file does not compile anything, it just copies the source Rust files to a location in the ament index so that downstream packages can consume them (à la the crate index), so I don't know what corrosion brings to the table.

It's the downstream packages that compile the code, and those downstream packages are the ones that should be built with colcon-cargo-ros

from ros2_rust.

jhdcs avatar jhdcs commented on May 26, 2024

The rclrs CMake file does not compile anything, it just copies the source Rust files to a location in the ament index so that downstream packages can consume them (à la the crate index), so I don't know what corrosion brings to the table.

Ah. I misunderstood the ReadMe, then. I thought it was saying that it was building the binaries, as in compiling them. If all we're doing is copying source files around, then corrosion will do nothing for us.

Is this how the other Client Libraries operate as well?

from ros2_rust.

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.