#パッケージインストール for Ubuntu 16/18/20 LTS
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
sudo apt-get update
sudo apt-get upgrade
#起動確認
realsense-viewer
右上にFirmware Update Recommended!と表示された場合はinstallをクリック
###ROS2関連パッケージインストール
sudo apt-get install ros-foxy-cv-bridge ros-foxy-librealsense2 ros-foxy-message-filters ros-foxy-image-transport
sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install -y libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
mkdir -p ~/realsense_ws/src
cd ~/realsense_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git -b foxy
git clone https://github.com/IntelRealSense/librealsense
cd librealsense/
git checkout remotes/origin/ros2debian
cd ~/realsense_ws/
colcon build
source ~/realsense_ws/install/local_setup.bash
#起動確認(ターミナル1)
ros2 launch realsense2_camera rs_launch.py
#起動確認(ターミナル2)
source ~/realsense_ws/install/local_setup.bash
ros2 run rqt_image_view rqt_image_view