Adapter Femto bolt device.

This commit is contained in:
lixiaobin
2023-10-09 19:56:35 +08:00
parent 04c7f4a9af
commit f0a3771602
19 changed files with 1615 additions and 438 deletions
@@ -58,7 +58,7 @@ ob_multi_device_sync_config ob_device_get_multi_device_sync_config(ob_device *de
* @brief The device will start one time image capture after receiving the capture command when it is in the @ref OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING
*
* @attention The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream. The
* number of frames per trigger can be set by @ref framesPerTriggerForTriggeringMode.
* number of frames per trigger can be set by @ref framesPerTrigger.
* @attention For some modelsreceive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling this
* function should not be too high, please refer to the product manual for the specific supported frequency.
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.
@@ -154,6 +154,7 @@ typedef enum {
OB_SENSOR_GYRO = 5, /**< Gyro */
OB_SENSOR_IR_LEFT = 6, /**< left IR */
OB_SENSOR_IR_RIGHT = 7, /**< Right IR */
OB_SENSOR_RAW_PHASE = 8, /**< Raw Phase */
} OBSensorType,
ob_sensor_type;
@@ -170,6 +171,7 @@ typedef enum {
OB_STREAM_GYRO = 5, /**< Gyroscope data stream */
OB_STREAM_IR_LEFT = 6, /**< Left IR stream */
OB_STREAM_IR_RIGHT = 7, /**< Right IR stream */
OB_STREAM_RAW_PHASE = 8, /**< RawPhase Stream */
} OBStreamType,
ob_stream_type;
@@ -188,6 +190,7 @@ typedef enum {
OB_FRAME_GYRO = 7, /**< Gyroscope data frame */
OB_FRAME_IR_LEFT = 8, /**< Left IR frame */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame */
OB_FRAME_RAW_PHASE = 10, /**< Rawphase frame*/
} OBFrameType,
ob_frame_type;
@@ -1069,7 +1072,7 @@ typedef enum {
* @brief software triggering mode
* @brief The device will start one time image capture after receiving the capture command and will output the trigger signal via VSYNC_OUT pin by default.
* The capture command can be sent form host by call @ref ob_device_trigger_capture. The number of images captured each time can be set by @ref
* framesPerTriggerForTriggeringMode.
* framesPerTrigger.
* @brief The Color and Depth should be set to same frame rates, the Color and Depth will be synchronized and can be adjusted by @ref colorDelayUs, @ref
* depthDelayUs or @ref trigger2ImageDelayUs.
*
@@ -1081,7 +1084,7 @@ typedef enum {
/**
* @brief hardware triggering mode
* @brief The device will start one time image capture after receiving the trigger signal via VSYNC_IN pin on synchronization port and will output the
* trigger signal via VSYNC_OUT pin by default. The number of images captured each time can be set by @ref framesPerTriggerForTriggeringMode.
* trigger signal via VSYNC_OUT pin by default. The number of images captured each time can be set by @ref framesPerTrigger.
* @brief The Color and Depth should be set to same frame rates, the Color and Depth will be synchronized and can be adjusted by @ref colorDelayUs, @ref
* depthDelayUs or @ref trigger2ImageDelayUs.
*
@@ -1124,7 +1127,7 @@ typedef struct {
* @brief The delay time of the image capture after receiving the capture command or trigger signal in microseconds.
* @brief The depth and color images are captured synchronously as the product design and can not change the delay between the depth and color images.
*
* @attention For Orbbec Astra 2 device, this parameter is valid only when the @ref triggerSignalOutputDelayUs is set to 0.
* @attention For Orbbec Astra 2 device, this parameter is valid only when the @ref triggerOutDelayUs is set to 0.
* @attention This parameter is only valid for some models to replace @ref depthDelayUs and @ref colorDelayUs, please refer to the product manual for
* details.
*/
@@ -1133,13 +1136,13 @@ typedef struct {
/**
* @brief Trigger signal output enable flag.
* @brief After the trigger signal output is enabled, the trigger signal will be output when the capture command or trigger signal is received. User can
* adjust the delay time of the trigger signal output by @ref triggerSignalOutputDelayUs.
* adjust the delay time of the trigger signal output by @ref triggerOutDelayUs.
*
* @attention For some models, the trigger signal output is always enabled and cannot be disabled in some modes.
* @attention For some models, the trigger signal output is always enabled and cannot be disabled.
* @attention If device is in the @ref OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN or @ref OB_MULTI_DEVICE_SYNC_MODE_STANDALONE mode, the trigger signal output is
* always disabled. Set this parameter to true will not take effect.
*/
bool triggerSignalOutputEnable;
bool triggerOutEnable;
/**
* @brief The delay time of the trigger signal output after receiving the capture command or trigger signal in microseconds.
@@ -1147,17 +1150,17 @@ typedef struct {
* @attention For Orbbec Astra 2 device, only supported -1 and 0. -1 means the trigger signal output delay is automatically adjusted by the device, 0 means
* the trigger signal output is disabled.
*/
int triggerSignalOutputDelayUs;
int triggerOutDelayUs;
/**
* @brief The number of frames per trigger in the triggering mode.
* @brief The frame number of each stream after each trigger in triggering mode.
*
* @attention This parameter is only valid when the triggering mode is set to @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING or @ref
* OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING.
* @attention The trigger frequency multiplied by the number of frames per trigger cannot exceed the maximum frame rate of the stream profile which is set
* when starting the stream.
*/
int framesPerTriggerForTriggeringMode;
int framesPerTrigger;
} ob_multi_device_sync_config, OBMultiDeviceSyncConfig;
/**
@@ -384,6 +384,8 @@ typedef enum {
*/
OB_PROP_LASER_PULSE_WIDTH_PROTECTION_STATUS_BOOL = 149,
OB_PROP_UPDATE_BASE_TIME_BOOL = 150,
/**
* @brief Baseline calibration parameters
*/
@@ -577,6 +579,11 @@ typedef enum {
*/
OB_PROP_IR_SHORT_EXPOSURE_BOOL = 2032,
/**
* @brief Color camera HDR
*/
OB_PROP_COLOR_HDR_BOOL = 2034,
/**
* @brief Software disparity to depth
*/
@@ -480,7 +480,7 @@ public:
* OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING
*
* @attention The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream.
* The number of frames per trigger can be set by @ref framesPerTriggerForTriggeringMode.
* The number of frames per trigger can be set by @ref framesPerTrigger.
* @attention For some modelsreceive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling
* this function should not be too high, please refer to the product manual for the specific supported frequency.
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.
@@ -360,6 +360,18 @@ public:
float temperature();
};
/**
* @brief Define the RawPhaseFrame class, which inherits from the VideoFrame class
*/
class OB_EXTENSION_API RawPhaseFrame : public VideoFrame {
public:
explicit RawPhaseFrame(Frame &frame);
explicit RawPhaseFrame(std::unique_ptr<FrameImpl> impl);
~RawPhaseFrame() noexcept override = default;
};
/**
* @brief Define the FrameHelper class
*/
@@ -455,6 +467,8 @@ template <typename T> bool Frame::is() {
return (typeid(T) == typeid(FrameSet));
case OB_FRAME_POINTS:
return (typeid(T) == typeid(PointsFrame));
case OB_FRAME_RAW_PHASE:
return (typeid(T) == typeid(RawPhaseFrame) || typeid(T) == typeid(VideoFrame));
default:
std::cout << "ob::Frame::is() did not catch frame type: " << (int)this->type() << std::endl;
break;
@@ -161,6 +161,7 @@ template <typename T> bool StreamProfile::is() {
case OB_STREAM_IR_RIGHT:
case OB_STREAM_COLOR:
case OB_STREAM_DEPTH:
case OB_STREAM_RAW_PHASE:
return typeid(T) == typeid(VideoStreamProfile);
case OB_STREAM_ACCEL:
return typeid(T) == typeid(AccelStreamProfile);
+1 -1
View File
@@ -1 +1 @@
libOrbbecSDK.so.1.7
libOrbbecSDK.so.1.8
@@ -1 +0,0 @@
libOrbbecSDK.so.1.7.4
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -401,8 +401,8 @@ class OBCameraNode {
int depth_delay_us_ = 0;
int color_delay_us_ = 0;
int trigger2image_delay_us_ = 0;
int trigger_signal_output_delay_us_ = 0;
bool trigger_signal_output_enabled_ = false;
int trigger_output_delay_us_ = 0;
bool trigger_output_enabled_ = false;
std::string depth_precision_str_;
OB_DEPTH_PRECISION_LEVEL depth_precision_ = OB_PRECISION_0MM8;
// IMU
+104
View File
@@ -0,0 +1,104 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import PushRosNamespace
from launch.actions import GroupAction
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
def generate_launch_description():
# Declare arguments
args = [
DeclareLaunchArgument('camera_name', default_value='camera'),
DeclareLaunchArgument('depth_registration', default_value='false'),
DeclareLaunchArgument('serial_number', default_value=''),
DeclareLaunchArgument('usb_port', default_value=''),
DeclareLaunchArgument('device_num', default_value='1'),
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
DeclareLaunchArgument('product_id', default_value=''),
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
DeclareLaunchArgument('connection_delay', default_value='100'),
DeclareLaunchArgument('color_width', default_value='1920'),
DeclareLaunchArgument('color_height', default_value='1080'),
DeclareLaunchArgument('color_fps', default_value='30'),
DeclareLaunchArgument('color_format', default_value='MJPG'),
DeclareLaunchArgument('enable_color', default_value='true'),
DeclareLaunchArgument('flip_color', default_value='false'),
DeclareLaunchArgument('color_qos', default_value='default'),
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
DeclareLaunchArgument('depth_width', default_value='640'),
DeclareLaunchArgument('depth_height', default_value='576'),
DeclareLaunchArgument('depth_fps', default_value='30'),
DeclareLaunchArgument('depth_format', default_value='Y16'),
DeclareLaunchArgument('enable_depth', default_value='true'),
DeclareLaunchArgument('flip_depth', default_value='false'),
DeclareLaunchArgument('depth_qos', default_value='default'),
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
DeclareLaunchArgument('ir_width', default_value='640'),
DeclareLaunchArgument('ir_height', default_value='576'),
DeclareLaunchArgument('ir_fps', default_value='30'),
DeclareLaunchArgument('ir_format', default_value='Y16'),
DeclareLaunchArgument('enable_ir', default_value='true'),
DeclareLaunchArgument('flip_ir', default_value='false'),
DeclareLaunchArgument('ir_qos', default_value='default'),
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
DeclareLaunchArgument('enable_accel', default_value='false'),
DeclareLaunchArgument('accel_rate', default_value='100hz'),
DeclareLaunchArgument('accel_range', default_value='4g'),
DeclareLaunchArgument('enable_gyro', default_value='false'),
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
DeclareLaunchArgument('publish_tf', default_value='true'),
DeclareLaunchArgument('tf_publish_rate', default_value='10.0'),
DeclareLaunchArgument('ir_info_url', default_value=''),
DeclareLaunchArgument('color_info_url', default_value=''),
DeclareLaunchArgument('log_level', default_value='none'),
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
DeclareLaunchArgument('enable_ldp', default_value='true'),
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
]
# Node configuration
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
# Define the ComposableNode
compose_node = ComposableNode(
package='orbbec_camera',
plugin='orbbec_camera::OBCameraNodeDriver',
name=LaunchConfiguration('camera_name'),
namespace='',
parameters=parameters,
)
# Define the ComposableNodeContainer
container = ComposableNodeContainer(
name='camera_container',
namespace='',
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
compose_node,
],
output='screen',
)
# Launch description
ld = LaunchDescription(
args +
[
GroupAction([
PushRosNamespace(LaunchConfiguration('camera_name')),
container
])
]
)
return ld
+2 -2
View File
@@ -71,8 +71,8 @@ def generate_launch_description():
DeclareLaunchArgument('depth_delay_us', default_value='0'),
DeclareLaunchArgument('color_delay_us', default_value='0'),
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_enabled', default_value='false'),
DeclareLaunchArgument('trigger_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_output_enabled', default_value='false'),
]
# Node configuration
+2 -2
View File
@@ -71,8 +71,8 @@ def generate_launch_description():
DeclareLaunchArgument('depth_delay_us', default_value='0'),
DeclareLaunchArgument('color_delay_us', default_value='0'),
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_enabled', default_value='false'),
DeclareLaunchArgument('trigger_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_output_enabled', default_value='false'),
]
# Node configuration
+2 -2
View File
@@ -69,8 +69,8 @@ def generate_launch_description():
DeclareLaunchArgument('depth_delay_us', default_value='0'),
DeclareLaunchArgument('color_delay_us', default_value='0'),
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_enabled', default_value='false'),
DeclareLaunchArgument('trigger_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_output_enabled', default_value='false'),
]
# Node configuration
+2 -2
View File
@@ -79,8 +79,8 @@ def generate_launch_description():
DeclareLaunchArgument('depth_delay_us', default_value='0'),
DeclareLaunchArgument('color_delay_us', default_value='0'),
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_signal_output_enabled', default_value='false'),
DeclareLaunchArgument('trigger_output_delay_us', default_value='0'),
DeclareLaunchArgument('trigger_output_enabled', default_value='false'),
]
# Node configuration
+4 -2
View File
@@ -17,7 +17,8 @@ def generate_launch_description():
launch_arguments={
'camera_name': 'camera_01',
'usb_port': '5-3.4.4.3',
'device_num': '2'
'device_num': '2',
'sync_mode': 'free_run'
}.items()
)
@@ -28,7 +29,8 @@ def generate_launch_description():
launch_arguments={
'camera_name': 'camera_02',
'usb_port': '5-3.4.4.1',
'device_num': '2'
'device_num': '2',
'sync_mode': 'free_run'
}.items()
)
@@ -3,6 +3,7 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0635", MODE:="066
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0638", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto-w"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0668", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto-live"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0669", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto-mega"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="066b", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto Bolt"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0636", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0637", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+s"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0536", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+_rgb"
@@ -85,8 +86,6 @@ SUBSYSTEM=="usb", ATTR{idProduct}=="0698", ATTR{idVendor}=="2bc5", MODE:="0666",
SUBSYSTEM=="usb", ATTR{idProduct}=="069c", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="TB2201"
SUBSYSTEM=="usb", ATTR{idProduct}=="06a0", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dcw2"
SUBSYSTEM=="usb", ATTR{idProduct}=="069f", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dw2"
SUBSYSTEM=="usb", ATTR{idProduct}=="069a", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_max"
SUBSYSTEM=="usb", ATTR{idProduct}=="065e", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_mini_s_pro"
+4 -4
View File
@@ -137,8 +137,8 @@ void OBCameraNode::setupDevices() {
sync_config.depthDelayUs = depth_delay_us_;
sync_config.colorDelayUs = color_delay_us_;
sync_config.trigger2ImageDelayUs = trigger2image_delay_us_;
sync_config.triggerSignalOutputDelayUs = trigger_signal_output_delay_us_;
sync_config.triggerSignalOutputEnable = trigger_signal_output_enabled_;
sync_config.triggerOutDelayUs = trigger_output_delay_us_;
sync_config.triggerOutEnable = trigger_output_enabled_;
device_->setMultiDeviceSyncConfig(sync_config);
}
if (info->pid() == GEMINI2_PID) {
@@ -435,8 +435,8 @@ void OBCameraNode::getParameters() {
setAndGetNodeParameter(depth_delay_us_, "depth_delay_us", 0);
setAndGetNodeParameter(color_delay_us_, "color_delay_us", 0);
setAndGetNodeParameter(trigger2image_delay_us_, "trigger2image_delay_us", 0);
setAndGetNodeParameter(trigger_signal_output_delay_us_, "trigger_signal_output_delay_us", 0);
setAndGetNodeParameter(trigger_signal_output_enabled_, "trigger_signal_output_enabled", false);
setAndGetNodeParameter(trigger_output_delay_us_, "trigger_output_delay_us", 0);
setAndGetNodeParameter(trigger_output_enabled_, "trigger_output_enabled", false);
setAndGetNodeParameter<std::string>(depth_precision_str_, "depth_precision", "1mm");
std::transform(sync_mode_str_.begin(), sync_mode_str_.end(), sync_mode_str_.begin(), ::toupper);
sync_mode_ = OBSyncModeFromString(sync_mode_str_);