mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-10 22:49:51 +08:00
fixed set ir mirror
This commit is contained in:
@@ -1,18 +1,18 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "orbbec_camera/ob_camera_node.h"
|
#include "orbbec_camera/ob_camera_node.h"
|
||||||
#include <rclcpp/rclcpp.hpp>
|
#include <rclcpp/rclcpp.hpp>
|
||||||
@@ -156,7 +156,7 @@ void OBCameraNode::setupCameraCtrlServices() {
|
|||||||
});
|
});
|
||||||
switch_ir_camera_srv_ = node_->create_service<SetString>(
|
switch_ir_camera_srv_ = node_->create_service<SetString>(
|
||||||
"switch_ir", [this](const std::shared_ptr<SetString::Request> request,
|
"switch_ir", [this](const std::shared_ptr<SetString::Request> request,
|
||||||
std::shared_ptr<SetString::Response> response) {
|
std::shared_ptr<SetString::Response> response) {
|
||||||
switchIRCameraCallback(request, response);
|
switchIRCameraCallback(request, response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -462,7 +462,6 @@ void OBCameraNode::getExposureCallback(const std::shared_ptr<GetInt32::Request>&
|
|||||||
auto stream = stream_index.first;
|
auto stream = stream_index.first;
|
||||||
try {
|
try {
|
||||||
switch (stream) {
|
switch (stream) {
|
||||||
case OB_STREAM_IR_LEFT:
|
|
||||||
case OB_STREAM_IR_RIGHT:
|
case OB_STREAM_IR_RIGHT:
|
||||||
case OB_STREAM_IR:
|
case OB_STREAM_IR:
|
||||||
response->data = device_->getIntProperty(OB_PROP_IR_EXPOSURE_INT);
|
response->data = device_->getIntProperty(OB_PROP_IR_EXPOSURE_INT);
|
||||||
@@ -545,8 +544,9 @@ void OBCameraNode::setMirrorCallback(const std::shared_ptr<SetBool::Request>& re
|
|||||||
auto stream = stream_index.first;
|
auto stream = stream_index.first;
|
||||||
try {
|
try {
|
||||||
switch (stream) {
|
switch (stream) {
|
||||||
case OB_STREAM_IR_LEFT:
|
|
||||||
case OB_STREAM_IR_RIGHT:
|
case OB_STREAM_IR_RIGHT:
|
||||||
|
device_->setBoolProperty(OB_PROP_IR_RIGHT_MIRROR_BOOL, request->data);
|
||||||
|
case OB_STREAM_IR_LEFT:
|
||||||
case OB_STREAM_IR:
|
case OB_STREAM_IR:
|
||||||
device_->setBoolProperty(OB_PROP_IR_MIRROR_BOOL, request->data);
|
device_->setBoolProperty(OB_PROP_IR_MIRROR_BOOL, request->data);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user