feat(robot): 添加监控模块到自定义机器人
在自定义机器人中添加Monitor模块,用于监控机器人状态。包括在头文件中添加Monitor成员变量声明,在实现文件中添加初始化和资源释放逻辑。
This commit is contained in:
@@ -66,6 +66,10 @@ CustomRobot::~CustomRobot() {
|
||||
recharge_.reset();
|
||||
}
|
||||
|
||||
if (monitor_) {
|
||||
monitor_.reset();
|
||||
}
|
||||
|
||||
try {
|
||||
unitree::robot::ChannelFactory::Instance()->Release();
|
||||
LOG_INFO("ChannelFactory released");
|
||||
@@ -94,6 +98,9 @@ bool CustomRobot::initialize() {
|
||||
recharge_ = std::make_unique<Recharge>();
|
||||
recharge_->Init();
|
||||
|
||||
monitor_ = std::make_unique<Monitor>();
|
||||
monitor_->initialize();
|
||||
|
||||
if (!initializeMqtt()) {
|
||||
LOG_ERROR("Failed to initialize MQTT client");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user