Skip to content

Create jetson_realsense.sh#145

Open
lzyang2000 wants to merge 30 commits intomainfrom
lzyang2000-patch-1
Open

Create jetson_realsense.sh#145
lzyang2000 wants to merge 30 commits intomainfrom
lzyang2000-patch-1

Conversation

@lzyang2000
Copy link
Collaborator

add realsense install script for jetson for docker builds

@lzyang2000 lzyang2000 requested review from Copilot and removed request for Copilot July 4, 2025 21:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new shell script to automate the installation of Intel RealSense (Librealsense) on NVIDIA Jetson devices within Docker environments.

  • Introduces jetson_realsense.sh to set up swap, install dependencies, and build librealsense v2.50.0
  • Suppresses initial device errors, prompts for camera removal, and applies udev rules
  • Cleans and organizes build directory in the user's home
Comments suppressed due to low confidence (1)

scripts/jetson_realsense.sh:6

  • [nitpick] The variable name 'con_dev' is unclear; consider renaming it to something more descriptive like 'video_device_count'.
con_dev=$(ls /dev/video* | wc -l)

Comment on lines +3 to +7
#Locally suppress stderr to avoid raising not relevant messages
exec 3>&2
exec 2> /dev/null
con_dev=$(ls /dev/video* | wc -l)
exec 2>&3
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppressing stderr globally may hide important errors; consider redirecting stderr only for the specific command (e.g., ls /dev/video* 2>/dev/null).

Suggested change
#Locally suppress stderr to avoid raising not relevant messages
exec 3>&2
exec 2> /dev/null
con_dev=$(ls /dev/video* | wc -l)
exec 2>&3
# Suppress stderr for the specific command to avoid raising not relevant messages
con_dev=$(ls /dev/video* 2>/dev/null | wc -l)

Copilot uses AI. Check for mistakes.

if [ $(sudo swapon --show | wc -l) -eq 0 ];
then
echo "No swapon - setting up 1Gb swap file"
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message says '1Gb' but the script allocates 2G of swap; update the text to match the actual size.

Suggested change
echo "No swapon - setting up 1Gb swap file"
echo "No swapon - setting up 2G swap file"

Copilot uses AI. Check for mistakes.

echo Installing Librealsense-required dev packages
sudo apt-get install git cmake libssl-dev freeglut3-dev libusb-1.0-0-dev pkg-config libgtk-3-dev unzip -y
rm -f ./master.zip
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes 'master.zip', but the script downloads 'v2.50.0.zip'; either remove the correct file or drop this line.

Suggested change
rm -f ./master.zip

Copilot uses AI. Check for mistakes.
lsb_release -a
echo "Kernel version $(uname -r)"
sudo apt-get update
cd ~/
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using '~/' may fail if HOME isn’t set; consider using "$HOME" for portability.

Suggested change
cd ~/
cd $HOME/

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants