optimize robot work info

This commit is contained in:
2025-11-07 23:08:19 +08:00
parent f0b847af96
commit a96384e8f3

View File

@@ -443,6 +443,7 @@ void CerebrumNode::RegisterSkillBtActions()
}
auto & inst = per_instance_exec_[key];
if (inst.in_flight.load(std::memory_order_acquire) && !inst.finished.load(std::memory_order_acquire)) {
robot_work_info_.bt_node_status = "RUNNING";
return BT::NodeStatus::RUNNING;
}
// Init per-instance state and launch worker
@@ -491,6 +492,7 @@ void CerebrumNode::RegisterSkillBtActions()
}).detach();
RCLCPP_INFO(this->get_logger(), "[%s/%s] launched per-instance ExecuteBtAction goal", bt_type.c_str(), instance_name.c_str());
robot_work_info_.bt_node_status = "RUNNING";
return BT::NodeStatus::RUNNING;
};
handlers.on_running = [this, bt_type](rclcpp::Node *, BT::TreeNode & node) {
@@ -1242,9 +1244,9 @@ void CerebrumNode::RobotWorkInfoPublish()
for (auto & task : msg.task) {
if (task == "bt_carry_boxes_sch1") {
task = "StockIn";
} else if (task == "bt_carry_boxes_sch2") {
task = "StockOut";
} else if (task == "bt_carry_boxes_sch2") {
task = "StockIn";
}
}