|
GKD.RoboCtrl
|
被控制算法(例如PID)控制的电机 更多...
被控制算法(例如PID)控制的电机
| motor_type | 电机类型 |
| controller_type | 控制器类型 |
controlled_motor可以像普通电机一样被set,但set传入的值会先被传入到控制器中,然后通过控制器计算得到电机的输出值,并传入电机。 这个类常用于电机的PID控制。
示例:
#include <base.hpp>
类 | |
| struct | params_type |
Public 类型 | |
| using | motor_key_type = typename motor_type::info_type::key_type |
Public 成员函数 | |
| controlled_motor (const motor_key_type &name, const typename controller_type::params_type &controller_params) | |
| awaitable< void > | set (float state) |
| 设置电机目标状态 | |
| motor_type & | motor () const |
| 获取电机对象 | |
| fp32 | angle () const |
| 获取电机角度(单位为rad) | |
| fp32 | angle_speed () const |
| 获取电机角速度(单位为rad/s) | |
| fp32 | torque () const |
| 获取电机扭矩(单位为A) | |
| fp32 | linear_speed () const |
| 获取电机线速度(单位为m/s) | |
Public 属性 | |
| controller_type | controller |
| motor_key_type | name |
| using roboctrl::device::controlled_motor< motor_type, controller_type >::motor_key_type = typename motor_type::info_type::key_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| controller_type roboctrl::device::controlled_motor< motor_type, controller_type >::controller |
| motor_key_type roboctrl::device::controlled_motor< motor_type, controller_type >::name |