zivid / zivid-ros

Official ROS driver for Zivid 3D cameras
BSD 3-Clause "New" or "Revised" License
55 stars 43 forks source link

Add service to capture and save frame #68

Closed torbsorb closed 5 months ago

torbsorb commented 2 years ago

It is very valuable to be able to save the frame as a ZDF file, or export to other formats. This commit introduces the service capture_and_save_frame which both captures and saves the frame. It takes a path as an argument. See README.md#capture_and_save_frame for more information.

In order to show how to use this service we also add a sample, both for Python and C++.

Closes #65

torbsorb commented 2 years ago

We already do the same in testCapturePublishesTopics. Can you extract that to a helper class, something like a AllCaptureTopicsSubscriber, which then subscribes on all of them and have a method to check the current count? Then it can be reused both places.

I'm a little unsure how I should extract it. The way it's used in testCapturePublishesTopics is that it's subscribed once, and tested multiple times. Should I create a std::vector<?> that can be passed around? Or, can I add the subscribers as members of a subclass of ZividNodeTest that is initialized when the class is created?

torbsorb commented 2 years ago

@apartridge, can we revisit this and maybe merge it?

robertkt1 commented 1 year ago

Any updates on this one?