GKD.RoboCtrl
载入中...
搜索中...
未找到
roboctrl::device 命名空间参考

设备模块 更多...

详细描述

设备模块

class  control_pad
 遥控器设备,负责解析上报的报文并设置机器人的速度等状态 更多...
 
struct  controlled_motor
 被控制算法(例如PID)控制的电机 更多...
 
struct  device_base
 设备基础类,提供判断设备离线的基础功能 更多...
 
class  dji_motor
 DJI 系列电机。 更多...
 
class  dji_motor_group
 将同一 CAN 总线上的电机编组,一次性发送报文。 更多...
 
struct  imu_base
 IMU 基类,封装常见数据通道。 更多...
 
class  M9025
 
struct  motor_base
 
class  serial_imu
 
class  super_cap
 超极电容 更多...
 

概念

concept  device
 设备概念,约束 task() 等接口。
 
concept  imu
 
concept  motor
 

枚举

enum class  axis : std::size_t {
  roll = 0 , pitch = 1 , yaw = 2 , x = 0 ,
  y = 1 , z = 2
}
 IMU 三轴枚举,兼容姿态/加速度轴序。 更多...
 

函数

bool is_offline (auto &... devs)
 判断多个设备是否离线
 
template<motor motor_type>
awaitable< voidset_motor (const typename motor_type::info_type::key_type &key, fp32 value)
 设置电机目标状态
 

枚举类型说明

◆ axis

enum class roboctrl::device::axis : std::size_t
strong

IMU 三轴枚举,兼容姿态/加速度轴序。

在文件 base.hpp18 行定义.

函数说明

◆ is_offline()

bool roboctrl::device::is_offline ( auto &...  devs)

判断多个设备是否离线

参数
devs设备列表
返回
true 有设备离线
false 所有设备都在线

在文件 base.hpp85 行定义.

◆ set_motor()

template<motor motor_type>
awaitable< void > roboctrl::device::set_motor ( const typename motor_type::info_type::key_type &  key,
fp32  value 
)

设置电机目标状态

模板参数
motor_type电机类型
参数
key电机名称
value电机目标状态

示例:

co_await dev::set_motor<my_motor>("motor1", 10.0f);

在文件 base.hpp217 行定义.