2022-06-06 19:00:12 +08:00
|
|
|
/**************************************************************************/
|
|
|
|
|
/* */
|
|
|
|
|
/* Copyright (c) 2013-2021 Orbbec 3D Technology, Inc */
|
|
|
|
|
/* */
|
|
|
|
|
/* PROPRIETARY RIGHTS of Orbbec 3D Technology are involved in the */
|
|
|
|
|
/* subject matter of this material. All manufacturing, reproduction, use, */
|
|
|
|
|
/* and sales rights pertaining to this subject matter are governed by the */
|
|
|
|
|
/* license agreement. The recipient of this software implicitly accepts */
|
|
|
|
|
/* the terms of the license. */
|
|
|
|
|
/* */
|
|
|
|
|
/**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include <ostream>
|
|
|
|
|
#include <glog/logging.h>
|
|
|
|
|
#include <Eigen/Dense>
|
|
|
|
|
#include <tf2/LinearMath/Quaternion.h>
|
2022-06-08 10:21:57 +08:00
|
|
|
#include <rclcpp/rclcpp.hpp>
|
2022-06-06 19:00:12 +08:00
|
|
|
|
2022-06-08 14:51:00 +08:00
|
|
|
#include "libobsensor/ObSensor.hpp"
|
2022-06-06 19:00:12 +08:00
|
|
|
#include "sensor_msgs/distortion_models.hpp"
|
|
|
|
|
#include "sensor_msgs/msg/camera_info.hpp"
|
2022-06-08 14:51:00 +08:00
|
|
|
#include "orbbec_camera_msgs/msg/extrinsics.hpp"
|
2023-02-06 17:26:10 +08:00
|
|
|
#include "magic_enum/magic_enum.hpp"
|
2022-06-06 19:00:12 +08:00
|
|
|
|
|
|
|
|
namespace orbbec_camera {
|
|
|
|
|
sensor_msgs::msg::CameraInfo convertToCameraInfo(OBCameraIntrinsic intrinsic,
|
2022-12-28 16:39:11 +08:00
|
|
|
OBCameraDistortion distortion, int width);
|
2022-06-06 19:00:12 +08:00
|
|
|
|
2023-02-20 13:58:37 +08:00
|
|
|
void saveRGBPointsToPly(const std::shared_ptr<ob::Frame>& frame, const std::string& fileName);
|
2022-06-06 19:00:12 +08:00
|
|
|
|
2023-02-20 13:58:37 +08:00
|
|
|
void savePointsToPly(const std::shared_ptr<ob::Frame>& frame, const std::string& fileName);
|
2022-06-06 19:00:12 +08:00
|
|
|
|
|
|
|
|
tf2::Quaternion rotationMatrixToQuaternion(const float rotation[9]);
|
|
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& os, const OBCameraParam& rhs);
|
|
|
|
|
|
|
|
|
|
orbbec_camera_msgs::msg::Extrinsics obExtrinsicsToMsg(const OBD2CTransform& extrinsics,
|
|
|
|
|
const std::string& frame_id);
|
|
|
|
|
|
2022-06-08 10:21:57 +08:00
|
|
|
rclcpp::Time frameTimeStampToROSTime(uint64_t ms);
|
|
|
|
|
|
2022-06-09 15:47:02 +08:00
|
|
|
std::string getObSDKVersion();
|
|
|
|
|
|
2022-06-24 14:08:31 +08:00
|
|
|
OBFormat OBFormatFromString(const std::string& format);
|
|
|
|
|
|
2022-12-28 13:55:26 +08:00
|
|
|
std::string ObDeviceTypeToString(const OBDeviceType& type);
|
|
|
|
|
|
2023-02-06 17:26:10 +08:00
|
|
|
rmw_qos_profile_t getRMWQosProfileFromString(const std::string& str_qos);
|
|
|
|
|
|
2023-03-02 20:15:01 +08:00
|
|
|
bool isOpenNIDevice(int pid);
|
|
|
|
|
|
2023-03-20 11:18:59 +08:00
|
|
|
OB_DEPTH_PRECISION_LEVEL depthPrecisionLevelFromString(
|
|
|
|
|
const std::string& depth_precision_level_str);
|
|
|
|
|
|
|
|
|
|
OBSyncMode OBSyncModeFromString(const std::string& mode);
|
|
|
|
|
|
2022-06-06 19:00:12 +08:00
|
|
|
} // namespace orbbec_camera
|