cmvr-es/src/hardware/can/can_group.cpp

26 lines
682 B
C++
Raw Normal View History

2025-10-22 16:40:55 +08:00
//
// Created by linbo on 2025/10/22.
//
#include "hardware/can/can_group.h"
2025-10-24 09:51:14 +08:00
#include <glog/logging.h>
2025-10-22 16:40:55 +08:00
using namespace std;
2025-10-24 10:51:49 +08:00
using namespace cmvr::hardware;
2025-10-22 16:40:55 +08:00
CanGroup::CanGroup(const XmlNode &cfg)
{
2025-10-24 09:51:14 +08:00
try {
id_ = cfg.getAttrString("id");
channelId_ = cfg.getAttrDefault("channelId",0);
enable_ = cfg.getAttrDefault("enable", false);
motor_protocol_manager = std::make_shared<MotorProtocolManager>(cfg);
}
catch (const exception &e) {
LOG(FATAL) << "[CanGroup] (CanGroup): CanGroup initialization failed: " << e.what();
throw std::runtime_error("[CanGroup] (CanGroup): CanGroup create failed" + string(e.what()));
}
}