mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 11:10:19 +08:00
Add enable_accel_data_correction and enable_gyro_data_correction parameters in gemini_330_series.launch.py
This commit is contained in:
@@ -580,6 +580,8 @@ class OBCameraNode {
|
||||
double angular_vel_cov_ = 0.0001;
|
||||
std::deque<IMUData> imu_history_;
|
||||
IMUData accel_data_{ACCEL, {0, 0, 0}, -1.0};
|
||||
bool enable_accel_data_correction_ = true;
|
||||
bool enable_gyro_data_correction_ = true;
|
||||
// mjpeg decoder
|
||||
std::shared_ptr<JPEGDecoder> jpeg_decoder_ = nullptr;
|
||||
uint8_t* rgb_buffer_ = nullptr;
|
||||
|
||||
@@ -132,9 +132,11 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('ir_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('enable_accel_data_correction', default_value='true'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('enable_gyro_data_correction', default_value='true'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
|
||||
@@ -672,6 +672,18 @@ void OBCameraNode::setupDevices() {
|
||||
RCLCPP_INFO_STREAM(logger_,
|
||||
"Exporting config json file path : " << export_config_json_file_path_);
|
||||
}
|
||||
if (device_->isPropertySupported(OB_PROP_SDK_ACCEL_FRAME_TRANSFORMED_BOOL, OB_PERMISSION_WRITE)) {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting accel data correction to "
|
||||
<< (enable_accel_data_correction_ ? "ON" : "OFF"));
|
||||
TRY_TO_SET_PROPERTY(setBoolProperty, OB_PROP_SDK_ACCEL_FRAME_TRANSFORMED_BOOL,
|
||||
enable_accel_data_correction_);
|
||||
}
|
||||
if (device_->isPropertySupported(OB_PROP_SDK_GYRO_FRAME_TRANSFORMED_BOOL, OB_PERMISSION_WRITE)) {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting gyro data correction to "
|
||||
<< (enable_gyro_data_correction_ ? "ON" : "OFF"));
|
||||
TRY_TO_SET_PROPERTY(setBoolProperty, OB_PROP_SDK_GYRO_FRAME_TRANSFORMED_BOOL,
|
||||
enable_gyro_data_correction_);
|
||||
}
|
||||
}
|
||||
void OBCameraNode::setupColorPostProcessFilter() {
|
||||
auto color_sensor = device_->getSensor(OB_SENSOR_COLOR);
|
||||
@@ -1631,6 +1643,8 @@ void OBCameraNode::getParameters() {
|
||||
"");
|
||||
setAndGetNodeParameter<std::string>(export_config_json_file_path_, "export_config_json_file_path",
|
||||
"");
|
||||
setAndGetNodeParameter<bool>(enable_accel_data_correction_, "enable_accel_data_correction", true);
|
||||
setAndGetNodeParameter<bool>(enable_gyro_data_correction_, "enable_gyro_data_correction", true);
|
||||
auto device_info = device_->getDeviceInfo();
|
||||
CHECK_NOTNULL(device_info.get());
|
||||
auto pid = device_info->getPid();
|
||||
|
||||
Reference in New Issue
Block a user