Comments (10)
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.
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.
@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.
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.
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.
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.
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.
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.
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.
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 whatcorrosion
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)
- Make wait set growable
- Flexible callbacks for clients and services HOT 1
- Make take_boxed() create messages directly on the heap HOT 3
- Matrix Chat HOT 2
- Colcon build fails with error: "failed to load source for dependency `action_msgs`" HOT 7
- Implement lifecycle nodes
- Building rclrs nodes causes python nodes to break HOT 1
- Example of package with `srv` definitions HOT 5
- Is this project abandoned? HOT 5
- rosidl_runtime_rs differences between main and crate breaks colcon build HOT 3
- Does ROS2_Rust support .srv code generation? HOT 3
- Support for building Debian packages HOT 1
- Getting an Result::unwrap() Error when launching a launch file. HOT 2
- Remove Support for Foxy HOT 1
- Add support for Iron Irwini
- Zero copy publisher example fails HOT 1
- `extern` block uses type `u128`, which is not FFI-safe HOT 4
- support `rclrs::SerializedMessage`
- compile failed when deserilize msg struct
- Improve support for rust analyzers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ros2_rust.