2025-10-22 16:40:55 +08:00
|
|
|
//
|
|
|
|
|
// Created by linbo on 2025/10/22.
|
|
|
|
|
//
|
|
|
|
|
|
2025-10-24 09:51:14 +08:00
|
|
|
#ifndef CMVR_ES_ABSTRACTMOTORPROTOCOL_H
|
|
|
|
|
#define CMVR_ES_ABSTRACTMOTORPROTOCOL_H
|
2025-10-22 16:40:55 +08:00
|
|
|
#include "rapidxml/xml_parser.h"
|
|
|
|
|
|
2025-10-24 10:51:49 +08:00
|
|
|
namespace cmvr::hardware
|
2025-10-22 16:40:55 +08:00
|
|
|
{
|
2025-10-24 09:51:14 +08:00
|
|
|
class AbstractMotorProtocol
|
2025-10-22 16:40:55 +08:00
|
|
|
{
|
|
|
|
|
public:
|
2025-10-24 09:51:14 +08:00
|
|
|
explicit AbstractMotorProtocol(const XmlNode &cfg)
|
2025-10-22 16:40:55 +08:00
|
|
|
{
|
|
|
|
|
cfg_ = cfg;
|
|
|
|
|
id_ = cfg.getAttrString("id");
|
|
|
|
|
joint_name_ = cfg.getAttrString("joint_name");
|
|
|
|
|
limitQLb_ = cfg.getAttrDefault("limitQLb_",(float)3.14);
|
|
|
|
|
limitQUb_ = cfg.getAttrDefault("limitQUb_",(float)3.14);
|
|
|
|
|
limitQd = cfg.getAttrDefault("limitQd",(float)3.0);
|
|
|
|
|
}
|
2025-10-24 09:51:14 +08:00
|
|
|
~AbstractMotorProtocol() = default;
|
2025-10-22 16:40:55 +08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
XmlNode cfg_;
|
|
|
|
|
std::string id_;
|
|
|
|
|
std::string joint_name_;
|
|
|
|
|
double limitQLb_;
|
|
|
|
|
double limitQUb_;
|
|
|
|
|
double limitQd;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-24 09:51:14 +08:00
|
|
|
#endif //CMVR_ES_ABSTRACTMOTORPROTOCOL_H
|