2025-08-22 16:57:29 +08:00
|
|
|
//
|
|
|
|
|
// Created by lgv on 2025/8/13.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdlib> // for std::atof
|
|
|
|
|
|
|
|
|
|
#include <glog/logging.h>
|
2025-11-17 16:49:09 +08:00
|
|
|
#include "../src/device_manager/include/device_manager.h"
|
2025-08-22 16:57:29 +08:00
|
|
|
#include <libgen.h>
|
|
|
|
|
|
|
|
|
|
using namespace cmvr::device;
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
|
|
|
|
|
|
// 这里按你的原代码结构获取 robot
|
|
|
|
|
std::string config_path = "/home/lgv/cmvr/cmvr-es/config/cabin_robot.xml";
|
|
|
|
|
const XmlNode config(config_path);
|
|
|
|
|
|
|
|
|
|
if (!config.hasChild("DeviceManager")) {
|
|
|
|
|
LOG(ERROR) << "Device Manager node not found";
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto dmgr_cfg = config.getChild("DeviceManager");
|
|
|
|
|
auto &dmgr = DeviceManager::getInstance(dmgr_cfg);
|
|
|
|
|
|
|
|
|
|
auto robot = dmgr.getDevice<AbstractRobot>("hc01");
|
|
|
|
|
|
|
|
|
|
robot->eStop();
|
|
|
|
|
|
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|