[sync]add Interleave Laser sync

This commit is contained in:
jj
2024-11-19 17:45:50 +08:00
parent 79ea8ea93a
commit b9c8edf3b1
3 changed files with 27 additions and 2 deletions
+23 -1
View File
@@ -179,6 +179,11 @@ void OBCameraNode::setupCameraCtrlServices() {
std::shared_ptr<SetBool::Response> response) {
setRESETTimestampCallback(request, response);
});
set_interleaver_laser_sync_srv_ = node_->create_service<SetInt32>(
"set_sync_interleaverlaser", [this](const std::shared_ptr<SetInt32::Request> request,
std::shared_ptr<SetInt32::Response> response) {
setSYNCInterleaveLaserCallback(request, response);
});
}
void OBCameraNode::setExposureCallback(const std::shared_ptr<SetInt32::Request>& request,
@@ -815,5 +820,22 @@ void OBCameraNode::setRESETTimestampCallback(
response->success = false;
}
}
void OBCameraNode::setSYNCInterleaveLaserCallback(
const std::shared_ptr<SetInt32 ::Request>& request,
std::shared_ptr<SetInt32 ::Response>& response) {
(void)request;
try {
device_->setIntProperty(OB_PROP_TIMER_RESET_TRIGGER_OUT_ENABLE_BOOL, request->data);
response->success = true;
} catch (const ob::Error& e) {
response->message = e.getMessage();
response->success = false;
} catch (const std::exception& e) {
response->message = e.what();
response->success = false;
} catch (...) {
response->message = "unknown error";
response->success = false;
}
}
} // namespace orbbec_camera