One Motor 0.5.1
RoboMaster全平台一站式电机驱动库
载入中...
搜索中...
未找到
OneMotor::Motor::DM::J4310类 参考

DM J4310 电机驱动类 更多...

#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 电机驱动类

构造及析构函数说明

◆ J4310()

OneMotor::Motor::DM::J4310::J4310 ( Can::CanDriver & driver,
uint16_t canId,
uint16_t masterId )
explicit

构造一个新的 J4310 对象

参数
driverCAN 驱动程序引用
canId电机 CAN ID
masterId用于接收消息的主机 CAN ID

成员函数说明

◆ cleanError()

J4310::Result OneMotor::Motor::DM::J4310::cleanError ( )

清除电机错误

返回
操作结果

◆ disable()

J4310::Result OneMotor::Motor::DM::J4310::disable ( )

禁用电机

返回
操作结果

◆ enable()

J4310::Result OneMotor::Motor::DM::J4310::enable ( )

启用电机

返回
操作结果

◆ getStatus()

std::expected< J4310Status, std::string > OneMotor::Motor::DM::J4310::getStatus ( )

获取电机状态

返回
一个包含状态或错误字符串的 std::expected 对象

◆ MITControl()

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速度增益
返回
操作结果

◆ posVelControl()

J4310::Result OneMotor::Motor::DM::J4310::posVelControl ( float position,
float velocity )

位置和速度控制模式

参数
position目标位置 (rad)
velocity目标速度 (rad/s)
返回
操作结果

◆ setZeroPosition()

J4310::Result OneMotor::Motor::DM::J4310::setZeroPosition ( )

将当前位置设置为零

返回
操作结果

◆ velControl()

J4310::Result OneMotor::Motor::DM::J4310::velControl ( float velocity)

速度控制模式

参数
velocity目标速度 (rad/s)
返回
操作结果

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