diff --git a/Nvidia_JTX1/Ubuntu/10_setup_ros.sh b/Nvidia_JTX1/Ubuntu/10_setup_ros.sh new file mode 100755 index 00000000..d727f217 --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/10_setup_ros.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +# this script should be run as the apsync user +# these instructions come from Dan Pollock, posting can be found here: https://www.facebook.com/groups/pixhawk2/permalink/1192680427481244/ + +set -e +set -x + +pushd . + +# setup reference to ros packages +sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' +sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 +sudo apt-get update + +# install ros +sudo apt-get install -y ros-kinetic-ros-base python-rosinstall ros-kinetic-mavros ros-kinetic-rtabmap-ros ros-kinetic-robot-state-publisher +sudo c_rehash /etc/ssl/certs +sudo rosdep init +rosdep update + +# add environment to .bashrc +echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc +source ~/.bashrc + +# install the ZED SDK using 7_setup_zed.sh + +# install zed-ros-wrapper +mkdir -p ~/catkin_zed/src +cd ~/catkin_zed/src +git clone https://github.com/stereolabs/zed-ros-wrapper.git + +# create workspace +# Note: this seems to fail because some ROS variables are not being set +cd ~/catkin_zed/src +/opt/ros/kinetic/bin/catkin_init_workspace +cd ~/catkin_zed +/opt/ros/kinetic/bin/catkin_make + +# kill src directory and build again +rm -rf ~/catkin_zed/src +mkdir -p ~/catkin_zed/src +cd ~/catkin_zed/src +git clone https://github.com/stereolabs/zed-ros-wrapper.git +cd ~/catkin_zed +/opt/ros/kinetic/bin/catkin_make + +popd + +# cp zed_rtabmap_launch file to /opt/ros/kinetic/share/rtabmap_ros/launch +sudo cp ./zed_rtabmap.launch /opt/ros/kinetic/share/rtabmap_ros/launch +# old instructions for above: +# cd to /opt/ros/kinetic/share/rtabmap_ros/launch +# sudo cp /opt/ros/kinetic/share/rtabmap_ros/launch/rtabmap.launch /opt/ros/kinetic/share/rtabmap_ros/launch/zed_rtabmap.launch +# sudo vi /opt/ros/kinetic/share/rtabmap_ros/launch/zed_rtabmap.launch +# replace "/camera/rgb" with "/camera/zed/rgb" + +# put startup scripts in place +mkdir ~/start_ros +cp start_1_roscore.sh ~/start_ros +cp start_2_zed_wrapper.sh ~/start_ros +cp start_3_rosrun.sh ~/start_ros +cp start_4_rtabmap.sh ~/start_ros + +# test rosrun zed_wrapper +# first terminal +# roscore +# second terminal: +# export ROS_NAMESPACE=camera +# source ~/catkin_zed/devel/setup.bash +# roslaunch zed_wrapper zed.launch +# third terminal window: +# export ROS_NAMESPACE=camera +# source ~/catkin_zed/devel/setup.bash +# rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link zed_initial_frame 100 & +# test viewer on client +# roslaunch rtabmap_ros zed_rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/zed/depth/depth_registered diff --git a/Nvidia_JTX1/Ubuntu/7_setup_zed.sh b/Nvidia_JTX1/Ubuntu/7_setup_zed.sh deleted file mode 100755 index f10bd1b7..00000000 --- a/Nvidia_JTX1/Ubuntu/7_setup_zed.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# this script sets up the ZED camera - -# store current directory -pushd . - -# download install scripts from stereolabs -cd ~/Downloads -wget --no-check-certificate https://www.stereolabs.com/download_327af3/ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run - -# install (user will need to press "Q" -echo "Installing ZED camera SDK, you must manually accept the license agreement (press Y), enter root password and press enter to accept the default install directory" -chmod +x ./ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run -./ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run - -# return to stored directory -popd diff --git a/Nvidia_JTX1/Ubuntu/9_setup_zed.sh b/Nvidia_JTX1/Ubuntu/9_setup_zed.sh new file mode 100755 index 00000000..4f1cbef3 --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/9_setup_zed.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# this script sets up the ZED camera +# this should be run as the "apsync" user + +# store current directory +pushd . + +# download install scripts from stereolabs +mkdir -p ~/Downloads +cd ~/Downloads +# wget --no-check-certificate https://www.stereolabs.com/download_327af3/ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run +wget --no-check-certificate https://dl.dropboxusercontent.com/u/3852647/ZED/ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run + +# install (user will need to press "Q" +echo "Installing ZED camera SDK, you must manually accept the license agreement (press Y), enter root password and press enter to accept the default install directory" +chmod +x ./ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run +./ZED_SDK_Linux_JTX1_v1.2.0_64b_JetPack23.run + +# startup zed camera's Depth Viewer to force download of calibration file for this particular camera +# this may require permissioning apsync to use the screen, "sudo xhost +SI:localuser:apsync" +# Note: we should change this to a user runnable script to download the config for each user's camera +/usr/local/zed/tools/ZED \ Depth\ Viewer + +# return to stored directory +popd diff --git a/Nvidia_JTX1/Ubuntu/start_1_roscore.sh b/Nvidia_JTX1/Ubuntu/start_1_roscore.sh new file mode 100755 index 00000000..43c07c5e --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/start_1_roscore.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# start roscore +roscore diff --git a/Nvidia_JTX1/Ubuntu/start_2_zed_wrapper.sh b/Nvidia_JTX1/Ubuntu/start_2_zed_wrapper.sh new file mode 100755 index 00000000..7fabf779 --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/start_2_zed_wrapper.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# start rosrun +export ROS_NAMESPACE=camera +source ~/catkin_zed/devel/setup.bash +roslaunch zed_wrapper zed.launch diff --git a/Nvidia_JTX1/Ubuntu/start_3_rosrun.sh b/Nvidia_JTX1/Ubuntu/start_3_rosrun.sh new file mode 100755 index 00000000..7bc6e70e --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/start_3_rosrun.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# start rosrun +export ROS_NAMESPACE=camera +source ~/catkin_zed/devel/setup.bash +rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link zed_initial_frame 100 & diff --git a/Nvidia_JTX1/Ubuntu/start_4_rtabmap.sh b/Nvidia_JTX1/Ubuntu/start_4_rtabmap.sh new file mode 100755 index 00000000..ad5c3c6a --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/start_4_rtabmap.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# override home in case this is being run from different user +export HOME=/home/apsync + +# start rosrun +export ROS_NAMESPACE=camera +source ~/catkin_zed/devel/setup.bash +roslaunch rtabmap_ros zed_rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/zed/depth/depth_registered diff --git a/Nvidia_JTX1/Ubuntu/zed_rtabmap.launch b/Nvidia_JTX1/Ubuntu/zed_rtabmap.launch new file mode 100644 index 00000000..7a482db6 --- /dev/null +++ b/Nvidia_JTX1/Ubuntu/zed_rtabmap.launch @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +