mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 03:00:20 +08:00
[sync]add Interleave Laser sync
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
"color_topics": [
|
||||
"/G0_4J/color/image_raw",
|
||||
"/G1_F0/color/image_raw",
|
||||
"/G2_15/left_ir/image_raw"
|
||||
"/G2_15/color/image_raw"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -293,6 +293,8 @@ class OBCameraNode {
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
void setRESETTimestampCallback(const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
void setSYNCInterleaveLaserCallback(const std::shared_ptr<SetInt32 ::Request>& request,
|
||||
std::shared_ptr<SetInt32 ::Response>& response);
|
||||
bool toggleSensor(const stream_index_pair& stream_index, bool enabled, std::string& msg);
|
||||
|
||||
void saveImageCallback(const std::shared_ptr<std_srvs::srv::Empty::Request>& request,
|
||||
@@ -443,6 +445,7 @@ class OBCameraNode {
|
||||
rclcpp::Service<GetInt32>::SharedPtr get_ldp_measure_distance_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_sync_immediately_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_reset_timestamp_srv_;
|
||||
rclcpp::Service<SetInt32>::SharedPtr set_interleaver_laser_sync_srv_;
|
||||
|
||||
bool enable_sync_output_accel_gyro_ = false;
|
||||
bool publish_tf_ = false;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user