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
7namespace roboctrl::ctrl{
8
13class shoot : public utils::singleton_base<shoot>,public logable<shoot> {
14public:
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
26
27 bool init(const info_type& info);
28
29 void set_firing(bool state);
30 inline bool firing()const{return firing_;}
31
32private:
33 info_type info_;
34 utils::ramp_f friction_ramp_;
35
36 bool firing_;
37
38};
39
40static_assert(utils::singleton<shoot>);
41}
异步任务上下文组件。
开火控制
Definition shoot.h:13
用于提供日志功能的辅助基类 通过CRTP模式实现,要求派生类实现desc()方法以提供描述信息,在继承时传入派生类自身类型作为模板参数。 继承这个类后,派生类可以方便地使用log_debug、log_i...
Definition logger.h:178
一阶斜坡控制器 (Ramp)
Definition ramp.hpp:38
提供单例模式的单例基类
Definition singleton.hpp:19
用于日志输出的组件。
asio::awaitable< T > awaitable
协程任务类型。
Definition async.hpp:42