|
GKD.RoboCtrl
RoboMaster Linux 电控:异步 IO、设备驱动与机器人控制
|
DJI 系列电机。 更多...
#include <dji.h>


类 | |
| struct | info_type |
| 电机初始化参数。 更多... | |
Public 类型 | |
| enum | type { M2006 = 2006 , M3508 = 3508 , M6020 = 6020 } |
Public 成员函数 | |
| std::string | desc () const |
| 描述信息,用于日志输出。 | |
| dji_motor (info_type info) | |
| void | connect () |
| void | start () |
| awaitable< void > | set (fp32 speed) override |
| 设置线速度目标,单位 m/s;角速度与原始电流使用显式接口。 | |
| awaitable< void > | set_angle_speed (fp32 speed) override |
| awaitable< void > | set_current (fp32 command) override |
| bool | supports_current_control () const override |
| fp32 | requested_current () const override |
| fp32 | max_current () const override |
| fp32 | target_angle_speed () const override |
| void | set_output_scale (fp32 scale) override |
| void | set_current_limit (fp32 limit) override |
| awaitable< void > | task () |
| awaitable< void > | enable () override |
| void | disable () override |
| void | set_enabled (bool enabled) override |
| int16_t | current () const |
Public 成员函数 继承自 roboctrl::device::motor_base | |
| virtual bool | faulted () const |
| virtual fp32 | current_feedback_raw () const |
| fp32 | radius () const |
| fp32 | angle () const |
| 获取电机角度(单位为rad) | |
| fp32 | angle_speed () const |
| 获取电机角速度(单位为rad/s) | |
| fp32 | rpm () const |
| 获取电机转速(单位为rpm) | |
| fp32 | torque () const |
| 获取驱动定义的反馈:DJI/M9025 原始电流计数,J6006 为 Nm。 | |
| 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 () 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 |
静态 Public 成员函数 | |
| static constexpr int | max_device_id (type motor_type) noexcept |
| 协议允许的最大设备 ID。未知型号返回 0。 | |
| static constexpr fp32 | command_current_limit (type motor_type) noexcept |
| DJI 电调命令字段的型号级绝对值上限。未知型号返回 0。 | |
额外继承的成员函数 | |
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 |
| dji_motor::dji_motor | ( | dji_motor::info_type | info | ) |
|
inlinestaticconstexprnoexcept |
|
overridevirtual |
Disable output and clear any pending command.
重载 roboctrl::device::motor_base .
引用了 roboctrl::utils::pid_base< T, error_measurer >::clean().
被这些函数引用 set_enabled().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlinestaticconstexprnoexcept |
|
inlineoverridevirtual |
|
overridevirtual |
设置线速度目标,单位 m/s;角速度与原始电流使用显式接口。
实现了 roboctrl::device::motor_base.
引用了 roboctrl::utils::pid_base< T, error_measurer >::clean(), roboctrl::log::logable< dji_motor >::log_debug() , 以及 roboctrl::utils::pid_base< T, error_measurer >::set_target().
|
overridevirtual |
Explicit output-shaft speed, rad/s; set() remains linear speed in m/s.
重载 roboctrl::device::motor_base .
引用了 roboctrl::utils::pid_base< T, error_measurer >::clean() , 以及 roboctrl::utils::pid_base< T, error_measurer >::set_target().
|
overridevirtual |
Raw driver command units, not amperes. Unsupported drivers reject this mode.
重载 roboctrl::device::motor_base .
引用了 roboctrl::utils::pid_base< T, error_measurer >::clean() , 以及 roboctrl::device::device_base::offline().
|
inlineoverridevirtual |
|
overridevirtual |
Common safety gate used by the control layer.
重载 roboctrl::device::motor_base .
引用了 roboctrl::utils::pid_base< T, error_measurer >::clean(), disable() , 以及 roboctrl::async::shutdown_requested().
被这些函数引用 enable().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
| roboctrl::awaitable< void > dji_motor::task | ( | ) |