rs-enum adjusted to support both single and multi cameras#14584
Conversation
4ffc7ba to
6e737cf
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the rs-enum.sh script to improve RealSense camera enumeration on Tegra/Jetson platforms by restructuring the code into modular helper functions. The changes enable the script to handle both single and multiple camera configurations more reliably.
Changes:
- Refactored monolithic camera detection logic into reusable helper functions
- Improved I2C address extraction and video device detection for RealSense cameras
- Added extensive debug logging throughout the enumeration process
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| local sensor_name="$5" | ||
| local type="$6" | ||
|
|
||
| echo "DEBUG: Creating ${type} link: ${vid} -> ${dev_ln}" |
There was a problem hiding this comment.
Debug logging statements should be conditional on a debug flag or removed for production. These echo statements will pollute output even when $quiet is set to 1. Consider using a debug mode flag (e.g., [[ $debug -eq 1 ]] && echo ...) or removing these statements.
| local bus="mipi" | ||
|
|
||
| for vid in "${vid_dev_arr[@]}"; do | ||
| [[ ! -c "${vid}" ]] && echo "DEBUG: Video device ${vid} not found, skipping" && continue |
There was a problem hiding this comment.
Debug logging statements should be conditional on a debug flag or removed for production. These echo statements will pollute output even when $quiet is set to 1. Consider using a debug mode flag (e.g., [[ $debug -eq 1 ]] && echo ...) or removing these statements.
| create_video_link "$vid" "$dev_md_ln" "$bus" "$cam_id" "$sensor_name" "Metadata" | ||
| sens_id=$((sens_id+1)) | ||
| else | ||
| echo "DEBUG: Unrecognized driver ${dev_name} for ${vid}, skipping" |
There was a problem hiding this comment.
Debug logging statements should be conditional on a debug flag or removed for production. These echo statements will pollute output even when $quiet is set to 1. Consider using a debug mode flag (e.g., [[ $debug -eq 1 ]] && echo ...) or removing these statements.
| create_dfu_link() { | ||
| local cam_id="$1" | ||
|
|
||
| echo "DEBUG: Looking for DFU device for camera ${cam_id}" |
There was a problem hiding this comment.
Debug logging statements should be conditional on a debug flag or removed for production. These echo statements will pollute output even when $quiet is set to 1. Consider using a debug mode flag (e.g., [[ $debug -eq 1 ]] && echo ...) or removing these statements.
| local rs_line="$1" | ||
| local cam_id="$2" | ||
|
|
||
| echo "DEBUG: Processing RS line: ${rs_line}" |
There was a problem hiding this comment.
Debug logging statements should be conditional on a debug flag or removed for production. These echo statements will pollute output even when $quiet is set to 1. Consider using a debug mode flag (e.g., [[ $debug -eq 1 ]] && echo ...) or removing these statements.
| exit 0 # exit for Tegra | ||
| # For Jetson we have `simple` method | ||
| if [ -n "${rs_devices}" ]; then | ||
| echo "DEBUG: Tegra RS devices detected" |
There was a problem hiding this comment.
Debug logging statements should be conditional on a debug flag or removed for production. These echo statements will pollute output even when $quiet is set to 1. Consider using a debug mode flag (e.g., [[ $debug -eq 1 ]] && echo ...) or removing these statements.
…h single and multi cameras
…enum adjusted to support both single and multi cameras
* fix wrong string compare on python device repr * icons corrected in calib-model * folder_open_o renamed * cr * cr1 * icons checked * replace is_update_device with is_in_recovery_mode in python * fix icon name * test-fw-errors.py: corrected firmware version comparison * add test-fps-manual-exposure.py * code review fixes * removed the macOS without DDS GHA * Add extra security check flags on Linux, remove unneeded include. * Update package.xml before Realsense migration * textual icons to string corrections * PR realsenseai#14225 from Noy-Zini: Modernize Librealsense SDK readme (cherry picked from commit 2d476c7) # Conflicts: # readme.md * protect jpeg unpack * Update test-fps-manual-exposure.py to use fps_helper.measure_fps() * Update test-fps.py to use fps_helper.measure_fps() * tare fixes commit * add D555 to test-fw-update * Fix typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bump version to 2.57.5 * add unused warning supression * disable calib tests * patches script for jetson - replacing uvcvideo in its relevant place * checking modinfo result in patches for jetson script Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * setting default path for uvcvideo module if not loaded * typo * typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * KERNEL_LOCALVERSION grabbed dynamically Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * manual patches in JP5.0.2 for D436, D555, D585 * add test type to skip by connection type * fix recovery issues .. * update expected filename on fw update test * migrate s3 links * catching errors when parsing stream_options DDS message * dashboard open close icons corrected * using vectors for mipi pids, instead of the whole list, both be and core * adding d401_gmsl device is SDK and linux backend * d401 gmsl works - color sensor not enabled yet * comment added for min version * improving mipi devices pid code * Round float values for integer options with log * fix log message * Implement DDS close-streams using open-streams control * D585s - default res for occupancy stream * open-streams reset flag defaults false. Fix documentation and rs-dds-adapter * Viewer - use stream name in header * Get color frame according to index (there can be more than one) * replace IntelRealSense with realsenseai * delete old file * Update sample-data.md * fix degree symbols * update realsense links * Update installation_jetson.md - broken link * Update installation_jetson.md - fix broken link * align docs to latest * add notice * is_multiple_resolutions_supported only on D585S * add links * Add missing includes for std::fstream and std::thread Fix missing <fstream> include in backend-hid.h and <thread> include in network-adapter-watcher.cpp to ensure proper compilation across different build environments and avoid implicit dependency on transitive includes. * Viewer no Advanced Mode toggle for D500 * Revert "PR realsenseai#14480 from AviaAv: Fix D555 not displaying resolutions on DQT" This reverts commit 984a5e8, reversing changes made to 94b4e24. * Fix D500 not displaying resolutions on DQT * undraw format on DQT * PR realsenseai#14490 from AviaAv: Fix resolution not showing on DQT on D500 * remove redundant conditions * test-frames-depth modified to work in front of wall * checking only fill rate * log debug added for configuration file and content * cr * cr * fill rate requirement in test increased to 50% * allow exposure 1 before AE stabilize on hdr test * change deltas to avoid rare failures * fixing method so that it fits to d400 and d500 fw filename patterns * removing debug prints * disable test case that are not stable * Update test-depth_ae_convergence.py * Fix libusb crash on macOS * empty commit for rechecking gha after rebase * empty commit for rechecking gha after rebase 2 * enabled in manual patches script * comment corrected * typo * empty commit for retriggering tests * empty commit for retriggering tests - 2 * flag for skipping d457 in test removed * Add D400 auto exposure toggling test * Add test for auto exposure meta data - test-depth-ae-metadata.py * d457 - adding gyro and accel default profiles with same fps * ae tests disabled until issue resolved in fw * restoring build version from 2.57.5 to 2.57.0 for development branch * Fix error C2880 with /std:c++latest option in VS2022 * removing special handle for persistency option in dds * making the persistency option desciption shorter for viewer * fixing persistency value setting * empty commit for tests retrigger * example added - not done * Add TTL support to DDS configuration * Update DDS configuration link timeout range * Fix test-eth-config failure * cr * Handle PR comments * python example added, python api extended with filter type * tests failing on D555 new FW disabled until passing * dds dependancy removed from example * scripts reworked * fetch when required * common sync script * verify repo url * Update rs-enum for multi-camera setups Signed-off-by: ejgoldik <ehud.joseph.goldik@realsenseai.com> * soft link condition * update python instructions * fix typo * JP5 simplified * PR fixes * DownloadAndSync reworked * branch policy update * remove redundant " * PR realsenseai#14563 from realsenseai: branch policy update (cherry picked from commit 6b52d27) * common JP5 build * minimum repos * modules load/unload reworked * loadin modules rearranged * bitwise OR changed to logical OR * enabling partial devices, using new value in viewer json config * avoid using nullptr * common for d400 and d500 devices, config param changed to partial_device_enabled * making sure streams exist before adding to matcher * comments about JP version updated * Try rebooting message added * Allow out of order DDS device initialization messages * Allow DDS devices to be only partially initialized * Don't print guid entity when not needed * fixup! Allow DDS devices to be only partially initialized * Handle PR#14568 comments * fix missing iio * Use config flag for DDS partial device use * fixup! Handle PR#14568 comments * Add D555 to test-live-options-presets * Fix test-live-options-advanced-mode for D500 * Handle more PR#14568 comments * enabling color, adding some debug code in linux be * debug code in be removed, d400-color code fixed * Tracked-On RSDSO-20929: Support JP7.1 * enabling color stream * cr * disable test-depth_ae_convergence * reverting spaces * cr2 * cr3 * Update rs.h verion * Update package.xml version * PR realsenseai#14584 from remibettan: rs-enum adjusted to support both single and multi cameras * PR realsenseai#14618 from ashrafk93: update public key instructions (cherry picked from commit 2c6e932) * PR realsenseai#14639 from Nir-Az/ Update installation_jetson.md key (cherry picked from commit dcf7475) * Update support-matrix.md * Update rs-color.c * Update rs-depth.c * Update rs-distance.c * Update rs-infrared.c * Update pr_check.sh * Update pr_check.sh --------- Signed-off-by: ejgoldik <ehud.joseph.goldik@realsenseai.com> Co-authored-by: Nir Azkiel <nir.azkiel@intel.com> Co-authored-by: Remi Bettan <remi.bettan@realsenseai.com> Co-authored-by: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Co-authored-by: Tri Khuong <tri.t.khuong@realsenseai.com> Co-authored-by: Alex Kunin <alex.kunin@intel.com> Co-authored-by: Ohad Meir <100071798+OhadMeir@users.noreply.github.com> Co-authored-by: Remi Bettan <remibettan@gmail.com> Co-authored-by: ohadmeir <ohad1.meir@intel.com> Co-authored-by: remibettan <55648466+remibettan@users.noreply.github.com> Co-authored-by: Nir Azkiel <nir.azkiel@realsenseai.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: OhadMeir <ohad1.meir@realsenseai.com> Co-authored-by: Brian Ferri <me@brianferri.dev> Co-authored-by: ymodlin <yogev.modlin@realsenseai.com> Co-authored-by: Yogev Modlin <117653169+ymodlin@users.noreply.github.com> Co-authored-by: Ashraf Kattoura <ashraf.kattoura@intel.com> Co-authored-by: Karen Huang (BEYONDSOFT CONSULTING INC) <v-huati@microsoft.com> Co-authored-by: Wojciech Gladysz <kontra.wojciech.gladysz@gmail.com> Co-authored-by: user.name <user@gmail.com> Co-authored-by: ashrafk93 <113350644+ashrafk93@users.noreply.github.com>
Tracked by: RSDSO-20936
Waiting for @ejgoldik 's feedback