Repository navigation
Add bitbots cargo - #944
Conversation
… rename, Rust migration - Add bitbots_cargo cmake package with r2r_cargo(), cargo_pyo3_extension(), cargo_binary() helpers - Set up root Cargo workspace covering bitbots_extrinsic_calibration and bitbots_global_planner - Rename bitbots_rust_nav → bitbots_global_planner; remove stale pixi-build files - Bring PolygonObstacle/AnyObstacle and goal obstacle support into bitbots_global_planner - Migrate bitbots_extrinsic_calibration from C++ to Rust using bitbots_cargo - Add rust and clang to pixi deps; route cargo target into build/ via CARGO_TARGET_DIR activation env - Add cargo fmt pre-commit hook and rust-analyzer vscode settings - Update bitbots_path_planning import to use new bitbots_global_planner module name
Co-authored-by: MegaIng <cornelius@krupp.hamburg>
…ain into feature/bitbots_cargo
MegaIng
left a comment
There was a problem hiding this comment.
This doesn't build for me; It appears that a global llvm and/or clang version is being found instead which is missing some symbols.
|
Apparently: |
|
I don't like the vendoring solution in the latest commit. Feel free to revert this. |
|
Do we know why the robot is different in this regard? |
I could reproduce this under a ubuntu 26.04 desktop |
|
We need to revert the patches once sequenceplanner/r2r#133 is released |
Pin the r2r binding-generation crates to a dependency-only fork using the Clang-compatible bindgen release. Remove the vendored message-generator workaround and document removal of the temporary overrides after an upstream release.
|
Do we want to keep the rewrite of the extrinsic calibration, @Flova |
|
This builds & functions correctly in the simulator for me now. |
|
Nice. I would keep the extrinsic rewrite as a demo. |
# Conflicts: # pixi.lock # src/bitbots_misc/bitbots_extrinsic_calibration/CMakeLists.txt
Publishing immediately after startup broadcast a /tf_static message with empty frame ids from the default parameters and could panic on clock or publish errors. Gate publication on the parameter event stream and log errors instead of unwrapping.
- add missing tf2_msgs build dependency and fix docs language export - depend on bitbots_global_planner instead of nonexistent cargo package - honor CARGO_TARGET_DIR env and check cargo metadata result in helper - guard dummy target and bump cmake_minimum_required to 3.21 - use colcon cargo profile for cargo tests
|
The new impl looks fine but has a slight duplication of logic for the initial send. Look at how it was implemented before the fix 3 commits or so ago (plain loop with await after the content). |
|
I think putting the logic into a separate function is a good idea either way, and I personally prefer an explicit publish at startup to make it explicitly that this is the needed behavior, and it's not a lot of duplication. Anyway, this is bike shedding, if you want you can change it, I am fine with either. The test failure is weird, is this test flaky? |
The occupancy grid serialization test compared the raw CDR bytes of two serialized messages. Fast-CDR skips alignment padding without writing it, and the rmw_serialize buffer is allocated with realloc, so padding bytes (e.g. after the empty header frame_id) contain whatever was left on the heap. The test therefore passed or failed depending on the heap layout of the process, which differs between environments and runs (ASLR). Compare the deserialized messages instead, which checks the same round-trip property without depending on uninitialized padding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018hPFvcLcSfP34kBHkKoEBJ
Python ROS 2 messages implement a deep field-wise __eq__ and the generated setters already enforce field types, so the serialize and deserialize round trip adds nothing over comparing the messages themselves. Compare msg and msg2 directly and rename the test to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MqG155avmTgLMoDeasVh4P
Summary
Add a way of integrating cargo with colcon.
Proposed changes
As a demonstration the extrinsic calibration node and the global planning library are build using this way. This should also fix the issue @ayin21 had on her laptop.
Related issues
Checklist
pixi run build