SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
cl_rgb
include
cl_rgb
client_behaviors
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
17
#include <
cl_rgb/client_behaviors/cb_rgb_client_behavior_base.hpp
>
18
19
#include <atomic>
20
#include <cstdint>
21
#include <string>
22
23
namespace
cl_rgb
24
{
25
26
struct
WaitForFrameParams
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.
34
class
CbWaitForFrame
:
public
CbRgbClientBehaviorBase
35
{
36
public
:
37
explicit
CbWaitForFrame
(
const
WaitForFrameParams
& params =
WaitForFrameParams
());
38
39
void
onEntry
()
override
;
40
void
onExit
()
override
{}
41
42
protected
:
43
void
wireCompletionSignals
()
override
;
44
45
private
:
46
void
onFrame
(
const
FramePtr
& frame);
47
48
WaitForFrameParams
params_
;
49
std::atomic<uint64_t>
startSequence_
{0};
50
};
51
52
}
// namespace cl_rgb
cb_rgb_client_behavior_base.hpp
cl_rgb::CbRgbClientBehaviorBase
Definition
cb_rgb_client_behavior_base.hpp:42
cl_rgb::CbWaitForFrame
Definition
cb_wait_for_frame.hpp:35
cl_rgb::CbWaitForFrame::startSequence_
std::atomic< uint64_t > startSequence_
Definition
cb_wait_for_frame.hpp:49
cl_rgb::CbWaitForFrame::onEntry
void onEntry() override
Definition
cb_wait_for_frame.cpp:37
cl_rgb::CbWaitForFrame::wireCompletionSignals
void wireCompletionSignals() override
Definition
cb_wait_for_frame.cpp:25
cl_rgb::CbWaitForFrame::CbWaitForFrame
CbWaitForFrame(const WaitForFrameParams ¶ms=WaitForFrameParams())
Definition
cb_wait_for_frame.cpp:20
cl_rgb::CbWaitForFrame::onFrame
void onFrame(const FramePtr &frame)
Definition
cb_wait_for_frame.cpp:50
cl_rgb::CbWaitForFrame::onExit
void onExit() override
Definition
cb_wait_for_frame.hpp:40
cl_rgb::CbWaitForFrame::params_
WaitForFrameParams params_
Definition
cb_wait_for_frame.hpp:48
cl_rgb
Definition
box_fit.hpp:25
cl_rgb::FramePtr
std::shared_ptr< const Frame > FramePtr
Definition
types.hpp:39
cl_rgb::WaitForFrameParams
Definition
cb_wait_for_frame.hpp:27
cl_rgb::WaitForFrameParams::camera
std::string camera
Definition
cb_wait_for_frame.hpp:28
cl_rgb::WaitForFrameParams::frames
unsigned int frames
Definition
cb_wait_for_frame.hpp:29
Generated by
1.12.0