SMACC2
Loading...
Searching...
No Matches
cb_wait_for_frame.hpp
Go to the documentation of this file.
1// Copyright 2026 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
18
19#include <atomic>
20#include <cstdint>
21#include <string>
22
23namespace cl_rgb
24{
25
27{
28 std::string camera = "cam_head";
29 unsigned int frames = 1; // succeed on this many images newer than the state's entry
30};
31
32// Succeeds when the camera has delivered new images since the state was entered: the way
33// to make sure the next state looks at the scene as it is now, not as it was.
35{
36public:
37 explicit CbWaitForFrame(const WaitForFrameParams & params = WaitForFrameParams());
38
39 void onEntry() override;
40 void onExit() override {}
41
42protected:
43 void wireCompletionSignals() override;
44
45private:
46 void onFrame(const FramePtr & frame);
47
49 std::atomic<uint64_t> startSequence_{0};
50};
51
52} // namespace cl_rgb
std::atomic< uint64_t > startSequence_
void wireCompletionSignals() override
CbWaitForFrame(const WaitForFrameParams &params=WaitForFrameParams())
void onFrame(const FramePtr &frame)
WaitForFrameParams params_
std::shared_ptr< const Frame > FramePtr
Definition types.hpp:39