├── LICENSE ├── setupCatkinWorkspace.sh ├── README.md └── installROS.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2019 JetsonHacks 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /setupCatkinWorkspace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Create a Catkin Workspace 3 | # Copyright (c) JetsonHacks, 2019-2021 4 | 5 | # MIT License 6 | # Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/ 7 | # Information from: 8 | # http://wiki.ros.org/melodic/Installation/UbuntuARM 9 | # 10 | 11 | source /opt/ros/melodic/setup.bash 12 | 13 | # Usage setupCatkinWorkspace.sh dirName 14 | help_usage () 15 | { 16 | echo "Usage: ./setupCatkinWorkspac.sh " 17 | echo " Setup a Catkin Workspace at the path indicated" 18 | echo " Default path is ~/catkin_ws" 19 | echo " -h | --help This message" 20 | exit 0 21 | } 22 | 23 | CATKIN_DIR="" 24 | case $1 in 25 | -h | --help) help_usage ;; 26 | *) CATKIN_DIR="$1" ;; 27 | esac 28 | 29 | 30 | CATKIN_DIR=${CATKIN_DIR:="${HOME}/catkin_ws"} 31 | 32 | if [ -e "$CATKIN_DIR" ] ; then 33 | echo "$CATKIN_DIR already exists; no action taken" 34 | exit 1 35 | else 36 | echo "Creating Catkin Workspace: $CATKIN_DIR" 37 | fi 38 | echo "$CATKIN_DIR"/src 39 | mkdir -p "$CATKIN_DIR"/src 40 | cd "$CATKIN_DIR"/src 41 | catkin_init_workspace 42 | cd .. 43 | catkin_make 44 | 45 | 46 | echo "Catkin workspace: $CATKIN_DIR created" 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # installROS 2 | Install Robot Operating System (ROS) Melodic on NVIDIA Jetson Developer Kits 3 | 4 | These scripts will install Robot Operating System (ROS) Melodic on the NVIDIA Jetson Developer Kits. 5 | 6 | Jetson Nano, Jetson AGX Xavier, Jetson Xavier NX, Jetson TX2, Jetson TX1 7 | 8 | The script is based on the Ubuntu ARM install of ROS Melodic: http://wiki.ros.org/melodic/Installation/Ubuntu 9 | 10 | Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/ 11 | 12 | There are two scripts: 13 | 14 | installROS.sh 15 |
 16 | Usage: ./installROS.sh  [[-p package] | [-h]]
 17 |  -p | --package <packagename>  ROS package to install
 18 |                                Multiple Usage allowed
 19 |                                The first package should be a base package. One of the following:
 20 |                                  ros-melodic-ros-base
 21 |                                  ros-melodic-desktop
 22 |                                  ros-melodic-desktop-full
 23 |  
24 | 25 | Default is ros-melodic-ros-base if no packages are specified. 26 | 27 | Example Usage: 28 | 29 | `$ ./installROS.sh -p ros-melodic-desktop -p ros-melodic-rgbd-launch` 30 | 31 | This script installs a baseline ROS environment. There are several tasks: 32 | 33 | * Enable repositories universe, multiverse, and restricted 34 | * Adds the ROS sources list 35 | * Sets the needed keys 36 | * Loads specified ROS packages, defaults to ros-melodic-base-ros if none specified 37 | * Initializes rosdep 38 | * Sets up `ROS_MASTER_URI` and `ROS_IP` in the `~/.bashrc` file 39 | 40 | _**Note:** You will need to check your `~/.bashrc` file to make sure the ROS_MASTER_URI and ROS_IP are setup correctly for your environment. During configuration, a best guess is made which should be considered a placeholder._ 41 | 42 | You can edit this file to add the ROS packages for your application. 43 | 44 | **setupCatkinWorkspace.sh** 45 | Usage: 46 | 47 | `$ ./setupCatkinWorkspace.sh [_optionalWorkspaceName_]` 48 | 49 | where _optionalWorkspaceName_ is the name and path of the workspace to be used. The default workspace name is `~/catkin_ws`. 50 | 51 | 52 | ## Release Notes 53 | 54 | ### September, 2021 55 | * v1.1 56 | * Tested on L4T 32.6.1 (JetPack 4.6) 57 | * Update ROS GPG Key 58 | * Setup ROS_IP more intelligently 59 | * Setup ROS_MASTER_URI and ROS_IP in installROS script instead of setupCatkinWorkspace 60 | * Script wrangling and cleanup 61 | * Should be the same as JetsonHacks/installROS 62 | 63 | October 2019 64 | * vL4T32.2.1 65 | * L4T 32.2.1 (JetPack 4.2.2) 66 | 67 | July 2019 68 | * vL4T32.2 69 | * L4T 32.2 (JetPack 4.2.1) 70 | 71 | June 2019 72 | * vL4T32.1.0 73 | * L4T 32.1.0 (JetPack 4.2) 74 | * Update ROS server GPG key 75 | 76 | March 2019 77 | * Initial Release 78 | * L4T 32.1.0 (JetPack 4.2) 79 | 80 | 81 | ## License 82 | MIT License 83 | 84 | Copyright (c) 2017-2021 JetsonHacks 85 | 86 | Permission is hereby granted, free of charge, to any person obtaining a copy 87 | of this software and associated documentation files (the "Software"), to deal 88 | in the Software without restriction, including without limitation the rights 89 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 90 | copies of the Software, and to permit persons to whom the Software is 91 | furnished to do so, subject to the following conditions: 92 | 93 | The above copyright notice and this permission notice shall be included in all 94 | copies or substantial portions of the Software. 95 | 96 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 97 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 98 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 99 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 100 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 101 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 102 | SOFTWARE. 103 | 104 | -------------------------------------------------------------------------------- /installROS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Install ROS on NVIDIA Jetson Developer Kits 3 | # Copyright (c) JetsonHacks, 2019-2021 4 | 5 | # MIT License 6 | # Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/ 7 | # Information from: 8 | # http://wiki.ros.org/melodic/Installation/UbuntuARM 9 | 10 | # Get code name of distribution 11 | # lsb_release gets the Ubuntu Description Release and Code name 12 | DISTRIBUTION_CODE_NAME=$( lsb_release -sc ) 13 | 14 | case $DISTRIBUTION_CODE_NAME in 15 | "xenial" ) 16 | echo "This Ubuntu distribution is Ubuntu Xenial (16.04)" 17 | echo "This install is not the ROS recommended version for Ubuntu Xenial." 18 | echo "ROS Bionic is the recommended version." 19 | echo "This script installs ROS Melodic. You will need to modify it for your purposes." 20 | exit 0 21 | ;; 22 | "bionic") 23 | echo "This Ubuntu distribution is Ubuntu Bionic (18.04)" 24 | echo "Installing ROS Melodic" 25 | ;; 26 | *) 27 | echo "This distribution is $DISTRIBUTION_CODE_NAME" 28 | echo "This script will only work with Ubuntu Xenial (16.04) or Bionic (18.04)" 29 | exit 0 30 | esac 31 | 32 | # Install Robot Operating System (ROS) on NVIDIA Jetson Developer Kit 33 | # Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/ 34 | # Information from: 35 | # http://wiki.ros.org/melodic/Installation/UbuntuARM 36 | 37 | # Red is 1 38 | # Green is 2 39 | # Reset is sgr0 40 | 41 | usage () 42 | { 43 | echo "Usage: ./installROS.sh [[-p package] | [-h]]" 44 | echo "Install ROS Melodic" 45 | echo "Installs ros-melodic-ros-base as default base package; Use -p to override" 46 | echo "-p | --package ROS package to install" 47 | echo " Multiple usage allowed" 48 | echo " Must include one of the following:" 49 | echo " ros-melodic-ros-base" 50 | echo " ros-melodic-desktop" 51 | echo " ros-melodic-desktop-full" 52 | echo "-h | --help This message" 53 | } 54 | 55 | shouldInstallPackages () 56 | { 57 | tput setaf 1 58 | echo "Your package list did not include a recommended base package" 59 | tput sgr0 60 | echo "Please include one of the following:" 61 | echo " ros-melodic-ros-base" 62 | echo " ros-melodic-desktop" 63 | echo " ros-melodic-desktop-full" 64 | echo "" 65 | echo "ROS not installed" 66 | } 67 | 68 | # Iterate through command line inputs 69 | packages=() 70 | while [ "$1" != "" ]; do 71 | case $1 in 72 | -p | --package ) shift 73 | packages+=("$1") 74 | ;; 75 | -h | --help ) usage 76 | exit 77 | ;; 78 | * ) usage 79 | exit 1 80 | esac 81 | shift 82 | done 83 | # Check to see if other packages were specified 84 | # If not, set the default base package 85 | if [ ${#packages[@]} -eq 0 ] ; then 86 | packages+="ros-melodic-ros-base" 87 | fi 88 | echo "Packages to install: "${packages[@]} 89 | # Check to see if we have a ROS base kinda thingie 90 | hasBasePackage=false 91 | for package in "${packages[@]}"; do 92 | if [[ $package == "ros-melodic-ros-base" ]]; then 93 | hasBasePackage=true 94 | break 95 | elif [[ $package == "ros-melodic-desktop" ]]; then 96 | hasBasePackage=true 97 | break 98 | elif [[ $package == "ros-melodic-desktop-full" ]]; then 99 | hasBasePackage=true 100 | break 101 | fi 102 | done 103 | if [ $hasBasePackage == false ] ; then 104 | shouldInstallPackages 105 | exit 1 106 | fi 107 | 108 | # Let's start installing! 109 | 110 | tput setaf 2 111 | echo "Adding repository and source list" 112 | tput sgr0 113 | sudo apt-add-repository universe 114 | sudo apt-add-repository multiverse 115 | sudo apt-add-repository restricted 116 | tput setaf 2 117 | echo "Updating apt list" 118 | tput sgr0 119 | sudo apt update 120 | 121 | # Setup sources.lst 122 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 123 | # Setup keys 124 | sudo apt install curl 125 | curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - 126 | 127 | tput setaf 2 128 | echo "Updating apt list" 129 | tput sgr0 130 | sudo apt update 131 | 132 | tput setaf 2 133 | echo "Installing ROS" 134 | tput sgr0 135 | # This is where you might start to modify the packages being installed, i.e. 136 | # sudo apt-get install ros-melodic-desktop 137 | 138 | # Here we loop through any packages passed on the command line 139 | # Install packages ... 140 | for package in "${packages[@]}"; do 141 | sudo apt-get install $package -y 142 | done 143 | 144 | # Add Individual Packages here 145 | # You can install a specific ROS package (replace underscores with dashes of the package name): 146 | # sudo apt-get install ros-melodic-PACKAGE 147 | # e.g. 148 | # sudo apt-get install ros-melodic-navigation 149 | # 150 | # To find available packages: 151 | # apt-cache search ros-melodic 152 | # 153 | # Initialize rosdep 154 | tput setaf 2 155 | echo "Installing rosdep" 156 | tput sgr0 157 | sudo apt-get install python-rosdep -y 158 | # Initialize rosdep 159 | tput setaf 2 160 | echo "Initializaing rosdep" 161 | tput sgr0 162 | sudo rosdep init 163 | # To find available packages, use: 164 | rosdep update 165 | # Environment Setup - source melodic setup.bash 166 | # Don't add /opt/ros/melodic/setup.bash if it's already in bashrc 167 | grep -q -F 'source /opt/ros/melodic/setup.bash' ~/.bashrc || echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc 168 | source ~/.bashrc 169 | # Install rosinstall 170 | tput setaf 2 171 | echo "Installing rosinstall tools" 172 | tput sgr0 173 | 174 | # Install useful ROS dev tools 175 | sudo apt-get install -y python-rosinstall \ 176 | python-rosinstall-generator \ 177 | python-wstool \ 178 | build-essential 179 | 180 | # Use ip to get the current IP addresses of eth0 and wlan0; parse into form xx.xx.xx.xx 181 | ETH0_IPADDRESS=$(ip -4 -o addr show eth0 | awk '{print $4}' | cut -d "/" -f 1) 182 | WLAN_IPADDRESS=$(ip -4 -o addr show wlan0 | awk '{print $4}' | cut -d "/" -f 1) 183 | 184 | if [ -z "$ETH0_IPADDRESS" ] ; then 185 | echo "Ethernet (eth0) is not available" 186 | else 187 | echo "Ethernet (eth0) is $ETH0_IPADDRESS" 188 | fi 189 | if [ -z "$WLAN_IPADDRESS" ] ; then 190 | echo "Wireless (wlan0) is not available" 191 | else 192 | echo "Wireless (wlan0) ip address is $WLAN_IPADDRESS" 193 | fi 194 | 195 | # Default to eth0 if available; wlan0 next 196 | ROS_IP_ADDRESS="" 197 | if [ ! -z "$ETH0_IPADDRESS" ] ; then 198 | ROS_IP_ADDRESS=$ETH0_IPADDRESS 199 | else 200 | ROS_IP_ADDRESS=$WLAN_IPADDRESS 201 | fi 202 | if [ ! -z "$ROS_IP_ADDRESS" ] ; then 203 | echo "Setting ROS_IP in ${HOME}/.bashrc to: $ROS_IP_ADDRESS" 204 | else 205 | echo "Setting ROS_IP to empty. Please change ROS_IP in the ${HOME}/.bashrc file" 206 | fi 207 | 208 | #setup ROS environment variables 209 | grep -q -F ' ROS_MASTER_URI' ~/.bashrc || echo 'export ROS_MASTER_URI=http://localhost:11311' | tee -a ~/.bashrc 210 | grep -q -F ' ROS_IP' ~/.bashrc || echo "export ROS_IP=${ROS_IP_ADDRESS}" | tee -a ~/.bashrc 211 | tput setaf 2 212 | 213 | echo "Installation complete!" 214 | echo "Please setup your Catkin Workspace and ~/.bashrc file" 215 | tput sgr0 216 | --------------------------------------------------------------------------------