GKD.RoboCtrl
RoboMaster Linux 电控:异步 IO、设备驱动与机器人控制
载入中...
搜索中...
未找到
roboctrl::ctrl::shoot类 参考

开火控制 更多...

详细描述

开火控制

负责拨弹和发射弹丸逻辑。

在文件 shoot.h 第 21 行定义.

#include <shoot.h>

类 roboctrl::ctrl::shoot 继承关系图:
roboctrl::ctrl::shoot 的协作图:

类

struct  info_type
 发射器初始化参数。 更多...
 

Public 成员函数

std::string desc () const
 
roboctrl::awaitable< void > task ()
 周期更新摩擦轮和拨弹电机输出。
 
bool init (const info_type &info)
 绑定发射器所需电机并初始化内部状态。
 
bool init (const info_type &info, device::motor_base &left, device::motor_base &right, device::motor_base &trigger)
 
void start ()
 
roboctrl::awaitable< void > update (fp32 dt)
 
void set_enabled (bool enabled)
 
void set_fire_permitted (bool permitted)
 
bool fire_allowed () const
 
void set_firing (bool state)
 请求开始或停止拨弹。
 
bool firing () const
 
void set_friction_enabled (bool state)
 请求启用或停止摩擦轮。
 
bool friction_enabled () const
 
bool friction_ready () const
 判断摩擦轮是否达到可发射的准备速度。
 
- Public 成员函数 继承自 roboctrl::utils::singleton_base< shoot >
 singleton_base (const singleton_base &)=delete
 
singleton_base & operator= (const singleton_base &)=delete
 
- Public 成员函数 继承自 roboctrl::utils::immovable_base
 immovable_base (immovable_base &&)=delete
 
immovable_base & operator= (immovable_base &&)=delete
 
- Public 成员函数 继承自 roboctrl::utils::not_copyable_base
 not_copyable_base (const not_copyable_base &)=delete
 
not_copyable_base & operator= (const not_copyable_base &)=delete
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 roboctrl::utils::singleton_base< shoot >
static shoot & instance ()
 获取单例实例
 
- Protected 成员函数 继承自 roboctrl::log::logable< shoot >
void log (log_level level, std::format_string< Args... > fmt, Args &&...args) const
 输出日志
 
void log_debug (std::format_string< Args... > fmt, Args &&...args) const
 输出debug日志
 
void log_info (std::format_string< Args... > fmt, Args &&...args) const
 输出info日志
 
void log_warn (std::format_string< Args... > fmt, Args &&...args) const
 输出warn日志
 
void log_error (std::format_string< Args... > fmt, Args &&...args) const
 输出error日志
 

成员函数说明

◆ desc()

std::string roboctrl::ctrl::shoot::desc ( ) const
inline

在文件 shoot.h 第 43 行定义.

◆ fire_allowed()

bool shoot::fire_allowed ( ) const

在文件 shoot.cpp 第 117 行定义.

◆ firing()

bool roboctrl::ctrl::shoot::firing ( ) const
inline

在文件 shoot.h 第 62 行定义.

◆ friction_enabled()

bool roboctrl::ctrl::shoot::friction_enabled ( ) const
inline

在文件 shoot.h 第 65 行定义.

◆ friction_ready()

bool shoot::friction_ready ( ) const

判断摩擦轮是否达到可发射的准备速度。

在文件 shoot.cpp 第 107 行定义.

引用了 roboctrl::device::motor_base::linear_speed().

被这些函数引用 update().

◆ init() [1/2]

bool shoot::init ( const info_type &  info)

绑定发射器所需电机并初始化内部状态。

在文件 shoot.cpp 第 40 行定义.

引用了 init().

被这些函数引用 init().

◆ init() [2/2]

bool shoot::init ( const info_type &  info,
device::motor_base &  left,
device::motor_base &  right,
device::motor_base &  trigger 
)

在文件 shoot.cpp 第 47 行定义.

◆ set_enabled()

void shoot::set_enabled ( bool  enabled)

Robot owns this gate; only these bound actuators are enabled.

在文件 shoot.cpp 第 81 行定义.

引用了 roboctrl::utils::ramp< T >::reset() , 以及 roboctrl::async::shutdown_requested().

◆ set_fire_permitted()

void roboctrl::ctrl::shoot::set_fire_permitted ( bool  permitted)
inline

在文件 shoot.h 第 57 行定义.

◆ set_firing()

void shoot::set_firing ( bool  state)

请求开始或停止拨弹。

在文件 shoot.cpp 第 96 行定义.

◆ set_friction_enabled()

void shoot::set_friction_enabled ( bool  state)

请求启用或停止摩擦轮。

在文件 shoot.cpp 第 101 行定义.

◆ start()

void shoot::start ( )

在文件 shoot.cpp 第 73 行定义.

◆ task()

roboctrl::awaitable< void > shoot::task ( )

周期更新摩擦轮和拨弹电机输出。

在文件 shoot.cpp 第 157 行定义.

引用了 update() , 以及 roboctrl::async::wait_for().

◆ update()


该类的文档由以下文件生成: