GKD.RoboCtrl
载入中...
搜索中...
未找到
roboctrl::device::dji_motor类 参考

DJI 系列电机。 更多...

详细描述

DJI 系列电机。

在文件 dji.h24 行定义.

#include <dji.h>

类 roboctrl::device::dji_motor 继承关系图:
roboctrl::device::motor_base roboctrl::log::logable< dji_motor > roboctrl::device::device_base roboctrl::utils::immovable_base roboctrl::utils::not_copyable_base

struct  info_type
 电机初始化参数。 更多...
 

Public 类型

enum  type { M2006 = 2006 , M3508 = 3508 , M6020 = 6020 }
 

Public 成员函数

std::string desc () const
 描述信息,用于日志输出。
 
 dji_motor (info_type info)
 
awaitable< voidset (fp32 speed)
 设置目标电流或速度(取决于电调模式)。
 
awaitable< voidtask ()
 
awaitable< voidenable ()
 
int16_t current () const
 
- Public 成员函数 继承自 roboctrl::device::motor_base
fp32 angle () const
 获取电机角度(单位为rad)
 
fp32 angle_speed () const
 获取电机角速度(单位为rad/s)
 
fp32 rpm () const
 获取电机转速(单位为rpm)
 
fp32 torque () const
 获取电机扭矩(单位为A)
 
fp32 linear_speed () const
 获取电机线速度(单位为m/s)
 
 motor_base (const std::chrono::nanoseconds offline_timeout, fp32 radius)
 
- Public 成员函数 继承自 roboctrl::device::device_base
 device_base (const std::chrono::nanoseconds offline_timeout)
 
bool offline ()
 判断设备是否离线
 
void tick ()
 更新心跳时间
 
awaitable< voidtask ()
 默认的task
 
- Public 成员函数 继承自 roboctrl::utils::immovable_base
 immovable_base (immovable_base &&)=delete
 
immovable_baseoperator= (immovable_base &&)=delete
 
- Public 成员函数 继承自 roboctrl::utils::not_copyable_base
 not_copyable_base (const not_copyable_base &)=delete
 
not_copyable_baseoperator= (const not_copyable_base &)=delete
 

额外继承的成员函数

- Protected 成员函数 继承自 roboctrl::log::logable< dji_motor >
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::motor_base
float angle_ {}
 
float angle_speed_ {}
 
float torque_ {}
 
float radius_ {}
 
- Protected 属性 继承自 roboctrl::device::device_base
const std::chrono::nanoseconds offline_timeout_
 设备离线超时时间
 
std::chrono::nanoseconds tick_time_
 上次心跳时间
 
bool terminated_ = false
 

成员枚举类型说明

◆ type

enum roboctrl::device::dji_motor::type

在文件 dji.h26 行定义.

构造及析构函数说明

◆ dji_motor()

dji_motor::dji_motor ( dji_motor::info_type  info)

在文件 dji.cpp123 行定义.

成员函数说明

◆ current()

int16_t roboctrl::device::dji_motor::current ( ) const
inline

在文件 dji.h65 行定义.

◆ desc()

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

描述信息,用于日志输出。

在文件 dji.h52 行定义.

◆ enable()

awaitable< void > roboctrl::device::dji_motor::enable ( )
inline

在文件 dji.h63 行定义.

◆ set()

roboctrl::awaitable< void > dji_motor::set ( fp32  speed)

设置目标电流或速度(取决于电调模式)。

在文件 dji.cpp175 行定义.

引用了 roboctrl::log::logable< dji_motor >::log_debug() , 以及 roboctrl::utils::pid_base< T, error_measurer >::set_target().

◆ task()

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

在文件 dji.cpp183 行定义.


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