├── LICENSE
├── README.md
├── installROS.sh
└── setupCatkinWorkspace.sh
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # installROSXavier
2 | Install Robot Operating System (ROS) on NVIDIA Jetson AGX Xavier
3 |
4 | These scripts will install Robot Operating System (ROS) on the NVIDIA Jetson AGX Xavier Developer Kit.
5 |
6 | For L4T 31.0.2 (JetPack 4.1)
7 |
8 |
9 | The script is based on the Ubuntu ARM install of ROS Melodic: http://wiki.ros.org/melodic/Installation/Ubuntu
10 |
11 | Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/
12 |
13 | There are two scripts:
14 |
15 | installROS.sh
16 |
17 | Usage: ./installROS.sh [[-p package] | [-h]]
18 | -p | --package <packagename> ROS package to install
19 | Multiple Usage allowed
20 | The first package should be a base package. One of the following:
21 | ros-melodic-ros-base
22 | ros-melodic-desktop
23 | ros-melodic-desktop-full
24 |
25 |
26 | Default is ros-melodic-ros-base if no packages are specified.
27 |
28 | Example Usage:
29 |
30 | $ ./installROS.sh -p ros-melodic-desktop -p ros-melodic-rgbd-launch
31 |
32 | This script installs a baseline ROS environment. There are several tasks:
33 |
34 |
35 | - Enable repositories universe, multiverse, and restricted
36 | - Adds the ROS sources list
37 | - Sets the needed keys
38 | - Loads specified ROS packages, defaults to ros-melodic-base-ros if none specified
39 | - Initializes rosdep
40 |
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 of the workspace to be used. The default workspace name is catkin_ws. This script also sets up some ROS environment variables. Refer to the script for details.
50 |
51 | Note: On June 7, 2019 the GPG key for ROS was changed due to security issues. If you have ROS installed on your system before this, you should delete the GPG key:
52 |
53 |
54 | $ sudo apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116
55 |
56 |
57 |
58 | ## Release Notes
59 | June 2019
60 | * L4T 31.0.2
61 | * Update ROS GPG Key
62 |
63 | October 2018
64 | * Initial Release
65 | * L4T 31.0.2
66 |
67 |
68 | ## License
69 | MIT License
70 |
71 | Copyright (c) 2017-2018 Jetsonhacks
72 |
73 | Permission is hereby granted, free of charge, to any person obtaining a copy
74 | of this software and associated documentation files (the "Software"), to deal
75 | in the Software without restriction, including without limitation the rights
76 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77 | copies of the Software, and to permit persons to whom the Software is
78 | furnished to do so, subject to the following conditions:
79 |
80 | The above copyright notice and this permission notice shall be included in all
81 | copies or substantial portions of the Software.
82 |
83 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
84 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
85 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
86 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
88 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
89 | SOFTWARE.
90 |
91 |
--------------------------------------------------------------------------------
/installROS.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Robot Operating System (ROS) on NVIDIA Jetson AGX Xavier
3 | # Maintainer of ARM builds for ROS is http://answers.ros.org/users/1034/ahendrix/
4 | # Information from:
5 | # http://wiki.ros.org/melodic/Installation/UbuntuARM
6 |
7 | # Red is 1
8 | # Green is 2
9 | # Reset is sgr0
10 |
11 | function usage
12 | {
13 | echo "Usage: ./installROS.sh [[-p package] | [-h]]"
14 | echo "Install ROS Melodic"
15 | echo "Installs ros-melodic-ros-base as default base package; Use -p to override"
16 | echo "-p | --package ROS package to install"
17 | echo " Multiple usage allowed"
18 | echo " Must include one of the following:"
19 | echo " ros-melodic-ros-base"
20 | echo " ros-melodic-desktop"
21 | echo " ros-melodic-desktop-full"
22 | echo "-h | --help This message"
23 | }
24 |
25 | function shouldInstallPackages
26 | {
27 | tput setaf 1
28 | echo "Your package list did not include a recommended base package"
29 | tput sgr0
30 | echo "Please include one of the following:"
31 | echo " ros-melodic-ros-base"
32 | echo " ros-melodic-desktop"
33 | echo " ros-melodic-desktop-full"
34 | echo ""
35 | echo "ROS not installed"
36 | }
37 |
38 | # Iterate through command line inputs
39 | packages=()
40 | while [ "$1" != "" ]; do
41 | case $1 in
42 | -p | --package ) shift
43 | packages+=("$1")
44 | ;;
45 | -h | --help ) usage
46 | exit
47 | ;;
48 | * ) usage
49 | exit 1
50 | esac
51 | shift
52 | done
53 | # Check to see if other packages were specified
54 | # If not, set the default base package
55 | if [ ${#packages[@]} -eq 0 ] ; then
56 | packages+="ros-melodic-ros-base"
57 | fi
58 | echo "Packages to install: "${packages[@]}
59 | # Check to see if we have a ROS base kinda thingie
60 | hasBasePackage=false
61 | for package in "${packages[@]}"; do
62 | if [[ $package == "ros-melodic-ros-base" ]]; then
63 | hasBasePackage=true
64 | break
65 | elif [[ $package == "ros-melodic-desktop" ]]; then
66 | hasBasePackage=true
67 | break
68 | elif [[ $package == "ros-melodic-desktop-full" ]]; then
69 | hasBasePackage=true
70 | break
71 | fi
72 | done
73 | if [ $hasBasePackage == false ] ; then
74 | shouldInstallPackages
75 | exit 1
76 | fi
77 |
78 | # Let's start installing!
79 |
80 | tput setaf 2
81 | echo "Adding repository and source list"
82 | tput sgr0
83 | sudo apt-add-repository universe
84 | sudo apt-add-repository multiverse
85 | sudo apt-add-repository restricted
86 |
87 | # Setup sources.lst
88 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
89 | # Setup keys
90 | sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
91 | # If you experience issues connecting to the keyserver, you can try substituting hkp://pgp.mit.edu:80 or hkp://keyserver.ubuntu.com:80 in the previous command.
92 | # Installation
93 | tput setaf 2
94 | echo "Updating apt-get"
95 | tput sgr0
96 | sudo apt-get update
97 | tput setaf 2
98 | echo "Installing ROS"
99 | tput sgr0
100 | # This is where you might start to modify the packages being installed, i.e.
101 | # sudo apt-get install ros-melodic-desktop
102 |
103 | # Here we loop through any packages passed on the command line
104 | # Install packages ...
105 | for package in "${packages[@]}"; do
106 | sudo apt-get install $package -y
107 | done
108 |
109 | # Add Individual Packages here
110 | # You can install a specific ROS package (replace underscores with dashes of the package name):
111 | # sudo apt-get install ros-melodic-PACKAGE
112 | # e.g.
113 | # sudo apt-get install ros-melodic-navigation
114 | #
115 | # To find available packages:
116 | # apt-cache search ros-melodic
117 | #
118 | # Initialize rosdep
119 | tput setaf 2
120 | echo "Installing rosdep"
121 | tput sgr0
122 | sudo apt-get install python-rosdep -y
123 | # Certificates are messed up on earlier version Jetson for some reason
124 | # Do not know if it is an issue with the Xavier, test by commenting out
125 | # sudo c_rehash /etc/ssl/certs
126 | # Initialize rosdep
127 | tput setaf 2
128 | echo "Initializaing rosdep"
129 | tput sgr0
130 | sudo rosdep init
131 | # To find available packages, use:
132 | rosdep update
133 | # Environment Setup - Don't add /opt/ros/melodic/setup.bash if it's already in bashrc
134 | grep -q -F 'source /opt/ros/melodic/setup.bash' ~/.bashrc || echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
135 | source ~/.bashrc
136 | # Install rosinstall
137 | tput setaf 2
138 | echo "Installing rosinstall tools"
139 | tput sgr0
140 | sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential -y
141 | tput setaf 2
142 | echo "Installation complete!"
143 | tput sgr0
144 |
145 |
--------------------------------------------------------------------------------
/setupCatkinWorkspace.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Create a Catkin Workspace and setup ROS environment variables
3 | # Usage setupCatkinWorkspace.sh dirName
4 |
5 | source /opt/ros/melodic/setup.bash
6 | DEFAULTDIR=~/catkin_ws
7 | CLDIR="$1"
8 | if [ ! -z "$CLDIR" ]; then
9 | DEFAULTDIR=~/"$CLDIR"
10 | fi
11 | if [ -e "$DEFAULTDIR" ] ; then
12 | echo "$DEFAULTDIR already exists; no action taken"
13 | exit 1
14 | else
15 | echo "Creating Catkin Workspace: $DEFAULTDIR"
16 | fi
17 | echo "$DEFAULTDIR"/src
18 | mkdir -p "$DEFAULTDIR"/src
19 | cd "$DEFAULTDIR"/src
20 | catkin_init_workspace
21 | cd "$DEFAULTDIR"
22 | catkin_make
23 |
24 |
25 | #setup ROS environment variables
26 | grep -q -F ' ROS_MASTER_URI' ~/.bashrc || echo 'export ROS_MASTER_URI=http://localhost:11311' | tee -a ~/.bashrc
27 | grep -q -F ' ROS_IP' ~/.bashrc || echo "export ROS_IP=$(hostname -I)" | tee -a ~/.bashrc
28 | echo "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
29 |
30 | echo "The Catkin Workspace has been created"
31 | echo "Please modify the placeholders for ROS_MASTER_URI and ROS_IP placed into the file ${HOME}/.bashrc"
32 | echo "to suit your environment."
33 |
34 |
--------------------------------------------------------------------------------