From 3651d8409f0a4de35b9905e515b993cb795b18e7 Mon Sep 17 00:00:00 2001 From: n-kai-cj Date: Sun, 6 Dec 2020 15:41:58 +0900 Subject: [PATCH 1/6] Upgrade librealsense2 to 2.40.0 --- librealsense2/cppbuild.sh | 2 +- librealsense2/platform/pom.xml | 2 +- librealsense2/pom.xml | 2 +- .../librealsense2/global/realsense2.java | 248 ++++++++++++------ .../librealsense2/rs2_intrinsics.java | 2 +- .../librealsense2/presets/realsense2.java | 2 +- 6 files changed, 166 insertions(+), 92 deletions(-) diff --git a/librealsense2/cppbuild.sh b/librealsense2/cppbuild.sh index f43e5786ffb..97bfffaded1 100755 --- a/librealsense2/cppbuild.sh +++ b/librealsense2/cppbuild.sh @@ -7,7 +7,7 @@ if [[ -z "$PLATFORM" ]]; then exit fi -LIBREALSENSE2_VERSION=2.38.1 +LIBREALSENSE2_VERSION=2.40.0 LIBUSB_VERSION=1.0.22 download https://github.com/IntelRealSense/librealsense/archive/v$LIBREALSENSE2_VERSION.tar.gz librealsense-$LIBREALSENSE2_VERSION.tar.gz download http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-$LIBUSB_VERSION/libusb-$LIBUSB_VERSION.tar.bz2/download libusb-$LIBUSB_VERSION.tar.bz2 diff --git a/librealsense2/platform/pom.xml b/librealsense2/platform/pom.xml index 89d66bc95f3..a4db1037551 100644 --- a/librealsense2/platform/pom.xml +++ b/librealsense2/platform/pom.xml @@ -12,7 +12,7 @@ org.bytedeco librealsense2-platform - 2.38.1-${project.parent.version} + 2.40.0-${project.parent.version} JavaCPP Presets Platform for librealsense2 diff --git a/librealsense2/pom.xml b/librealsense2/pom.xml index 6fb82257aa2..bdfcd367397 100644 --- a/librealsense2/pom.xml +++ b/librealsense2/pom.xml @@ -11,7 +11,7 @@ org.bytedeco librealsense2 - 2.38.1-${project.parent.version} + 2.40.0-${project.parent.version} JavaCPP Presets for librealsense2 diff --git a/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java b/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java index 0673d9bba79..0dfd0a6143a 100644 --- a/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java +++ b/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java @@ -90,10 +90,10 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { /** Number of enumeration values. Not a valid input: intended to be used in for-loops. */ RS2_DISTORTION_COUNT = 6; public static native @Cast("const char*") BytePointer rs2_distortion_to_string(@Cast("rs2_distortion") int distortion); -// Targeting ../rs2_intrinsics.java +// Targeting ..\rs2_intrinsics.java -// Targeting ../rs2_dsm_params.java +// Targeting ..\rs2_dsm_params.java @@ -106,22 +106,22 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { /** Thermal-over-aging; aging-induced error changes alongside temperature */ RS2_DSM_CORRECTION_TOA = 2, RS2_DSM_CORRECTION_COUNT = 3; -// Targeting ../rs2_motion_device_intrinsic.java +// Targeting ..\rs2_motion_device_intrinsic.java -// Targeting ../rs2_vertex.java +// Targeting ..\rs2_vertex.java -// Targeting ../rs2_pixel.java +// Targeting ..\rs2_pixel.java -// Targeting ../rs2_vector.java +// Targeting ..\rs2_vector.java -// Targeting ../rs2_quaternion.java +// Targeting ..\rs2_quaternion.java -// Targeting ../rs2_pose.java +// Targeting ..\rs2_pose.java @@ -200,7 +200,10 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { RS2_EXTENSION_AUTO_CALIBRATION_FILTER = 48, RS2_EXTENSION_DEVICE_CALIBRATION = 49, RS2_EXTENSION_CALIBRATED_SENSOR = 50, - RS2_EXTENSION_COUNT = 51; + RS2_EXTENSION_HDR_MERGE = 51, + RS2_EXTENSION_SEQUENCE_ID_FILTER = 52, + RS2_EXTENSION_MAX_USABLE_RANGE_SENSOR = 53, + RS2_EXTENSION_COUNT = 54; public static native @Cast("const char*") BytePointer rs2_extension_type_to_string(@Cast("rs2_extension") int type); public static native @Cast("const char*") BytePointer rs2_extension_to_string(@Cast("rs2_extension") int type); @@ -229,133 +232,133 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { RS2_MATCHER_DEFAULT = 6, //the default matcher compare all the streams based on closest timestamp RS2_MATCHER_COUNT = 7; -// Targeting ../rs2_device_info.java +// Targeting ..\rs2_device_info.java -// Targeting ../rs2_device.java +// Targeting ..\rs2_device.java -// Targeting ../rs2_error.java +// Targeting ..\rs2_error.java -// Targeting ../rs2_log_message.java +// Targeting ..\rs2_log_message.java -// Targeting ../rs2_raw_data_buffer.java +// Targeting ..\rs2_raw_data_buffer.java -// Targeting ../rs2_frame.java +// Targeting ..\rs2_frame.java -// Targeting ../rs2_frame_queue.java +// Targeting ..\rs2_frame_queue.java -// Targeting ../rs2_pipeline.java +// Targeting ..\rs2_pipeline.java -// Targeting ../rs2_pipeline_profile.java +// Targeting ..\rs2_pipeline_profile.java -// Targeting ../rs2_config.java +// Targeting ..\rs2_config.java -// Targeting ../rs2_device_list.java +// Targeting ..\rs2_device_list.java -// Targeting ../rs2_stream_profile_list.java +// Targeting ..\rs2_stream_profile_list.java -// Targeting ../rs2_processing_block_list.java +// Targeting ..\rs2_processing_block_list.java -// Targeting ../rs2_stream_profile.java +// Targeting ..\rs2_stream_profile.java -// Targeting ../rs2_frame_callback.java +// Targeting ..\rs2_frame_callback.java -// Targeting ../rs2_log_callback.java +// Targeting ..\rs2_log_callback.java -// Targeting ../rs2_syncer.java +// Targeting ..\rs2_syncer.java -// Targeting ../rs2_device_serializer.java +// Targeting ..\rs2_device_serializer.java -// Targeting ../rs2_source.java +// Targeting ..\rs2_source.java -// Targeting ../rs2_processing_block.java +// Targeting ..\rs2_processing_block.java -// Targeting ../rs2_frame_processor_callback.java +// Targeting ..\rs2_frame_processor_callback.java -// Targeting ../rs2_playback_status_changed_callback.java +// Targeting ..\rs2_playback_status_changed_callback.java -// Targeting ../rs2_update_progress_callback.java +// Targeting ..\rs2_update_progress_callback.java -// Targeting ../rs2_context.java +// Targeting ..\rs2_context.java -// Targeting ../rs2_device_hub.java +// Targeting ..\rs2_device_hub.java -// Targeting ../rs2_sensor_list.java +// Targeting ..\rs2_sensor_list.java -// Targeting ../rs2_sensor.java +// Targeting ..\rs2_sensor.java -// Targeting ../rs2_options.java +// Targeting ..\rs2_options.java -// Targeting ../rs2_options_list.java +// Targeting ..\rs2_options_list.java -// Targeting ../rs2_devices_changed_callback.java +// Targeting ..\rs2_devices_changed_callback.java -// Targeting ../rs2_notification.java +// Targeting ..\rs2_notification.java -// Targeting ../rs2_notifications_callback.java +// Targeting ..\rs2_notifications_callback.java -// Targeting ../rs2_firmware_log_message.java +// Targeting ..\rs2_firmware_log_message.java -// Targeting ../rs2_firmware_log_parsed_message.java +// Targeting ..\rs2_firmware_log_parsed_message.java -// Targeting ../rs2_firmware_log_parser.java +// Targeting ..\rs2_firmware_log_parser.java -// Targeting ../rs2_terminal_parser.java +// Targeting ..\rs2_terminal_parser.java -// Targeting ../rs2_log_callback_ptr.java +// Targeting ..\rs2_log_callback_ptr.java -// Targeting ../rs2_notification_callback_ptr.java +// Targeting ..\rs2_notification_callback_ptr.java -// Targeting ../rs2_software_device_destruction_callback_ptr.java +// Targeting ..\rs2_software_device_destruction_callback_ptr.java -// Targeting ../rs2_devices_changed_callback_ptr.java +// Targeting ..\rs2_devices_changed_callback_ptr.java -// Targeting ../rs2_frame_callback_ptr.java +// Targeting ..\rs2_frame_callback_ptr.java -// Targeting ../rs2_frame_processor_callback_ptr.java +// Targeting ..\rs2_frame_processor_callback_ptr.java -// Targeting ../rs2_update_progress_callback_ptr.java +// Targeting ..\rs2_update_progress_callback_ptr.java @@ -437,7 +440,7 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { public static native rs2_device rs2_context_add_device(rs2_context ctx, @Cast("const char*") BytePointer file, @Cast("rs2_error**") PointerPointer error); public static native rs2_device rs2_context_add_device(rs2_context ctx, @Cast("const char*") BytePointer file, @ByPtrPtr rs2_error error); public static native rs2_device rs2_context_add_device(rs2_context ctx, String file, @ByPtrPtr rs2_error error); - + /** * Add an instance of software device to the context * @param ctx The context to which the new device will be added @@ -459,9 +462,9 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { /** * Removes tracking module. - * function query_devices() locks the tracking module in the tm_context object. + * function query_devices() locks the tracking module in the tm_context object. * If the tracking module device is not used it should be removed using this function, so that other applications could find it. - * This function can be used both before the call to query_device() to prevent enabling tracking modules or afterwards to + * This function can be used both before the call to query_device() to prevent enabling tracking modules or afterwards to * release them. */ public static native void rs2_context_unload_tracking_module(rs2_context ctx, @Cast("rs2_error**") PointerPointer error); @@ -705,7 +708,7 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { public static native void rs2_disconnect_tm2_controller(@Const rs2_device device, int id, @ByPtrPtr rs2_error error); -/** +/** * Reset device to factory calibration * @param device [in] The RealSense device * @param error [out] If non-null, receives any error that occurs during this call, otherwise, errors are ignored @@ -918,10 +921,10 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { RS2_CALIBRATION_STATUS_LAST = 4, RS2_CALIBRATION_STATUS_COUNT = RS2_CALIBRATION_STATUS_LAST - RS2_CALIBRATION_STATUS_FIRST + 1; public static native @Cast("const char*") BytePointer rs2_calibration_status_to_string( @Cast("rs2_calibration_status") int arg0 ); -// Targeting ../rs2_calibration_change_callback.java +// Targeting ..\rs2_calibration_change_callback.java -// Targeting ../rs2_calibration_change_callback_ptr.java +// Targeting ..\rs2_calibration_change_callback_ptr.java @@ -1107,7 +1110,13 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { RS2_FRAME_METADATA_RAW_FRAME_SIZE = 31, /** GPIO input data */ RS2_FRAME_METADATA_GPIO_INPUT_DATA = 32, - RS2_FRAME_METADATA_COUNT = 33; + /** sub-preset id */ + RS2_FRAME_METADATA_SEQUENCE_NAME = 33, + /** sub-preset sequence id */ + RS2_FRAME_METADATA_SEQUENCE_ID = 34, + /** sub-preset sequence size */ + RS2_FRAME_METADATA_SEQUENCE_SIZE = 35, + RS2_FRAME_METADATA_COUNT = 36; public static native @Cast("const char*") BytePointer rs2_frame_metadata_to_string(@Cast("rs2_frame_metadata_value") int metadata); public static native @Cast("const char*") BytePointer rs2_frame_metadata_value_to_string(@Cast("rs2_frame_metadata_value") int metadata); @@ -1538,7 +1547,7 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so RS2_OPTION_ZERO_ORDER_POINT_X = 47, /** Zero order point y*/ RS2_OPTION_ZERO_ORDER_POINT_Y = 48, - /** LLD temperature*/ + /** LDD temperature*/ RS2_OPTION_LLD_TEMPERATURE = 49, /** MC temperature*/ RS2_OPTION_MC_TEMPERATURE = 50, @@ -1578,19 +1587,41 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so RS2_OPTION_NOISE_FILTERING = 67, /** Enable\disable pixel invalidation */ RS2_OPTION_INVALIDATION_BYPASS = 68, - /** Change the depth ambient light see rs2_ambient_light for values */ + /** DEPRECATED! - Use RS2_OPTION_DIGITAL_GAIN instead. */ RS2_OPTION_AMBIENT_LIGHT = 69, + /** Change the depth digital gain see rs2_digital_gain for values */ + RS2_OPTION_DIGITAL_GAIN = RS2_OPTION_AMBIENT_LIGHT, /** The resolution mode: see rs2_sensor_mode for values */ - RS2_OPTION_SENSOR_MODE = 70, + RS2_OPTION_SENSOR_MODE = RS2_OPTION_AMBIENT_LIGHT + 1, /** Enable Laser On constantly (GS SKU Only) */ - RS2_OPTION_EMITTER_ALWAYS_ON = 71, + RS2_OPTION_EMITTER_ALWAYS_ON = RS2_OPTION_AMBIENT_LIGHT + 2, /** Depth Thermal Compensation for selected D400 SKUs */ - RS2_OPTION_THERMAL_COMPENSATION = 72, + RS2_OPTION_THERMAL_COMPENSATION = RS2_OPTION_AMBIENT_LIGHT + 3, /** Enable depth & color frame sync with periodic calibration for proper alignment */ - RS2_OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH = 73, - RS2_OPTION_RESET_CAMERA_ACCURACY_HEALTH = 74, + RS2_OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH = RS2_OPTION_AMBIENT_LIGHT + 4, + RS2_OPTION_RESET_CAMERA_ACCURACY_HEALTH = RS2_OPTION_AMBIENT_LIGHT + 5, + /** Set host performance mode to optimize device settings so host can keep up with workload, for example, USB transaction granularity, setting option to low performance host leads to larger USB transaction size and reduced number of transactions which improves performance and stability if host is relatively weak as compared to workload */ + RS2_OPTION_HOST_PERFORMANCE = RS2_OPTION_AMBIENT_LIGHT + 6, + /** Enable / disable HDR */ + RS2_OPTION_HDR_ENABLED = RS2_OPTION_AMBIENT_LIGHT + 7, + /** HDR Sequence name */ + RS2_OPTION_SEQUENCE_NAME = RS2_OPTION_AMBIENT_LIGHT + 8, + /** HDR Sequence size */ + RS2_OPTION_SEQUENCE_SIZE = RS2_OPTION_AMBIENT_LIGHT + 9, + /** HDR Sequence ID - 0 is not HDR; sequence ID for HDR configuration starts from 1 */ + RS2_OPTION_SEQUENCE_ID = RS2_OPTION_AMBIENT_LIGHT + 10, + /** Humidity temperature [Deg Celsius]*/ + RS2_OPTION_HUMIDITY_TEMPERATURE = RS2_OPTION_AMBIENT_LIGHT + 11, + /** Turn on/off the maximum usable depth sensor range given the amount of ambient light in the scene */ + RS2_OPTION_ENABLE_MAX_USABLE_RANGE = RS2_OPTION_AMBIENT_LIGHT + 12, + /** Turn on/off the alternate IR, When enabling alternate IR, the IR image is holding the amplitude of the depth correlation. */ + RS2_OPTION_ALTERNATE_IR = RS2_OPTION_AMBIENT_LIGHT + 13, + /** Noise estimation - indicates the noise on the IR image */ + RS2_OPTION_NOISE_ESTIMATION = RS2_OPTION_AMBIENT_LIGHT + 14, + /** Enables data collection for calculating IR pixel reflectivity */ + RS2_OPTION_ENABLE_IR_REFLECTIVITY = RS2_OPTION_AMBIENT_LIGHT + 15, /** Number of enumeration values. Not a valid input: intended to be used in for-loops. */ - RS2_OPTION_COUNT = 75; + RS2_OPTION_COUNT = RS2_OPTION_AMBIENT_LIGHT + 16; // This function is being deprecated. For existing options it will return option name, but for future API additions the user should call rs2_get_option_name instead. public static native @Cast("const char*") BytePointer rs2_option_to_string(@Cast("rs2_option") int option); @@ -1661,13 +1692,20 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so RS2_SENSOR_MODE_COUNT = 3; public static native @Cast("const char*") BytePointer rs2_sensor_mode_to_string(@Cast("rs2_sensor_mode") int preset); - /** \brief ambient light for RS2_OPTION_AMBIENT_LIGHT option. */ + /** \brief DEPRECATED! - Use RS2_OPTION_DIGITAL_GAIN instead. */ /** enum rs2_ambient_light */ public static final int RS2_AMBIENT_LIGHT_NO_AMBIENT = 1, RS2_AMBIENT_LIGHT_LOW_AMBIENT = 2; + /** \brief digital gain for RS2_OPTION_DIGITAL_GAIN option. */ + /** enum rs2_digital_gain */ + public static final int + RS2_DIGITAL_GAIN_HIGH = 1, + RS2_DIGITAL_GAIN_LOW = 2; + + /** \brief values for RS2_OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH option. */ /** enum rs2_cah_trigger */ public static final int @@ -1681,6 +1719,19 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so RS2_CAH_TRIGGER_COUNT = 3; + /** \brief values for RS2_OPTION_HOST_PERFORMANCE option. */ + /** enum rs2_host_perf_mode */ + public static final int + /** no change in settings, use device defaults */ + RS2_HOST_PERF_DEFAULT = 0, + /** low performance host mode, if host cannot keep up with workload, this option may improve stability, for example, it sets larger USB transaction granularity, reduces number of transactions and improve performance and stability on relatively weak hosts as compared to the workload */ + RS2_HOST_PERF_LOW = 1, + /** high performance host mode, if host is strong as compared to the work and can handle workload without delay, this option sets smaller USB transactions granularity and as result larger number of transactions and workload on host, but reduces chance in device frame drops */ + RS2_HOST_PERF_HIGH = 2, + /** Number of enumeration values. Not a valid input: intended to be used in for-loops. */ + RS2_HOST_PERF_COUNT = 3; + public static native @Cast("const char*") BytePointer rs2_host_perf_mode_to_string( @Cast("rs2_host_perf_mode") int perf ); + /** * check if an option is read-only * @param options [in] the options container @@ -2082,6 +2133,22 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so public static native rs2_processing_block rs2_create_huffman_depth_decompress_block(@Cast("rs2_error**") PointerPointer error); public static native rs2_processing_block rs2_create_huffman_depth_decompress_block(@ByPtrPtr rs2_error error); +/** +* Creates a hdr_merge processing block. +* The block merges between two depth frames with different exposure values +* @param error [out] if non-null, receives any error that occurs during this call, otherwise, errors are ignored +*/ +public static native rs2_processing_block rs2_create_hdr_merge_processing_block(@Cast("rs2_error**") PointerPointer error); +public static native rs2_processing_block rs2_create_hdr_merge_processing_block(@ByPtrPtr rs2_error error); + +/** +* Creates a sequence_id_filter processing block. +* The block lets frames with the selected sequence id pass and blocks frames with other values +* @param error [out] if non-null, receives any error that occurs during this call, otherwise, errors are ignored +*/ +public static native rs2_processing_block rs2_create_sequence_id_filter(@Cast("rs2_error**") PointerPointer error); +public static native rs2_processing_block rs2_create_sequence_id_filter(@ByPtrPtr rs2_error error); + /** * Retrieve processing block specific information, like name. * @param block [in] The processing block @@ -2149,7 +2216,7 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so RS2_PLAYBACK_STATUS_COUNT = 4; public static native @Cast("const char*") BytePointer rs2_playback_status_to_string(@Cast("rs2_playback_status") int status); -// Targeting ../rs2_playback_status_changed_callback_ptr.java +// Targeting ..\rs2_playback_status_changed_callback_ptr.java @@ -2479,7 +2546,7 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so /** Number of enumeration values. Not a valid input: intended to be used in for-loops. */ RS2_FORMAT_COUNT = 29; public static native @Cast("const char*") BytePointer rs2_format_to_string(@Cast("rs2_format") int format); -// Targeting ../rs2_extrinsics.java +// Targeting ..\rs2_extrinsics.java @@ -2920,7 +2987,7 @@ public static native void rs2_register_extrinsics(@Const rs2_stream_profile from public static native void rs2_get_video_stream_intrinsics(@Const rs2_stream_profile mode, rs2_intrinsics intrinsics, @ByPtrPtr rs2_error error); /** - * Returns the list of recommended processing blocks for a specific sensor. + * Returns the list of recommended processing blocks for a specific sensor. * Order and configuration of the blocks are decided by the sensor * @param sensor [in] input sensor * @param error [out] if non-null, receives any error that occurs during this call, otherwise, errors are ignored @@ -3108,6 +3175,13 @@ public static native int rs2_send_wheel_odometry(@Const rs2_sensor sensor, @Cast public static native void rs2_set_motion_device_intrinsics(@Const rs2_sensor sensor, @Const rs2_stream_profile profile, @Const rs2_motion_device_intrinsic intrinsics, @Cast("rs2_error**") PointerPointer error); public static native void rs2_set_motion_device_intrinsics(@Const rs2_sensor sensor, @Const rs2_stream_profile profile, @Const rs2_motion_device_intrinsic intrinsics, @ByPtrPtr rs2_error error); +/** When called on a depth sensor, this method will return the maximum range of the camera given the amount of ambient light in the scene +* @param sensor [in] depth sensor +* @param error [out] if non-null, receives any error that occurs during this call, otherwise, errors are ignored +* @return the max usable range in meters +*/ +public static native float rs2_get_max_usable_depth_range(@Const rs2_sensor sensor, @Cast("rs2_error**") PointerPointer error); +public static native float rs2_get_max_usable_depth_range(@Const rs2_sensor sensor, @ByPtrPtr rs2_error error); // #ifdef __cplusplus // #endif @@ -3500,7 +3574,7 @@ public static native void rs2_config_enable_stream(rs2_config config, * Start the pipeline streaming with its default configuration. * The pipeline captures samples from the device, and delivers them to the through the provided frame callback. * Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised. - * When starting the pipeline with a callback both \c wait_for_frames() or \c poll_for_frames() will throw exception. + * When starting the pipeline with a callback both \c wait_for_frames() or \c poll_for_frames() will throw exception. * * @param pipe [in] A pointer to an instance of the pipeline * @param callback [in] callback object created from c++ application. ownership over the callback object is moved into the relevant streaming lock @@ -3616,43 +3690,43 @@ public static native void rs2_config_enable_stream(rs2_config config, // #define RS2_ADVANCED_MODE_COMMAND_H // #include -// Targeting ../STDepthControlGroup.java +// Targeting ..\STDepthControlGroup.java -// Targeting ../STRsm.java +// Targeting ..\STRsm.java -// Targeting ../STRauSupportVectorControl.java +// Targeting ..\STRauSupportVectorControl.java -// Targeting ../STColorControl.java +// Targeting ..\STColorControl.java -// Targeting ../STRauColorThresholdsControl.java +// Targeting ..\STRauColorThresholdsControl.java -// Targeting ../STSloColorThresholdsControl.java +// Targeting ..\STSloColorThresholdsControl.java -// Targeting ../STSloPenaltyControl.java +// Targeting ..\STSloPenaltyControl.java -// Targeting ../STHdad.java +// Targeting ..\STHdad.java -// Targeting ../STColorCorrection.java +// Targeting ..\STColorCorrection.java -// Targeting ../STAEControl.java +// Targeting ..\STAEControl.java -// Targeting ../STDepthTableControl.java +// Targeting ..\STDepthTableControl.java -// Targeting ../STCensusRadius.java +// Targeting ..\STCensusRadius.java -// Targeting ../STAFactor.java +// Targeting ..\STAFactor.java @@ -3692,8 +3766,8 @@ public static native void rs2_config_enable_stream(rs2_config config, // #include "h/rs_sensor.h" public static final int RS2_API_MAJOR_VERSION = 2; -public static final int RS2_API_MINOR_VERSION = 38; -public static final int RS2_API_PATCH_VERSION = 1; +public static final int RS2_API_MINOR_VERSION = 40; +public static final int RS2_API_PATCH_VERSION = 0; public static final int RS2_API_BUILD_VERSION = 0; // #ifndef STRINGIFY diff --git a/librealsense2/src/gen/java/org/bytedeco/librealsense2/rs2_intrinsics.java b/librealsense2/src/gen/java/org/bytedeco/librealsense2/rs2_intrinsics.java index 395e258e710..954511c76ba 100644 --- a/librealsense2/src/gen/java/org/bytedeco/librealsense2/rs2_intrinsics.java +++ b/librealsense2/src/gen/java/org/bytedeco/librealsense2/rs2_intrinsics.java @@ -44,7 +44,7 @@ public class rs2_intrinsics extends Pointer { public native float fy(); public native rs2_intrinsics fy(float setter); /** Distortion model of the image */ public native @Cast("rs2_distortion") int model(); public native rs2_intrinsics model(int setter); - /** Distortion coefficients */ + /** Distortion coefficients. Order for Brown-Conrady: [k1, k2, p1, p2, k3]. Order for F-Theta Fish-eye: [k1, k2, k3, k4, 0]. Other models are subject to their own interpretations */ public native float coeffs(int i); public native rs2_intrinsics coeffs(int i, float setter); @MemberGetter public native FloatPointer coeffs(); } diff --git a/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java b/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java index b90c397ba9d..32c826f53f1 100644 --- a/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java +++ b/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java @@ -70,6 +70,6 @@ public void map(InfoMap infoMap) { infoMap.put(new Info("rs2_camera_info", "rs2_stream").cast().valueTypes("int").pointerTypes("IntPointer", "IntBuffer", "int[]")) .put(new Info("RS2_API_VERSION_STR").cppTypes("const char*").pointerTypes("String").translate(false)) .put(new Info("RS2_API_FULL_VERSION_STR").cppTypes("const char*").pointerTypes("String").translate(false)) - .put(new Info("rs2_create_playback_device", "rs2_cah_trigger_to_string", "rs2_ambient_light_to_string").skip()); + .put(new Info("rs2_create_playback_device", "rs2_cah_trigger_to_string", "rs2_ambient_light_to_string", "rs2_digital_gain_to_string").skip()); } } From c23e74df4958c0ac178e32f495d27504d98b903b Mon Sep 17 00:00:00 2001 From: n-kai-cj Date: Sun, 6 Dec 2020 17:16:53 +0900 Subject: [PATCH 2/6] add librealsense2 capture and display samples --- librealsense2/README.md | 4 +- librealsense2/samples/display/.gitignore | 19 ++ librealsense2/samples/display/OpenCVFX.java | 211 ++++++++++++++++ .../samples/display/RealSense2Show.java | 227 ++++++++++++++++++ librealsense2/samples/display/pom.xml | 63 +++++ .../samples/{ => distance}/RsDistance.java | 0 librealsense2/samples/{ => distance}/pom.xml | 0 7 files changed, 522 insertions(+), 2 deletions(-) create mode 100644 librealsense2/samples/display/.gitignore create mode 100644 librealsense2/samples/display/OpenCVFX.java create mode 100644 librealsense2/samples/display/RealSense2Show.java create mode 100644 librealsense2/samples/display/pom.xml rename librealsense2/samples/{ => distance}/RsDistance.java (100%) rename librealsense2/samples/{ => distance}/pom.xml (100%) diff --git a/librealsense2/README.md b/librealsense2/README.md index 58f21edaca0..1502efe162b 100644 --- a/librealsense2/README.md +++ b/librealsense2/README.md @@ -5,7 +5,7 @@ Introduction ------------ This directory contains the JavaCPP Presets module for: - * librealsense2 2.38.1 https://github.com/IntelRealSense/librealsense + * librealsense2 2.40.0 https://github.com/IntelRealSense/librealsense Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. @@ -44,7 +44,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic org.bytedeco librealsense2-platform - 2.38.1-1.5.5-SNAPSHOT + 2.40.0-1.5.5-SNAPSHOT diff --git a/librealsense2/samples/display/.gitignore b/librealsense2/samples/display/.gitignore new file mode 100644 index 00000000000..6b22dca1f95 --- /dev/null +++ b/librealsense2/samples/display/.gitignore @@ -0,0 +1,19 @@ +/downloads/ +/target/ +**/cppbuild/** +**/target/** + +# Mac +.DS_Store + +# Eclipse +.classpath +.project +.settings + +# IntelliJ +*.iml +.idea + +# VSCode +.vscode diff --git a/librealsense2/samples/display/OpenCVFX.java b/librealsense2/samples/display/OpenCVFX.java new file mode 100644 index 00000000000..abcdfd8e3f9 --- /dev/null +++ b/librealsense2/samples/display/OpenCVFX.java @@ -0,0 +1,211 @@ +import javafx.application.Platform; +import javafx.scene.Scene; +import javafx.scene.image.ImageView; +import javafx.scene.image.PixelFormat; +import javafx.scene.image.WritableImage; +import javafx.scene.input.KeyEvent; +import javafx.scene.layout.StackPane; +import javafx.stage.Stage; + +import java.nio.ByteBuffer; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.ArrayList; + +import org.bytedeco.opencv.global.opencv_imgproc; +import org.bytedeco.opencv.opencv_core.Mat; + + +public class OpenCVFX { + private final static ArrayList list = new ArrayList<>(); + + public static void imshow(String name, Mat mat) { + if (mat.channels() == 1) opencv_imgproc.cvtColor(mat, mat, opencv_imgproc.COLOR_GRAY2BGR); + opencv_imgproc.cvtColor(mat, mat, opencv_imgproc.COLOR_BGR2RGB); + byte[] data = new byte[mat.cols() * mat.rows() * mat.channels()]; + mat.data().get(data, 0, data.length); + imshow(name, data, mat.cols(), mat.rows()); + } + + public static void imshow(String name, byte[] data, int width, int height) { + if (data.length != width * height * 3) { + System.err.println("error: imshow() data length must be [width * height * 3]"); + return; + } + synchronized (list) { + for (ImShowThread im : list) { + if (im.getName().equals(name)) { + im.addImage(data, 0, data.length, width, height); + return; + } + } + ImShowThread im = new ImShowThread(name); + im.start(); + list.add(im); + im.addImage(data, 0, data.length, width, height); + } + } + + public static int waitKey() { + synchronized (list) { + for (ImShowThread im : list) { + int key = im.getKey(); + if (key != -1) { + return key; + } + } + return -1; + } + } + + public static void destroyAllWindows() { + synchronized (list) { + for (int i = 0; i < list.size(); ++i) { + list.get(i).setDestroyAllWindows((i+1)==list.size()); + list.get(i).stop(); + } + list.clear(); + } + } + + + static class ImShowThread implements Runnable { + private final String window_name; + private boolean loopFlag = true; + private final Thread thread = new Thread(this); + private static final int maxQueueSize = 3; + private final ArrayBlockingQueue queue = new ArrayBlockingQueue<>(maxQueueSize); + private boolean isLaunch = false; + private boolean destroyAllWindows = true; + private Stage tmpStage = null; + private int keyCode; + + public ImShowThread(String name) { + this.window_name = name; + } + + public void start() { + this.thread.start(); + } + + public void stop() { + this.loopFlag = false; + try { + this.thread.interrupt(); + this.thread.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + public String getName() { + return this.window_name; + } + + public void setDestroyAllWindows(boolean flag) { + this.destroyAllWindows = flag; + } + + public void addImage(byte[] data, int offset, int length, int width, int height) { + Cls cls = new Cls(); + cls.data = new byte[length - offset]; + ByteBuffer.wrap(data, offset, length).get(cls.data, 0, cls.data.length); + cls.width = width; + cls.height = height; + while (this.queue.size() >= maxQueueSize) { + this.queue.poll(); + } + try { + this.queue.offer(cls, 10, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + System.out.println(String.format("warn %s:%s", e.getClass().getSimpleName(), e.getMessage())); + } + } + + public int getKey() { + int result = this.keyCode; + this.keyCode = -1; + return result; + } + + @Override + public void run() { + ImageView imageView = new ImageView(); + WritableImage writableImage = new WritableImage(1, 1); + int width = 1; + int height = 1; + PixelFormat pf = PixelFormat.getByteRgbInstance(); + while (this.loopFlag) { + Cls cls; + try { + cls = this.queue.poll(50, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + sleep(30); + continue; + } + if (cls == null) { + sleep(30); + continue; + } + if (!this.isLaunch || width != cls.width || height != cls.height) { + try { + Platform.startup(() -> launchFxWindow(imageView, cls.width, cls.height, this.window_name)); + } catch (IllegalStateException ise) { + System.out.println(String.format("warn %s:%s", ise.getClass().getSimpleName(), ise.getMessage())); + launchFxWindow(imageView, cls.width, cls.height, this.window_name); + } + width = cls.width; + height = cls.height; + writableImage = new WritableImage(width, height); + } + while (!this.isLaunch) { + sleep(100); + } + + writableImage.getPixelWriter().setPixels(0, 0, width, height, pf, cls.data, 0, width * 3); + imageView.setImage(writableImage); + } + if (this.destroyAllWindows) { + Platform.runLater(Platform::exit); + } + } + + private void sleep(long ms) { + try { + Thread.sleep(ms); + } catch (InterruptedException ignored) { + } + } + + private void launchFxWindow(ImageView iv, int w, int h, String name) { + Platform.runLater(() -> { + Scene scene = new Scene(new StackPane(iv), w, h); + Stage stage = new Stage(); + stage.setTitle(name); + stage.showingProperty().addListener((obs, ov, nv) -> { + if (ov && !nv) { + this.isLaunch = false; + this.tmpStage = new Stage(); + this.tmpStage.setScene(new Scene(new StackPane(), 1, 1)); + this.tmpStage.show(); + } + }); + scene.addEventFilter(KeyEvent.KEY_PRESSED, keyEvent -> this.keyCode = keyEvent.getCode().getCode()); + stage.setScene(scene); + stage.show(); + if (this.tmpStage != null && this.tmpStage.isShowing()) { + this.tmpStage.close(); + } + this.isLaunch = true; + }); + } + + static class Cls { + byte[] data; + int width; + int height; + } + + } + +} diff --git a/librealsense2/samples/display/RealSense2Show.java b/librealsense2/samples/display/RealSense2Show.java new file mode 100644 index 00000000000..7251894e482 --- /dev/null +++ b/librealsense2/samples/display/RealSense2Show.java @@ -0,0 +1,227 @@ +import org.bytedeco.javacpp.BytePointer; +import org.bytedeco.javacpp.IntPointer; +import org.bytedeco.librealsense2.global.realsense2; +import org.bytedeco.librealsense2.*; +import org.bytedeco.opencv.global.opencv_core; +import org.bytedeco.opencv.global.opencv_imgproc; +import org.bytedeco.opencv.opencv_core.Mat; + +public class RealSense2Show { + public static void main(String[] args) { + final int width = 640; + final int height = 480; + final int fps = 30; + final int COLOR_STREAM_INDEX = -1; + final int DEPTH_STREAM_INDEX = -1; + rs2_error e = new rs2_error(); + realsense2.rs2_log_to_console(realsense2.RS2_LOG_SEVERITY_ERROR, e); + if (!check_error(e)) { + return; + } + rs2_context ctx = realsense2.rs2_create_context(realsense2.RS2_API_VERSION, e); + if (!check_error(e)) { + return; + } + rs2_device_list list = realsense2.rs2_query_devices(ctx, e); + if (!check_error(e)) { + return; + } + int rs2_list_size = realsense2.rs2_get_device_count(list, e); + if (!check_error(e)) { + return; + } + System.out.printf("realsense device %d\n", rs2_list_size); + if (rs2_list_size == 0) { + return; + } + rs2_device rsdev = realsense2.rs2_create_device(list, 0, e); + if (!check_error(e)) { + return; + } + + if (rsdev == null) { + System.err.println("device not found. serial number = "); + return; + } + + // Declare RealSense pipeline, encapsulating the actual device and sensors + rs2_pipeline pipe = realsense2.rs2_create_pipeline(ctx, e); + //Create a configuration for configuring the pipeline with a non default profile + rs2_config cfg = realsense2.rs2_create_config(e); + //Add desired streams to configuration + realsense2.rs2_config_enable_stream(cfg, realsense2.RS2_STREAM_COLOR, COLOR_STREAM_INDEX, width, height, realsense2.RS2_FORMAT_RGB8, fps, e); + realsense2.rs2_config_enable_stream(cfg, realsense2.RS2_STREAM_DEPTH, DEPTH_STREAM_INDEX, width, height, realsense2.RS2_FORMAT_Z16, fps, e); + if (!check_error(e)) { + return; + } + + // Start streaming with default recommended configuration + // The default video configuration contains Depth and Color streams + // If a device is capable to stream IMU data, both Gyro and Accelerometer are enabled by default + rs2_pipeline_profile selection = realsense2.rs2_pipeline_start_with_config(pipe, cfg, e); + if (!check_error(e)) { + return; + } + + // Define align object that will be used to align to color viewport. + // Creating align object is an expensive operation + // that should not be performed in the main loop. + rs2_processing_block align_to_color = realsense2.rs2_create_align(realsense2.RS2_STREAM_COLOR, e); + if (!check_error(e)) { + return; + } + rs2_frame_queue align_queue = realsense2.rs2_create_frame_queue(1, e); + if (!check_error(e)) { + return; + } + realsense2.rs2_start_processing_queue(align_to_color, align_queue, e); + if (!check_error(e)) { + return; + } + int psize = 100; + IntPointer stream = new IntPointer(psize); + IntPointer format = new IntPointer(psize); + IntPointer indexP = new IntPointer(psize); + IntPointer unique_id = new IntPointer(psize); + IntPointer framerate = new IntPointer(psize); + rs2_frame color_frame = null; + rs2_frame depth_frame = null; + + while (true) { + rs2_frame tmpFrames = realsense2.rs2_pipeline_wait_for_frames(pipe, realsense2.RS2_DEFAULT_TIMEOUT, e); + if (!check_error(e)) { + continue; + } + + // Align depth frame to color viewport + realsense2.rs2_frame_add_ref(tmpFrames, e); + if (!check_error(e)) { + rs2_release_frames(color_frame, depth_frame, tmpFrames); + continue; + } + realsense2.rs2_process_frame(align_to_color, tmpFrames, e); + rs2_frame frames = realsense2.rs2_wait_for_frame(align_queue, 5000, e); + if (!check_error(e)) { + rs2_release_frames(color_frame, depth_frame, tmpFrames, frames); + continue; + } + rs2_release_frames(tmpFrames); + + int num_of_frames = realsense2.rs2_embedded_frames_count(frames, e); + // retrieve each frame + for (int i = 0; i < num_of_frames; i++) { + rs2_frame frame = realsense2.rs2_extract_frame(frames, i, e); + rs2_stream_profile mode = realsense2.rs2_get_frame_stream_profile(frame, e); + realsense2.rs2_get_stream_profile_data(mode, stream, format, indexP, unique_id, framerate, e); + String stream_type = realsense2.rs2_stream_to_string(stream.get()).getString(); + // retrieve each frame + switch (stream_type.toLowerCase()) { + case "color": + color_frame = frame; + break; + case "depth": + depth_frame = frame; + break; + default: + System.err.println("invalid stream data "+stream_type); + break; + } + } + if (color_frame == null || depth_frame == null) { + // release frames + rs2_release_frames(color_frame, depth_frame, frames); + continue; + } + + BytePointer color_pointer = new BytePointer(realsense2.rs2_get_frame_data(color_frame, e)); + int color_data_size = realsense2.rs2_get_frame_data_size(color_frame, e); + byte[] color_byte = new byte[color_data_size]; + color_pointer.get(color_byte, 0, color_data_size); + color_pointer.close(); + + BytePointer depth_pointer = new BytePointer(realsense2.rs2_get_frame_data(depth_frame, e)); + int depth_data_size = realsense2.rs2_get_frame_data_size(depth_frame, e); + byte[] depth_byte = new byte[depth_data_size]; + depth_pointer.get(depth_byte, 0, depth_data_size); + depth_pointer.close(); + byte[] color_depth_byte = toColorMap(depth_byte, width, height, -1, -1); + + // show rgb + OpenCVFX.imshow("color", color_byte, width, height); + // show depth + OpenCVFX.imshow("depth", color_depth_byte, width, height); + + // release frames + rs2_release_frames(color_frame, depth_frame, frames); + + if (OpenCVFX.waitKey() == 27) { + break; + } + + } + + OpenCVFX.destroyAllWindows(); + + // Stop pipeline streaming + realsense2.rs2_pipeline_stop(pipe, e); + + // Release resources + realsense2.rs2_delete_pipeline_profile(selection); + realsense2.rs2_delete_processing_block(align_to_color); + realsense2.rs2_delete_frame_queue(align_queue); + realsense2.rs2_delete_config(cfg); + realsense2.rs2_delete_pipeline(pipe); + realsense2.rs2_delete_device(rsdev); + realsense2.rs2_delete_device_list(list); + realsense2.rs2_delete_context(ctx); + + } + + private static byte[] toColorMap(byte[] depth, int w, int h, double max, double min) { + byte[] result = new byte[w * h * 3]; + Mat depthmat = new Mat(h, w, opencv_core.CV_16UC1); + depthmat.data().put(depth, 0, depth.length); + Mat rmat = toColorMap(depthmat, max, min); + rmat.data().get(result, 0, result.length); + + depthmat.release(); + depthmat.close(); + rmat.release(); + rmat.close(); + return result; + } + + private static Mat toColorMap(Mat depth, double max, double min) { + Mat out = new Mat(); + if (max < 0 || min < 0) { + double[] minVal = new double[1]; + double[] maxVal = new double[1]; + opencv_core.minMaxLoc(depth, minVal, maxVal, null, null, null); + min = minVal[0]; + max = maxVal[0]; + } + double scale = 255 / (max - min); + depth.convertTo(out, opencv_core.CV_8UC1, scale, -min * scale); + opencv_imgproc.applyColorMap(out, out, opencv_imgproc.COLORMAP_JET); + return out; + } + + private static void rs2_release_frames(rs2_frame... frames) { + for (rs2_frame frame : frames) { + if (frame != null) { + realsense2.rs2_release_frame(frame); + } + } + } + + private static boolean check_error(rs2_error e) { + if (!e.isNull()) { + System.err.printf("%s(%s): %s%n", + realsense2.rs2_get_failed_function(e).getString(), + realsense2.rs2_get_failed_args(e).getString(), + realsense2.rs2_get_error_message(e).getString()); + return false; + } + return true; + } +} diff --git a/librealsense2/samples/display/pom.xml b/librealsense2/samples/display/pom.xml new file mode 100644 index 00000000000..98af358a93e --- /dev/null +++ b/librealsense2/samples/display/pom.xml @@ -0,0 +1,63 @@ + + 4.0.0 + org.bytedeco.opencv + realsense2show + 1.5.4 + + RealSense2Show + 11 + 11 + + + + org.bytedeco + librealsense2-platform + 2.29.0-1.5.4 + + + + org.bytedeco + opencv-platform + 4.4.0-1.5.4 + + + + + org.bytedeco + opencv-platform-gpu + 4.3.0-1.5.3 + + + + + org.bytedeco + cuda-platform-redist + 10.2-7.6-1.5.3 + + + + + org.bytedeco + mkl-platform-redist + 2020.1-1.5.3 + + + + + org.bytedeco + numpy-platform + 1.18.2-1.5.3 + + + + + org.openjfx + javafx-controls + 11 + + + + + . + + diff --git a/librealsense2/samples/RsDistance.java b/librealsense2/samples/distance/RsDistance.java similarity index 100% rename from librealsense2/samples/RsDistance.java rename to librealsense2/samples/distance/RsDistance.java diff --git a/librealsense2/samples/pom.xml b/librealsense2/samples/distance/pom.xml similarity index 100% rename from librealsense2/samples/pom.xml rename to librealsense2/samples/distance/pom.xml From 429ea2bccf6ef578df689c198cdc647348428ad6 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Mon, 7 Dec 2020 09:31:41 +0900 Subject: [PATCH 3/6] Update CHANGELOG.md, README.md, and pom.xml files --- CHANGELOG.md | 2 +- librealsense2/README.md | 2 +- librealsense2/samples/display/pom.xml | 34 +---- librealsense2/samples/distance/pom.xml | 2 +- .../librealsense2/global/realsense2.java | 136 +++++++++--------- platform/pom.xml | 2 +- 6 files changed, 75 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aa84ef14f1..8bd9fbf2bfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ * Disable assembly optimizations for libx264 with FFmpeg on Mac to work around crashes ([issue bytedeco/javacv#1519](https://github.com/bytedeco/javacv/issues/1519)) * Add `linux-armhf` and `linux-arm64` builds for librealsense and librealsense2 ([pull #951](https://github.com/bytedeco/javacpp-presets/pull/951)) * License default builds of FFmpeg under LGPL v3 and move GPL-enabled builds to `-gpl` extension ([pull #950](https://github.com/bytedeco/javacpp-presets/pull/950)) - * Upgrade presets for OpenCV 4.5.0, Arrow 2.0.0, MKL 2020.4, OpenBLAS 0.3.12, librealsense2 2.38.1 ([pull #946](https://github.com/bytedeco/javacpp-presets/pull/946)), DNNL 1.7, NumPy 1.19.4, SciPy 1.5.4, Gym 0.17.3, LLVM 11.0.0 ([pull #955](https://github.com/bytedeco/javacpp-presets/pull/955)), CUDA 11.1.1, cuDNN 8.0.4, TensorFlow 1.15.4, TensorRT 7.2.1.6, ONNX 1.8.0, ONNX Runtime 1.5.3, Qt 5.15.1, Skia 2.80.2, cpu_features 0.6.0, and their dependencies + * Upgrade presets for OpenCV 4.5.0, Arrow 2.0.0, MKL 2020.4, OpenBLAS 0.3.12, librealsense2 2.40.0 ([pull #946](https://github.com/bytedeco/javacpp-presets/pull/946) and [pull #978](https://github.com/bytedeco/javacpp-presets/pull/978)), DNNL 1.7, NumPy 1.19.4, SciPy 1.5.4, Gym 0.17.3, LLVM 11.0.0 ([pull #955](https://github.com/bytedeco/javacpp-presets/pull/955)), CUDA 11.1.1, cuDNN 8.0.4, TensorFlow 1.15.4, TensorRT 7.2.1.6, ONNX 1.8.0, ONNX Runtime 1.5.3, Qt 5.15.1, Skia 2.80.2, cpu_features 0.6.0, and their dependencies ### September 9, 2020 version 1.5.4 * Bundle `libpostal_data` program, executable via `Loader.load()` for convenience ([issue #939](https://github.com/bytedeco/javacpp-presets/issues/939)) diff --git a/librealsense2/README.md b/librealsense2/README.md index 1502efe162b..22e90539f1b 100644 --- a/librealsense2/README.md +++ b/librealsense2/README.md @@ -25,7 +25,7 @@ Here is a simple example of librealsense2 ported to Java from this C source file * https://github.com/IntelRealSense/librealsense/blob/master/examples/C/distance/rs-distance.c -We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `TestConnection.java` source files below, simply execute on the command line: +We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `RsDistance.java` source files below, simply execute on the command line: ```bash $ mvn compile exec:java ``` diff --git a/librealsense2/samples/display/pom.xml b/librealsense2/samples/display/pom.xml index 98af358a93e..1dc84d8246f 100644 --- a/librealsense2/samples/display/pom.xml +++ b/librealsense2/samples/display/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.bytedeco.opencv realsense2show - 1.5.4 + 1.5.5-SNAPSHOT RealSense2Show 11 @@ -12,41 +12,13 @@ org.bytedeco librealsense2-platform - 2.29.0-1.5.4 + 2.40.0-1.5.5-SNAPSHOT org.bytedeco opencv-platform - 4.4.0-1.5.4 - - - - - org.bytedeco - opencv-platform-gpu - 4.3.0-1.5.3 - - - - - org.bytedeco - cuda-platform-redist - 10.2-7.6-1.5.3 - - - - - org.bytedeco - mkl-platform-redist - 2020.1-1.5.3 - - - - - org.bytedeco - numpy-platform - 1.18.2-1.5.3 + 4.5.0-1.5.5-SNAPSHOT diff --git a/librealsense2/samples/distance/pom.xml b/librealsense2/samples/distance/pom.xml index 40fa78918c8..091348454b2 100644 --- a/librealsense2/samples/distance/pom.xml +++ b/librealsense2/samples/distance/pom.xml @@ -10,7 +10,7 @@ org.bytedeco librealsense2-platform - 2.38.1-1.5.5-SNAPSHOT + 2.40.0-1.5.5-SNAPSHOT diff --git a/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java b/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java index 0dfd0a6143a..e806c420e95 100644 --- a/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java +++ b/librealsense2/src/gen/java/org/bytedeco/librealsense2/global/realsense2.java @@ -90,10 +90,10 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { /** Number of enumeration values. Not a valid input: intended to be used in for-loops. */ RS2_DISTORTION_COUNT = 6; public static native @Cast("const char*") BytePointer rs2_distortion_to_string(@Cast("rs2_distortion") int distortion); -// Targeting ..\rs2_intrinsics.java +// Targeting ../rs2_intrinsics.java -// Targeting ..\rs2_dsm_params.java +// Targeting ../rs2_dsm_params.java @@ -106,22 +106,22 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { /** Thermal-over-aging; aging-induced error changes alongside temperature */ RS2_DSM_CORRECTION_TOA = 2, RS2_DSM_CORRECTION_COUNT = 3; -// Targeting ..\rs2_motion_device_intrinsic.java +// Targeting ../rs2_motion_device_intrinsic.java -// Targeting ..\rs2_vertex.java +// Targeting ../rs2_vertex.java -// Targeting ..\rs2_pixel.java +// Targeting ../rs2_pixel.java -// Targeting ..\rs2_vector.java +// Targeting ../rs2_vector.java -// Targeting ..\rs2_quaternion.java +// Targeting ../rs2_quaternion.java -// Targeting ..\rs2_pose.java +// Targeting ../rs2_pose.java @@ -232,133 +232,133 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { RS2_MATCHER_DEFAULT = 6, //the default matcher compare all the streams based on closest timestamp RS2_MATCHER_COUNT = 7; -// Targeting ..\rs2_device_info.java +// Targeting ../rs2_device_info.java -// Targeting ..\rs2_device.java +// Targeting ../rs2_device.java -// Targeting ..\rs2_error.java +// Targeting ../rs2_error.java -// Targeting ..\rs2_log_message.java +// Targeting ../rs2_log_message.java -// Targeting ..\rs2_raw_data_buffer.java +// Targeting ../rs2_raw_data_buffer.java -// Targeting ..\rs2_frame.java +// Targeting ../rs2_frame.java -// Targeting ..\rs2_frame_queue.java +// Targeting ../rs2_frame_queue.java -// Targeting ..\rs2_pipeline.java +// Targeting ../rs2_pipeline.java -// Targeting ..\rs2_pipeline_profile.java +// Targeting ../rs2_pipeline_profile.java -// Targeting ..\rs2_config.java +// Targeting ../rs2_config.java -// Targeting ..\rs2_device_list.java +// Targeting ../rs2_device_list.java -// Targeting ..\rs2_stream_profile_list.java +// Targeting ../rs2_stream_profile_list.java -// Targeting ..\rs2_processing_block_list.java +// Targeting ../rs2_processing_block_list.java -// Targeting ..\rs2_stream_profile.java +// Targeting ../rs2_stream_profile.java -// Targeting ..\rs2_frame_callback.java +// Targeting ../rs2_frame_callback.java -// Targeting ..\rs2_log_callback.java +// Targeting ../rs2_log_callback.java -// Targeting ..\rs2_syncer.java +// Targeting ../rs2_syncer.java -// Targeting ..\rs2_device_serializer.java +// Targeting ../rs2_device_serializer.java -// Targeting ..\rs2_source.java +// Targeting ../rs2_source.java -// Targeting ..\rs2_processing_block.java +// Targeting ../rs2_processing_block.java -// Targeting ..\rs2_frame_processor_callback.java +// Targeting ../rs2_frame_processor_callback.java -// Targeting ..\rs2_playback_status_changed_callback.java +// Targeting ../rs2_playback_status_changed_callback.java -// Targeting ..\rs2_update_progress_callback.java +// Targeting ../rs2_update_progress_callback.java -// Targeting ..\rs2_context.java +// Targeting ../rs2_context.java -// Targeting ..\rs2_device_hub.java +// Targeting ../rs2_device_hub.java -// Targeting ..\rs2_sensor_list.java +// Targeting ../rs2_sensor_list.java -// Targeting ..\rs2_sensor.java +// Targeting ../rs2_sensor.java -// Targeting ..\rs2_options.java +// Targeting ../rs2_options.java -// Targeting ..\rs2_options_list.java +// Targeting ../rs2_options_list.java -// Targeting ..\rs2_devices_changed_callback.java +// Targeting ../rs2_devices_changed_callback.java -// Targeting ..\rs2_notification.java +// Targeting ../rs2_notification.java -// Targeting ..\rs2_notifications_callback.java +// Targeting ../rs2_notifications_callback.java -// Targeting ..\rs2_firmware_log_message.java +// Targeting ../rs2_firmware_log_message.java -// Targeting ..\rs2_firmware_log_parsed_message.java +// Targeting ../rs2_firmware_log_parsed_message.java -// Targeting ..\rs2_firmware_log_parser.java +// Targeting ../rs2_firmware_log_parser.java -// Targeting ..\rs2_terminal_parser.java +// Targeting ../rs2_terminal_parser.java -// Targeting ..\rs2_log_callback_ptr.java +// Targeting ../rs2_log_callback_ptr.java -// Targeting ..\rs2_notification_callback_ptr.java +// Targeting ../rs2_notification_callback_ptr.java -// Targeting ..\rs2_software_device_destruction_callback_ptr.java +// Targeting ../rs2_software_device_destruction_callback_ptr.java -// Targeting ..\rs2_devices_changed_callback_ptr.java +// Targeting ../rs2_devices_changed_callback_ptr.java -// Targeting ..\rs2_frame_callback_ptr.java +// Targeting ../rs2_frame_callback_ptr.java -// Targeting ..\rs2_frame_processor_callback_ptr.java +// Targeting ../rs2_frame_processor_callback_ptr.java -// Targeting ..\rs2_update_progress_callback_ptr.java +// Targeting ../rs2_update_progress_callback_ptr.java @@ -921,10 +921,10 @@ public class realsense2 extends org.bytedeco.librealsense2.presets.realsense2 { RS2_CALIBRATION_STATUS_LAST = 4, RS2_CALIBRATION_STATUS_COUNT = RS2_CALIBRATION_STATUS_LAST - RS2_CALIBRATION_STATUS_FIRST + 1; public static native @Cast("const char*") BytePointer rs2_calibration_status_to_string( @Cast("rs2_calibration_status") int arg0 ); -// Targeting ..\rs2_calibration_change_callback.java +// Targeting ../rs2_calibration_change_callback.java -// Targeting ..\rs2_calibration_change_callback_ptr.java +// Targeting ../rs2_calibration_change_callback_ptr.java @@ -2216,7 +2216,7 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so RS2_PLAYBACK_STATUS_COUNT = 4; public static native @Cast("const char*") BytePointer rs2_playback_status_to_string(@Cast("rs2_playback_status") int status); -// Targeting ..\rs2_playback_status_changed_callback_ptr.java +// Targeting ../rs2_playback_status_changed_callback_ptr.java @@ -2546,7 +2546,7 @@ public static native rs2_frame rs2_allocate_synthetic_motion_frame(rs2_source so /** Number of enumeration values. Not a valid input: intended to be used in for-loops. */ RS2_FORMAT_COUNT = 29; public static native @Cast("const char*") BytePointer rs2_format_to_string(@Cast("rs2_format") int format); -// Targeting ..\rs2_extrinsics.java +// Targeting ../rs2_extrinsics.java @@ -3690,43 +3690,43 @@ public static native void rs2_config_enable_stream(rs2_config config, // #define RS2_ADVANCED_MODE_COMMAND_H // #include -// Targeting ..\STDepthControlGroup.java +// Targeting ../STDepthControlGroup.java -// Targeting ..\STRsm.java +// Targeting ../STRsm.java -// Targeting ..\STRauSupportVectorControl.java +// Targeting ../STRauSupportVectorControl.java -// Targeting ..\STColorControl.java +// Targeting ../STColorControl.java -// Targeting ..\STRauColorThresholdsControl.java +// Targeting ../STRauColorThresholdsControl.java -// Targeting ..\STSloColorThresholdsControl.java +// Targeting ../STSloColorThresholdsControl.java -// Targeting ..\STSloPenaltyControl.java +// Targeting ../STSloPenaltyControl.java -// Targeting ..\STHdad.java +// Targeting ../STHdad.java -// Targeting ..\STColorCorrection.java +// Targeting ../STColorCorrection.java -// Targeting ..\STAEControl.java +// Targeting ../STAEControl.java -// Targeting ..\STDepthTableControl.java +// Targeting ../STDepthTableControl.java -// Targeting ..\STCensusRadius.java +// Targeting ../STCensusRadius.java -// Targeting ..\STAFactor.java +// Targeting ../STAFactor.java diff --git a/platform/pom.xml b/platform/pom.xml index 1b25fcaa5dd..cae28b708e3 100644 --- a/platform/pom.xml +++ b/platform/pom.xml @@ -115,7 +115,7 @@ org.bytedeco librealsense2-platform - 2.29.0-${project.version} + 2.40.0-${project.version} org.bytedeco From c19373f3a8592894d00f82fcc2f7ccb13cd205c5 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Mon, 7 Dec 2020 10:36:04 +0900 Subject: [PATCH 4/6] Remove .gitignore in samples --- librealsense2/samples/display/.gitignore | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 librealsense2/samples/display/.gitignore diff --git a/librealsense2/samples/display/.gitignore b/librealsense2/samples/display/.gitignore deleted file mode 100644 index 6b22dca1f95..00000000000 --- a/librealsense2/samples/display/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -/downloads/ -/target/ -**/cppbuild/** -**/target/** - -# Mac -.DS_Store - -# Eclipse -.classpath -.project -.settings - -# IntelliJ -*.iml -.idea - -# VSCode -.vscode From 6098f906b1776dce92ecf23960455ab9bdd667cd Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Mon, 7 Dec 2020 16:09:27 +0900 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd9fbf2bfe..ad0015a43b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Add display sample for librealsense2 ([pull #978](https://github.com/bytedeco/javacpp-presets/pull/978)) * Fix builds for libpostal on Mac and Windows ([issue #903](https://github.com/bytedeco/javacpp-presets/issues/903)) * Fix builds for NumPy and SciPy on Linux when using a cross compiler or not * Update presets for Visual Studio 2019 on Windows @@ -8,7 +9,7 @@ * Disable assembly optimizations for libx264 with FFmpeg on Mac to work around crashes ([issue bytedeco/javacv#1519](https://github.com/bytedeco/javacv/issues/1519)) * Add `linux-armhf` and `linux-arm64` builds for librealsense and librealsense2 ([pull #951](https://github.com/bytedeco/javacpp-presets/pull/951)) * License default builds of FFmpeg under LGPL v3 and move GPL-enabled builds to `-gpl` extension ([pull #950](https://github.com/bytedeco/javacpp-presets/pull/950)) - * Upgrade presets for OpenCV 4.5.0, Arrow 2.0.0, MKL 2020.4, OpenBLAS 0.3.12, librealsense2 2.40.0 ([pull #946](https://github.com/bytedeco/javacpp-presets/pull/946) and [pull #978](https://github.com/bytedeco/javacpp-presets/pull/978)), DNNL 1.7, NumPy 1.19.4, SciPy 1.5.4, Gym 0.17.3, LLVM 11.0.0 ([pull #955](https://github.com/bytedeco/javacpp-presets/pull/955)), CUDA 11.1.1, cuDNN 8.0.4, TensorFlow 1.15.4, TensorRT 7.2.1.6, ONNX 1.8.0, ONNX Runtime 1.5.3, Qt 5.15.1, Skia 2.80.2, cpu_features 0.6.0, and their dependencies + * Upgrade presets for OpenCV 4.5.0, Arrow 2.0.0, MKL 2020.4, OpenBLAS 0.3.12, librealsense2 2.40.0 ([pull #946](https://github.com/bytedeco/javacpp-presets/pull/946)), DNNL 1.7, NumPy 1.19.4, SciPy 1.5.4, Gym 0.17.3, LLVM 11.0.0 ([pull #955](https://github.com/bytedeco/javacpp-presets/pull/955)), CUDA 11.1.1, cuDNN 8.0.4, TensorFlow 1.15.4, TensorRT 7.2.1.6, ONNX 1.8.0, ONNX Runtime 1.5.3, Qt 5.15.1, Skia 2.80.2, cpu_features 0.6.0, and their dependencies ### September 9, 2020 version 1.5.4 * Bundle `libpostal_data` program, executable via `Loader.load()` for convenience ([issue #939](https://github.com/bytedeco/javacpp-presets/issues/939)) From d5214425fa64038554ceac05740f16d167b778fa Mon Sep 17 00:00:00 2001 From: n-kai-cj Date: Wed, 13 Jan 2021 03:31:30 +0900 Subject: [PATCH 6/6] update link version --- .../java/org/bytedeco/librealsense2/presets/realsense2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java b/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java index 32c826f53f1..d98d8d5a970 100644 --- a/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java +++ b/librealsense2/src/main/java/org/bytedeco/librealsense2/presets/realsense2.java @@ -56,7 +56,7 @@ "librealsense2/rs_advanced_mode.h", "librealsense2/rsutil.h" }, - link = "realsense2@.2.29" + link = "realsense2@.2.40" ), @Platform(value = "macosx", preload = "usb-1.0@.0", preloadpath = "/usr/local/lib/") },