Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/u3v refactor #254

Merged
merged 16 commits into from
Mar 5, 2024
Merged

Update/u3v refactor #254

merged 16 commits into from
Mar 5, 2024

Conversation

xinyuli1204
Copy link
Contributor

@xinyuli1204 xinyuli1204 commented Mar 4, 2024

  1. Polymorphic U3V class implementation

U3VGenDC
U3VRealCam
U3VFakeCam

  1. Following consistent naming convention (snake case) ( sync_frame_count, set_realtime, set_gain ....)
  2. fix u3vGendc on main branch
  3. Return -1 for devices has no frame count #253 integrate design for frame count in this issue

@xinyuli1204 xinyuli1204 marked this pull request as ready for review March 4, 2024 18:18
@@ -312,6 +286,10 @@ class U3V {
}
}


virtual void get(std::vector<Halide::Buffer<>>& outs){};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to be pure virtual function (virtual void get(...) = 0) to avoid mistake on overriding in the derived.

}


void set_realtime(std::vector<ArvBuffer *> &bufs, int timeout_us = 3 * 1000 * 1000){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method doesn't look like "setting realtime". Maybe consume_old_buffer or ensure_newest_buffer or something else similar is better?

}
void get(std::vector<Halide::Buffer<>>& outs) override{
auto timeout_us = 30 * 1000 * 1000;
if (sim_mode_){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is sim_mode in U3VRealCam required? It looks force_sim_mode leads to use U3VFakeCam class, not sim_mode in U3vRealCam.

Copy link
Contributor Author

@xinyuli1204 xinyuli1204 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fixstars-iizuka if u3vRealCam doesn't detect any device it will fall back to sim_mode
for example:

        Node n = b.add("image_io_u3v_cameraN_u8x2")().set_param(
                Param("num_devices", num_device),
                Param("pixel_format", "Mono8")
);

the force_sim_mode is false, but since there is no device detected it fallback to sim_mode

@iitaku iitaku merged commit 474446a into main Mar 5, 2024
3 checks passed
@xinyuli1204 xinyuli1204 deleted the update/u3v-refactor branch November 20, 2024 00:24
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.

3 participants