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

遥控器设备,负责解析上报报文并发布输入状态 更多...

详细描述

遥控器设备,负责解析上报报文并发布输入状态

在文件 controlpad.h 第 58 行定义.

#include <controlpad.h>

类 roboctrl::device::control_pad 继承关系图:
roboctrl::device::control_pad 的协作图:

类

struct  info_type
 遥控器实例化参数。 更多...
 

Public 成员函数

std::string desc () const
 返回遥控器及其串口名称。
 
 control_pad (const info_type &info)
 构造遥控器设备并注册串口回调。
 
control_pad_state state () const noexcept
 获取最近一次有效报文解析出的输入快照。
 
fp32 pitch_wheel () const noexcept
 获取云台俯仰拨轮原始值。
 
template<callback_fn< control_pad_state > F>
void on_update (F &&callback)
 注册输入更新回调。
 
- Public 成员函数 继承自 roboctrl::device::device_base
 device_base (const std::chrono::nanoseconds offline_timeout)
 
bool offline () const
 判断设备是否离线
 
void tick ()
 更新心跳时间
 
awaitable< void > task ()
 默认的task
 
- 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
 

额外继承的成员函数

- Protected 成员函数 继承自 roboctrl::log::logable< control_pad >
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日志
 
- Protected 属性 继承自 roboctrl::device::device_base
const std::chrono::nanoseconds offline_timeout_
 设备离线超时时间
 
std::chrono::nanoseconds tick_time_
 上次心跳时间
 
bool terminated_ = false
 

构造及析构函数说明

◆ control_pad()

control_pad::control_pad ( const info_type &  info)

构造遥控器设备并注册串口回调。

在文件 controlpad.cpp 第 38 行定义.

引用了 roboctrl::log::logable< control_pad >::log_warn(), state() , 以及 roboctrl::device::device_base::tick().

成员函数说明

◆ desc()

std::string roboctrl::device::control_pad::desc ( ) const
inline

返回遥控器及其串口名称。

在文件 controlpad.h 第 72 行定义.

◆ on_update()

template<callback_fn< control_pad_state > F>
void roboctrl::device::control_pad::on_update ( F &&  callback)
inline

注册输入更新回调。

在文件 controlpad.h 第 87 行定义.

◆ pitch_wheel()

fp32 roboctrl::device::control_pad::pitch_wheel ( ) const
inlinenoexcept

获取云台俯仰拨轮原始值。

在文件 controlpad.h 第 83 行定义.

◆ state()

control_pad_state roboctrl::device::control_pad::state ( ) const
inlinenoexcept

获取最近一次有效报文解析出的输入快照。

在文件 controlpad.h 第 80 行定义.

被这些函数引用 control_pad().


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