mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 11:10:19 +08:00
feat: add support for Gemini 305 series in camera node and related components
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
|
||||
#define THREAD_NUM 4
|
||||
|
||||
@@ -136,5 +137,11 @@ const int32_t DABAI_MAX_PID = 0x069a; // dabai max
|
||||
const int32_t GEMINI_338_PID = 0x0818; // Gemini 338
|
||||
const uint16_t GEMINI_435Le_PID = 0x815; // Gemini 435Le
|
||||
const uint16_t GEMINI_305_PID = 0x0840; // Gemini 305
|
||||
const uint16_t GEMINI_305_PID2 = 0x0841; // Gemini 305
|
||||
const uint16_t GEMINI_305G_PID = 0x0842; // Gemini 305g
|
||||
|
||||
inline bool isGemini305SeriesPID(uint32_t pid) {
|
||||
return pid == GEMINI_305_PID || pid == GEMINI_305_PID2 || pid == GEMINI_305G_PID;
|
||||
}
|
||||
|
||||
} // namespace orbbec_camera
|
||||
|
||||
@@ -1465,19 +1465,19 @@ void OBCameraNode::setupProfiles() {
|
||||
format_[elem] == OB_FORMAT_UNKNOWN) {
|
||||
selected_profile = profiles->getProfile(0)->as<ob::VideoStreamProfile>();
|
||||
} else {
|
||||
if (pid_ == GEMINI_305_PID && elem == DEPTH) {
|
||||
if (isGemini305SeriesPID(pid_) && elem == DEPTH) {
|
||||
OBHardwareDecimationConfig conf;
|
||||
conf.originWidth = width_[elem];
|
||||
conf.originHeight = height_[elem];
|
||||
conf.factor = depth_decimation_factor_;
|
||||
selected_profile = profiles->getVideoStreamProfile(conf, format_[elem], fps_[elem]);
|
||||
} else if (pid_ == GEMINI_305_PID && elem == INFRA1) {
|
||||
} else if (isGemini305SeriesPID(pid_) && elem == INFRA1) {
|
||||
OBHardwareDecimationConfig conf;
|
||||
conf.originWidth = width_[elem];
|
||||
conf.originHeight = height_[elem];
|
||||
conf.factor = left_ir_decimation_factor_;
|
||||
selected_profile = profiles->getVideoStreamProfile(conf, format_[elem], fps_[elem]);
|
||||
} else if (pid_ == GEMINI_305_PID && elem == INFRA2) {
|
||||
} else if (isGemini305SeriesPID(pid_) && elem == INFRA2) {
|
||||
OBHardwareDecimationConfig conf;
|
||||
conf.originWidth = width_[elem];
|
||||
conf.originHeight = height_[elem];
|
||||
@@ -4428,12 +4428,12 @@ bool OBCameraNode::isGemini335PID(uint32_t pid) {
|
||||
|
||||
bool OBCameraNode::isGemini435LePID(uint32_t pid) { return pid == GEMINI_435Le_PID; }
|
||||
bool OBCameraNode::isPublishMetaData(uint32_t pid) {
|
||||
return isGemini335PID(pid) || isGemini435LePID(pid) || pid == GEMINI_305_PID;
|
||||
return isGemini335PID(pid) || isGemini435LePID(pid) || isGemini305SeriesPID(pid);
|
||||
}
|
||||
|
||||
bool OBCameraNode::isDepthWorkModeDevices(uint32_t pid) { return pid == GEMINI_435Le_PID; }
|
||||
|
||||
bool OBCameraNode::isnotLaserDevices(uint32_t pid) { return pid == GEMINI_305_PID; }
|
||||
bool OBCameraNode::isnotLaserDevices(uint32_t pid) { return isGemini305SeriesPID(pid); }
|
||||
|
||||
orbbec_camera_msgs::msg::IMUInfo OBCameraNode::createIMUInfo(
|
||||
const stream_index_pair &stream_index) {
|
||||
|
||||
@@ -1331,8 +1331,8 @@ void OBCameraNodeDriver::startDevice(const std::shared_ptr<ob::DeviceList> &list
|
||||
if (GEMINI_335LG_PID == pid) {
|
||||
ob_camera_node_->startGmslTrigger();
|
||||
}
|
||||
if (pid == GEMINI_305_PID) {
|
||||
// Fixing 305 hot-swap not outputting power
|
||||
if (isGemini305SeriesPID(pid)) {
|
||||
// Fixing 305 series hot-swap not outputting power
|
||||
ob_camera_node_->startStreams();
|
||||
}
|
||||
} catch (ob::Error &e) {
|
||||
|
||||
@@ -665,13 +665,13 @@ void OBCameraNode::setAeRoiCallback(const std::shared_ptr<SetArrays ::Request>&
|
||||
std::shared_ptr<SetArrays::Response>& response,
|
||||
const stream_index_pair& stream_index) {
|
||||
auto stream = stream_index.first;
|
||||
if (device_->getDeviceInfo()->getPid() == GEMINI_305_PID &&
|
||||
if (isGemini305SeriesPID(device_->getDeviceInfo()->getPid()) &&
|
||||
(stream != OB_STREAM_COLOR && ae_mode_ == "colorbased")) {
|
||||
response->success = false;
|
||||
response->message = "AE MODE is colorbased, other sensors setting is not supported";
|
||||
return;
|
||||
}
|
||||
if (device_->getDeviceInfo()->getPid() == GEMINI_305_PID &&
|
||||
if (isGemini305SeriesPID(device_->getDeviceInfo()->getPid()) &&
|
||||
(stream != OB_STREAM_DEPTH && ae_mode_ == "depthbased")) {
|
||||
response->success = false;
|
||||
response->message = "AE MODE is depthbased, other sensors sensor setting is not supported";
|
||||
|
||||
@@ -26,8 +26,8 @@ void listSensorProfiles(const std::shared_ptr<ob::Device>& device) {
|
||||
auto origin_profile = profile_list->getProfile(j);
|
||||
if ((sensor->getType() == OB_SENSOR_DEPTH || sensor->getType() == OB_SENSOR_IR_LEFT ||
|
||||
sensor->getType() == OB_SENSOR_IR_RIGHT) &&
|
||||
pid == GEMINI_305_PID) {
|
||||
// Gemini 305
|
||||
isGemini305SeriesPID(pid)) {
|
||||
// Gemini 305 series
|
||||
auto profile = origin_profile->as<ob::VideoStreamProfile>();
|
||||
std::cout << magic_enum::enum_name(sensor->getType()) << " profile: " << profile->getWidth()
|
||||
<< "x" << profile->getHeight() << " " << profile->getFps() << "fps "
|
||||
|
||||
Reference in New Issue
Block a user