From 50f97f5f4360fc19cae944b957f06e390baa9fef Mon Sep 17 00:00:00 2001 From: jdcast Date: Fri, 29 Mar 2024 17:21:14 -0400 Subject: [PATCH 1/8] Add optional_opencv_calibration_file as a yaml parameter --- zed_nodelets/src/zed_nodelet/include/zed_wrapper_nodelet.hpp | 1 + zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp | 4 ++++ zed_wrapper/params/common.yaml | 1 + 3 files changed, 6 insertions(+) diff --git a/zed_nodelets/src/zed_nodelet/include/zed_wrapper_nodelet.hpp b/zed_nodelets/src/zed_nodelet/include/zed_wrapper_nodelet.hpp index 8d1cb5af..ef34033b 100644 --- a/zed_nodelets/src/zed_nodelet/include/zed_wrapper_nodelet.hpp +++ b/zed_nodelets/src/zed_nodelet/include/zed_wrapper_nodelet.hpp @@ -652,6 +652,7 @@ class ZEDWrapperNodelet : public nodelet::Nodelet bool mCameraSelfCalib; bool mIsStatic = false; double mPosTrkMinDepth = 0.0; + std::string mOptionalOpencvCalibrationFile; // Flags bool mGrabActive = false; // Indicate if camera grabbing is active (at least one topic subscribed) diff --git a/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp b/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp index 30b0752b..e36398c1 100644 --- a/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp +++ b/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp @@ -268,6 +268,7 @@ void ZEDWrapperNodelet::onInit() mZedParams.open_timeout_sec = 10.0f; mZedParams.enable_image_enhancement = true; // Always active + mZedParams.optional_opencv_calibration_file = mOptionalOpencvCalibrationFile.c_str(); mDiagUpdater.add("ZED Diagnostic", this, &ZEDWrapperNodelet::callback_updateDiagnostic); mDiagUpdater.setHardwareID("ZED camera"); @@ -877,6 +878,9 @@ void ZEDWrapperNodelet::readGeneralParams() NODELET_INFO_STREAM(" * Camera Flip\t\t\t-> " << sl::toString(mCameraFlip).c_str()); mNhNs.getParam("general/self_calib", mCameraSelfCalib); NODELET_INFO_STREAM(" * Self calibration\t\t-> " << (mCameraSelfCalib ? "ENABLED" : "DISABLED")); + + mNhNs.getParam("general/optional_opencv_calibration_file", mOptionalOpencvCalibrationFile); + NODELET_INFO_STREAM(" * Calibration File\t\t-> " << mOptionalOpencvCalibrationFile); int tmp_sn = 0; mNhNs.getParam("general/serial_number", tmp_sn); diff --git a/zed_wrapper/params/common.yaml b/zed_wrapper/params/common.yaml index f2c752bb..6ab408b6 100644 --- a/zed_wrapper/params/common.yaml +++ b/zed_wrapper/params/common.yaml @@ -36,6 +36,7 @@ general: #region_of_interest: '[[0.25,0.33],[0.75,0.33],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.25,0.25],[0.75,0.25],[0.75,0.75],[0.25,0.75]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.5,0.25],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. + optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_warplab_tank_3_28_2024_cams-camchain-opencv.yaml' #video: From adf6a481da6e2313daa9965767a4b65c30c6ab98 Mon Sep 17 00:00:00 2001 From: jdcast Date: Fri, 29 Mar 2024 17:42:26 -0400 Subject: [PATCH 2/8] Disable self calibration on startup --- zed_wrapper/params/common.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zed_wrapper/params/common.yaml b/zed_wrapper/params/common.yaml index 6ab408b6..0fde20cf 100644 --- a/zed_wrapper/params/common.yaml +++ b/zed_wrapper/params/common.yaml @@ -26,7 +26,7 @@ general: base_frame: 'base_link' # must be equal to the frame_id used in the URDF file sdk_verbose: 1 # Set verbose level of the ZED SDK svo_compression: 2 # `0`: LOSSLESS, `1`: AVCHD, `2`: HEVC - self_calib: true # enable/disable self calibration at starting + self_calib: false # enable/disable self calibration at starting camera_flip: 'AUTO' # camera flip mode: 'OFF', 'ON', 'AUTO' pub_resolution: 'CUSTOM' # The resolution used for output. 'NATIVE' to use the same `general.grab_resolution` - `CUSTOM` to apply the `general.pub_downscale_factor` downscale factory to reduce bandwidth in transmission pub_downscale_factor: 2.0 # rescale factor used to rescale image before publishing when 'pub_resolution' is 'CUSTOM' From 2a2027efbaf85811aa50b69c234562282f3a1ad2 Mon Sep 17 00:00:00 2001 From: warpauv-orin4 Date: Fri, 29 Mar 2024 23:19:48 +0000 Subject: [PATCH 3/8] Try calibration file found online --- zed_wrapper/params/common.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zed_wrapper/params/common.yaml b/zed_wrapper/params/common.yaml index 0fde20cf..9e479758 100644 --- a/zed_wrapper/params/common.yaml +++ b/zed_wrapper/params/common.yaml @@ -36,7 +36,8 @@ general: #region_of_interest: '[[0.25,0.33],[0.75,0.33],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.25,0.25],[0.75,0.25],[0.75,0.75],[0.25,0.75]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.5,0.25],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. - optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_warplab_tank_3_28_2024_cams-camchain-opencv.yaml' + #optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_warplab_tank_3_28_2024_cams-camchain-opencv.yaml' + optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_sample_camchain-opencv.yaml' #video: From 2fb9c05f7a6cba5db1abff00038b7eeff8f57e55 Mon Sep 17 00:00:00 2001 From: jdcast Date: Mon, 1 Apr 2024 10:45:57 -0400 Subject: [PATCH 4/8] Change max depth --- zed_wrapper/params/common.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zed_wrapper/params/common.yaml b/zed_wrapper/params/common.yaml index 9e479758..cd2ea742 100644 --- a/zed_wrapper/params/common.yaml +++ b/zed_wrapper/params/common.yaml @@ -83,7 +83,7 @@ sensors: object_detection: od_enabled: false # True to enable Object Detection [not available for ZED] model: 'MULTI_CLASS_BOX_ACCURATE' # 'MULTI_CLASS_BOX_FAST', 'MULTI_CLASS_BOX_MEDIUM', 'MULTI_CLASS_BOX_ACCURATE', 'PERSON_HEAD_BOX_FAST', 'PERSON_HEAD_BOX_ACCURATE' - max_range: 15. # Maximum detection range + max_range: 5. # Maximum detection range allow_reduced_precision_inference: true # Allow inference to run at a lower precision to improve runtime and memory usage prediction_timeout: 0.5 # During this time [sec], the object will have OK state even if it is not detected. Set this parameter to 0 to disable SDK predictions object_tracking_enabled: true # Enable/disable the tracking of the detected objects From 482cd3b00249d2928b8ad403d3b60e407340c355 Mon Sep 17 00:00:00 2001 From: warpauv-orin4 Date: Mon, 1 Apr 2024 21:33:25 +0000 Subject: [PATCH 5/8] Reduce max depth; Try updated calibration file --- zed_wrapper/params/common.yaml | 6 +++--- zed_wrapper/params/zedxm.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zed_wrapper/params/common.yaml b/zed_wrapper/params/common.yaml index cd2ea742..00f9d772 100644 --- a/zed_wrapper/params/common.yaml +++ b/zed_wrapper/params/common.yaml @@ -36,8 +36,8 @@ general: #region_of_interest: '[[0.25,0.33],[0.75,0.33],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.25,0.25],[0.75,0.25],[0.75,0.75],[0.25,0.75]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.5,0.25],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. - #optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_warplab_tank_3_28_2024_cams-camchain-opencv.yaml' - optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_sample_camchain-opencv.yaml' + optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_warplab_tank_3_28_2024_cams-camchain-opencv_mod.yaml' + #optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_sample_camchain-opencv.yaml' #video: @@ -83,7 +83,7 @@ sensors: object_detection: od_enabled: false # True to enable Object Detection [not available for ZED] model: 'MULTI_CLASS_BOX_ACCURATE' # 'MULTI_CLASS_BOX_FAST', 'MULTI_CLASS_BOX_MEDIUM', 'MULTI_CLASS_BOX_ACCURATE', 'PERSON_HEAD_BOX_FAST', 'PERSON_HEAD_BOX_ACCURATE' - max_range: 5. # Maximum detection range + max_range: 15. # Maximum detection range allow_reduced_precision_inference: true # Allow inference to run at a lower precision to improve runtime and memory usage prediction_timeout: 0.5 # During this time [sec], the object will have OK state even if it is not detected. Set this parameter to 0 to disable SDK predictions object_tracking_enabled: true # Enable/disable the tracking of the detected objects diff --git a/zed_wrapper/params/zedxm.yaml b/zed_wrapper/params/zedxm.yaml index f3e91fac..3ee930ee 100644 --- a/zed_wrapper/params/zedxm.yaml +++ b/zed_wrapper/params/zedxm.yaml @@ -9,4 +9,4 @@ general: depth: min_depth: 0.1 # Min: 0.1, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory - max_depth: 15.0 # Max: 40.0 + max_depth: 3.0 # Max: 40.0 From 6ea5f10ea5055de0a2c5fd3daec45f5a822f25cc Mon Sep 17 00:00:00 2001 From: warpauv-orin4 Date: Mon, 22 Apr 2024 21:39:30 +0000 Subject: [PATCH 6/8] Use better string handling for opencv_calibration_file parameter --- zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp b/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp index e36398c1..7435f935 100644 --- a/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp +++ b/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp @@ -268,7 +268,8 @@ void ZEDWrapperNodelet::onInit() mZedParams.open_timeout_sec = 10.0f; mZedParams.enable_image_enhancement = true; // Always active - mZedParams.optional_opencv_calibration_file = mOptionalOpencvCalibrationFile.c_str(); + sl::String optional_opencv_calibration_file(mOptionalOpencvCalibrationFile.c_str()); + mZedParams.optional_opencv_calibration_file = optional_opencv_calibration_file; mDiagUpdater.add("ZED Diagnostic", this, &ZEDWrapperNodelet::callback_updateDiagnostic); mDiagUpdater.setHardwareID("ZED camera"); From eade89e7ff3c4e4a09b0494989644ebc94d7fb8f Mon Sep 17 00:00:00 2001 From: warpauv-orin4 Date: Tue, 23 Apr 2024 19:21:03 +0000 Subject: [PATCH 7/8] Ready changes for PR to stereolabs --- zed_wrapper/params/common.yaml | 5 ++--- zed_wrapper/params/zedxm.yaml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/zed_wrapper/params/common.yaml b/zed_wrapper/params/common.yaml index 00f9d772..ea9607c2 100644 --- a/zed_wrapper/params/common.yaml +++ b/zed_wrapper/params/common.yaml @@ -26,7 +26,7 @@ general: base_frame: 'base_link' # must be equal to the frame_id used in the URDF file sdk_verbose: 1 # Set verbose level of the ZED SDK svo_compression: 2 # `0`: LOSSLESS, `1`: AVCHD, `2`: HEVC - self_calib: false # enable/disable self calibration at starting + self_calib: true # enable/disable self calibration at starting camera_flip: 'AUTO' # camera flip mode: 'OFF', 'ON', 'AUTO' pub_resolution: 'CUSTOM' # The resolution used for output. 'NATIVE' to use the same `general.grab_resolution` - `CUSTOM` to apply the `general.pub_downscale_factor` downscale factory to reduce bandwidth in transmission pub_downscale_factor: 2.0 # rescale factor used to rescale image before publishing when 'pub_resolution' is 'CUSTOM' @@ -36,8 +36,7 @@ general: #region_of_interest: '[[0.25,0.33],[0.75,0.33],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.25,0.25],[0.75,0.25],[0.75,0.75],[0.25,0.75]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. #region_of_interest: '[[0.5,0.25],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent. - optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_warplab_tank_3_28_2024_cams-camchain-opencv_mod.yaml' - #optional_opencv_calibration_file: '/home/warp/Downloads/zedxm_sample_camchain-opencv.yaml' + optional_opencv_calibration_file: '' #video: diff --git a/zed_wrapper/params/zedxm.yaml b/zed_wrapper/params/zedxm.yaml index 3ee930ee..f3e91fac 100644 --- a/zed_wrapper/params/zedxm.yaml +++ b/zed_wrapper/params/zedxm.yaml @@ -9,4 +9,4 @@ general: depth: min_depth: 0.1 # Min: 0.1, Max: 3.0 - Default 0.7 - Note: reducing this value wil require more computational power and GPU memory - max_depth: 3.0 # Max: 40.0 + max_depth: 15.0 # Max: 40.0 From 5366f20246ee0b04fd4f0bbf1ad201a0ab418833 Mon Sep 17 00:00:00 2001 From: warpauv-orin4 Date: Tue, 23 Apr 2024 20:13:28 +0000 Subject: [PATCH 8/8] Add calibration file, self calibration flag, min depth and max depth as launch parameters for zedxm --- zed_wrapper/launch/include/zed_camera.launch.xml | 16 ++++++++++++++++ zed_wrapper/launch/zedxm.launch | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/zed_wrapper/launch/include/zed_camera.launch.xml b/zed_wrapper/launch/include/zed_camera.launch.xml index 9a50e661..d70b0e08 100644 --- a/zed_wrapper/launch/include/zed_camera.launch.xml +++ b/zed_wrapper/launch/include/zed_camera.launch.xml @@ -46,6 +46,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + + + + + + + + + + + + + diff --git a/zed_wrapper/launch/zedxm.launch b/zed_wrapper/launch/zedxm.launch index adcc9e63..9f783649 100644 --- a/zed_wrapper/launch/zedxm.launch +++ b/zed_wrapper/launch/zedxm.launch @@ -35,6 +35,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + + @@ -52,6 +57,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +