Skip to content

Fix load_onnx! macro to use model_name parameter#7

Closed
Copilot wants to merge 2 commits intozedx-ros-clientfrom
copilot/sub-pr-1
Closed

Fix load_onnx! macro to use model_name parameter#7
Copilot wants to merge 2 commits intozedx-ros-clientfrom
copilot/sub-pr-1

Conversation

Copy link

Copilot AI commented Feb 12, 2026

The load_onnx! macro was hardcoded to always load dummy_model.onnx, ignoring the $model_name parameter passed by callers.

Change

  • Updated macro to use $model_name parameter instead of hardcoded path

This affects all existing callsites:

  • bin.rs: now loads bin_640.onnx
  • gate.rs: now loads gate_320.onnx / gate_640.onnx
  • gate_poles.rs: now loads new_gate.onnx
  • slalom_yolo.rs: now loads 2025Slalom.onnx
  macro_rules! load_onnx {
      ($model_name:expr, $model_size:expr, $num_objects:expr) => {{
          use opencv::core::Vector;
  
          OnnxModel::from_bytes(
-             &Vector::from_slice(include_bytes!("models/dummy_model.onnx")),
+             &Vector::from_slice(include_bytes!($model_name)),
              $model_size,
              $num_objects,
          )
          .unwrap()
      }};
  }

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: 1upbyte <55856800+1upbyte@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ZEDX ROS2 integration with communications module Fix load_onnx! macro to use model_name parameter Feb 12, 2026
Copilot AI requested a review from 1upbyte February 12, 2026 04:57
@1upbyte
Copy link

1upbyte commented Feb 12, 2026

@copilot did you eat your own brains out this will not compile you nimrod

@1upbyte 1upbyte closed this Feb 12, 2026
@SarangaR SarangaR deleted the copilot/sub-pr-1 branch February 12, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments