GKD.RoboCtrl
载入中...
搜索中...
未找到
shoot.h
1
#pragma once
2
#include "utils/ramp.hpp"
3
#include "utils/singleton.hpp"
4
#include "
core/async.hpp
"
5
#include "
core/logger.h
"
6
7
namespace
roboctrl::ctrl{
8
13
class
shoot
:
public
utils::singleton_base
<shoot>,
public
logable
<shoot> {
14
public
:
15
shoot
() =
default
;
16
struct
info_type
{
17
using
owner_type
=
shoot
;
18
19
utils::ramp_f::params_type
friction_params;
20
float
friction_max_speed;
21
};
22
23
inline
std::string desc()
const
{
return
"shoot"
;}
24
25
roboctrl::awaitable<void>
task();
26
27
bool
init(
const
info_type& info);
28
29
void
set_firing(
bool
state);
30
inline
bool
firing()
const
{
return
firing_;}
31
32
private
:
33
info_type info_;
34
utils::ramp_f
friction_ramp_;
35
36
bool
firing_;
37
38
};
39
40
static_assert
(utils::singleton<shoot>);
41
}
async.hpp
异步任务上下文组件。
roboctrl::ctrl::shoot
开火控制
Definition
shoot.h:13
roboctrl::log::logable
用于提供日志功能的辅助基类 通过CRTP模式实现,要求派生类实现desc()方法以提供描述信息,在继承时传入派生类自身类型作为模板参数。 继承这个类后,派生类可以方便地使用log_debug、log_i...
Definition
logger.h:178
roboctrl::utils::ramp
一阶斜坡控制器 (Ramp)
Definition
ramp.hpp:38
roboctrl::utils::singleton_base
提供单例模式的单例基类
Definition
singleton.hpp:19
logger.h
用于日志输出的组件。
roboctrl::async::awaitable
asio::awaitable< T > awaitable
协程任务类型。
Definition
async.hpp:42
roboctrl::ctrl::shoot::info_type
Definition
shoot.h:16
roboctrl::utils::ramp::params_type
参数结构体
Definition
ramp.hpp:44
include
ctrl
shoot.h
制作者
1.9.8