cmvr-es/include/hardware/can/motor_protocol/abstractmotorprotocol.h
2025-10-24 17:06:17 +08:00

35 lines
886 B
C++

//
// Created by linbo on 2025/10/22.
//
#ifndef CMVR_ES_ABSTRACTMOTORPROTOCOL_H
#define CMVR_ES_ABSTRACTMOTORPROTOCOL_H
#include "rapidxml/xml_parser.h"
namespace cmvr::hardware
{
class AbstractMotorProtocol
{
public:
explicit AbstractMotorProtocol(const XmlNode &cfg)
{
cfg_ = cfg;
id_ = cfg.getAttrString("id");
joint_name_ = cfg.getAttrString("joint_name");
limitQLb_ = cfg.getAttrDefault("limitQLb_",3.14f);
limitQUb_ = cfg.getAttrDefault("limitQUb_",3.14f);
limitQd = cfg.getAttrDefault("limitQd",3.0f);
}
~AbstractMotorProtocol() = default;
private:
XmlNode cfg_;
std::string id_;
std::string joint_name_;
double limitQLb_;
double limitQUb_;
double limitQd;
};
}
#endif //CMVR_ES_ABSTRACTMOTORPROTOCOL_H