feat: rename AE mode parameter to AE reference stream and update related callbacks

This commit is contained in:
slz
2026-04-03 19:04:22 +08:00
parent 9aa802083d
commit 85cb7ed0ee
5 changed files with 23 additions and 23 deletions
+13 -13
View File
@@ -282,10 +282,10 @@ void OBCameraNode::setupCameraCtrlServices() {
getUserCalibParamsCallback(request, response);
});
}
set_ae_mode_srv_ = node_->create_service<SetString>(
"set_ae_mode", [this](const std::shared_ptr<SetString::Request> request,
set_ae_reference_stream_srv_ = node_->create_service<SetString>(
"set_ae_reference_stream", [this](const std::shared_ptr<SetString::Request> request,
std::shared_ptr<SetString::Response> response) {
setAEModeCallback(request, response);
setAEReferenceStreamCallback(request, response);
});
set_sports_mode_srv_ = node_->create_service<SetBool>(
"set_sports_mode", [this](const std::shared_ptr<SetBool::Request> request,
@@ -666,15 +666,15 @@ void OBCameraNode::setAeRoiCallback(const std::shared_ptr<SetArrays ::Request>&
const stream_index_pair& stream_index) {
auto stream = stream_index.first;
if (device_->getDeviceInfo()->getPid() == GEMINI_305_PID &&
(stream != OB_STREAM_COLOR && ae_mode_ == "colorbased")) {
(stream != OB_STREAM_COLOR && ae_reference_stream_ == "color")) {
response->success = false;
response->message = "AE MODE is colorbased, other sensors setting is not supported";
response->message = "AE Reference Stream is color, other sensors setting is not supported";
return;
}
if (device_->getDeviceInfo()->getPid() == GEMINI_305_PID &&
(stream != OB_STREAM_DEPTH && ae_mode_ == "depthbased")) {
(stream != OB_STREAM_DEPTH && ae_reference_stream_ == "depth")) {
response->success = false;
response->message = "AE MODE is depthbased, other sensors sensor setting is not supported";
response->message = "AE Reference Stream is depth, other sensors sensor setting is not supported";
return;
}
auto config = OBRegionOfInterest();
@@ -1649,19 +1649,19 @@ void OBCameraNode::getUserCalibParamsCallback(
response->message = "exception occurred";
}
}
void OBCameraNode::setAEModeCallback(const std::shared_ptr<SetString::Request>& request,
void OBCameraNode::setAEReferenceStreamCallback(const std::shared_ptr<SetString::Request>& request,
std::shared_ptr<SetString::Response>& response) {
try {
if (device_->isPropertySupported(OB_PROP_DEVICE_AE_REFERENCE_INT, OB_PERMISSION_WRITE) &&
(request->data == "depthbased" || request->data == "colorbased")) {
(request->data == "depth" || request->data == "color")) {
device_->setIntProperty(OB_PROP_DEVICE_AE_REFERENCE_INT,
request->data == "depthbased" ? 0 : 1);
ae_mode_ = request->data;
request->data == "depth" ? 0 : 1);
ae_reference_stream_ = request->data;
response->success = true;
response->message = "set AE mode success";
response->message = "set AE reference stream success";
} else {
response->success = false;
response->message = "set AE mode failed";
response->message = "set AE reference stream failed";
}
} catch (...) {
response->success = false;