m-dahl / r2r_minimal_node

Minimal r2r ros node.
19 stars 4 forks source link

colcon profile unused #8

Open stelzo opened 3 months ago

stelzo commented 3 months ago

The Readme says that 'r2r_cargo expects a custom profile called colcon to exist' but when I build without specifying the profile in the Cargo.toml, it still builds without a problem. I tested it with the minimal nodes and the exact instructions from the Readme (building with colcon).

Also, because it does not use the colcon profile, the release profile is not inherited, which can be proven by adding

#[cfg(debug_assertions)]
r2r::log_warn!("debug", "I am in debug mode :(");

to the main.rs.

stelzo commented 3 months ago

I switched the computer and it the issue wasn't there. I think I know what happened: When having ros2_rust tools installed and building r2r nodes at the same time, the colcon-cargo plugin takes over the build process and ignores the CMakeLists.txt inside r2r nodes completely so the profile is never specified.

The workaround is to uninstall the ros2_rust tools with pip before building r2r nodes again. I think this problem is still relevant for some people even though it is not a real problem of r2r but the colcon-cargo project. I would advice closing this issue after colcon-cargo is fixed in that regard.

m-dahl commented 3 months ago

Hi,

Maybe the real fix is to migrate to colcon-cargo and ditch the custom cmake hack :) It seems like with colcon-cargo it built out of the box for you since you didn't notice, so maybe it wouldn't require much work. I haven't looked at it, do you see any downside to switching to colcon-cargo? Feel free to open an issue on r2r if you think such a migration makes sense.