One Motor 0.5.1
RoboMaster全平台一站式电机驱动库
|
#include <J4310.hpp>
Public 成员函数 | |
J4310 (Can::CanDriver &driver, uint16_t canId, uint16_t masterId) | |
构造一个新的 J4310 对象 | |
Result | enable () |
启用电机 | |
Result | disable () |
禁用电机 | |
Result | setZeroPosition () |
将当前位置设置为零 | |
Result | cleanError () |
清除电机错误 | |
Result | MITControl (float position, float velocity, float torque, float kp, float kd) |
MIT 控制模式 | |
Result | posVelControl (float position, float velocity) |
位置和速度控制模式 | |
Result | velControl (float velocity) |
速度控制模式 | |
std::expected< J4310Status, std::string > | getStatus () |
获取电机状态 | |
DM J4310 电机驱动类
|
explicit |
构造一个新的 J4310 对象
driver | CAN 驱动程序引用 |
canId | 电机 CAN ID |
masterId | 用于接收消息的主机 CAN ID |
J4310::Result OneMotor::Motor::DM::J4310::cleanError | ( | ) |
清除电机错误
J4310::Result OneMotor::Motor::DM::J4310::disable | ( | ) |
禁用电机
J4310::Result OneMotor::Motor::DM::J4310::enable | ( | ) |
启用电机
std::expected< J4310Status, std::string > OneMotor::Motor::DM::J4310::getStatus | ( | ) |
获取电机状态
J4310::Result OneMotor::Motor::DM::J4310::MITControl | ( | float | position, |
float | velocity, | ||
float | torque, | ||
float | kp, | ||
float | kd ) |
MIT 控制模式
position | 目标位置 (rad) |
velocity | 目标速度 (rad/s) |
torque | 目标扭矩 (N*m) |
kp | 位置增益 |
kd | 速度增益 |
J4310::Result OneMotor::Motor::DM::J4310::posVelControl | ( | float | position, |
float | velocity ) |
位置和速度控制模式
position | 目标位置 (rad) |
velocity | 目标速度 (rad/s) |
J4310::Result OneMotor::Motor::DM::J4310::setZeroPosition | ( | ) |
将当前位置设置为零
J4310::Result OneMotor::Motor::DM::J4310::velControl | ( | float | velocity | ) |
速度控制模式
velocity | 目标速度 (rad/s) |