├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── azure_kinect_dk_install.sh ├── config_cuda.sh ├── config_ssh.sh ├── config_static_ip.sh ├── config_udev_rules.sh ├── config_vpn_ssh_port.sh ├── isaacsim_python_assistant.sh ├── jetson_best_performance_install_v512.sh ├── moveit1_install.sh ├── orbbec_femto_bolt_ros1_install.sh ├── orbbec_femto_bolt_ros2_install.sh ├── realsense_d400_series_install.sh ├── realsense_install_nvidia.sh ├── ros1_noetic_install.sh ├── ros2_humble_install.sh └── test_cuda.py /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to My Project 2 | 3 | Thank you for your interest in contributing to My Project! Here are some guidelines to help you get started. 4 | 5 | ## Reporting Bugs 6 | 7 | If you find a bug in the project, please open an issue on GitHub and provide as much detail as possible about the problem, including steps to reproduce it. 8 | 9 | ## Suggesting Features 10 | 11 | If you have an idea for a new feature or improvement to the project, please open an issue on GitHub and describe your suggestion in detail. 12 | 13 | ## Submitting Code Changes 14 | 15 | If you want to contribute code changes to the project, please follow these steps: 16 | 17 | 1. Fork the repository on GitHub. 18 | 2. Create a new branch for your changes. 19 | 3. Make your changes and commit them to your branch. 20 | 4. Push your branch to your fork on GitHub. 21 | 5. Open a pull request on the main repository and describe your changes in detail. 22 | 23 | We appreciate all contributions to My Project and will review pull requests as quickly as possible. Thank you for your help! 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![ROS1 VERSION](https://img.shields.io/badge/ROS1-Noetic-green)](http://wiki.ros.org/noetic)   2 | [![Ubuntu for ROS1](https://img.shields.io/badge/Ubuntu-20.04-green)](https://ubuntu.com/)   3 | [![ROS2 VERSION](https://img.shields.io/badge/ROS2-Humble-brightgreen)](http://docs.ros.org/en/humble/index.html)   4 | [![Ubuntu_for_ROS2](https://img.shields.io/badge/Ubuntu-22.04-brightgreen)](https://ubuntu.com/)   5 | [![LICENSE](https://img.shields.io/badge/license-Apache--2.0-informational)](https://github.com/mangdangroboticsclub/gpt4_ros2/blob/main/LICENSE)   6 | 7 | # ros-install-one-click 8 | 9 | This is a collection of one-click shell scripts for installing and using common tools for robotics, including ROS1, ROS2, camera, MoveIt, and simulators. 10 | 11 | With these scripts, you can install ROS and other tools with one click, and then use robot tools conveniently with the help of the scripts. 12 | 13 | ## ROS 1 Noetic Installation 14 | 15 | To install `ROS1 Noetic` with a single command, copy and execute the following command in the terminal: 16 | 17 | ```bash 18 | wget -O $HOME/ros1_noetic_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/ros1_noetic_install.sh && sudo chmod +x $HOME/ros1_noetic_install.sh && sudo bash $HOME/ros1_noetic_install.sh && rm $HOME/ros1_noetic_install.sh 19 | ``` 20 | 21 | ## ROS 2 Humble Installation 22 | 23 | To install `ROS2 Humble` with a single command, copy and execute the following command in the terminal: 24 | 25 | ```bash 26 | wget -O $HOME/ros2_humble_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/ros2_humble_install.sh && sudo chmod +x $HOME/ros2_humble_install.sh && bash $HOME/ros2_humble_install.sh && rm $HOME/ros2_humble_install.sh 27 | ``` 28 | 29 | ## MoveIt 1 Installation 30 | 31 | To install `MoveIt for ROS1 Noetic` with a single command, copy and execute the following command in the terminal: 32 | 33 | ```bash 34 | wget -O $HOME/moveit1_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/moveit1_install.sh && sudo chmod +x $HOME/moveit1_install.sh && sudo bash $HOME/moveit1_install.sh && rm $HOME/moveit1_install.sh 35 | ``` 36 | 37 | ## Intel realsense D400 series camera Installation 38 | 39 | To install `realsense D400 series camera` with a single command, copy and execute the following command in the terminal: 40 | 41 | ```bash 42 | wget -O $HOME/realsense_d400_series_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/realsense_d400_series_install.sh && sudo chmod +x $HOME/realsense_d400_series_install.sh && bash $HOME/realsense_d400_series_install.sh 43 | ``` 44 | 45 | To install `Realsense for Nvidia Jetson Orin` with a single command, copy and execute the following command in the terminal: 46 | 47 | ```bash 48 | wget -O $HOME/realsense_install_nvidia.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/realsense_install_nvidia.sh && sudo chmod +x $HOME/realsense_install_nvidia.sh && bash $HOME/realsense_install_nvidia.sh && rm $HOME/realsense_install_nvidia.sh 49 | ``` 50 | 51 | ## Orbbec Femto Bolt Installation 52 | 53 | To install `Orbbec Femto Bolt Camera ROS1 Noetic version` with a single command, copy and execute the following command in the terminal: 54 | 55 | ```bash 56 | wget -O $HOME/orbbec_femto_bolt_ros1_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/orbbec_femto_bolt_ros1_install.sh && sudo chmod +x $HOME/orbbec_femto_bolt_ros1_install.sh && bash $HOME/orbbec_femto_bolt_ros1_install.sh && rm $HOME/orbbec_femto_bolt_ros1_install.sh 57 | ``` 58 | 59 | To install `Orbbec Femto Bolt Camera ROS2 Humble version` with a single command, copy and execute the following command in the terminal: 60 | 61 | ```bash 62 | wget -O $HOME/orbbec_femto_bolt_ros2_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/orbbec_femto_bolt_ros2_install.sh && sudo chmod +x $HOME/orbbec_femto_bolt_ros2_install.sh && bash $HOME/orbbec_femto_bolt_ros2_install.sh && rm $HOME/orbbec_femto_bolt_ros2_install.sh 63 | ``` 64 | 65 | ### Microsoft Azure Kinect DK Installation 66 | 67 | To install `Azure Kinect DK` with a single command, copy and execute the following command in the terminal: 68 | 69 | ```bash 70 | wget -O $HOME/azure_kinect_dk_install.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/azure_kinect_dk_install.sh && sudo chmod +x $HOME/azure_kinect_dk_install.sh && bash $HOME/azure_kinect_dk_install.sh 71 | ``` 72 | 73 | ### Isaac Sim python assistant 74 | 75 | The `Isaac Sim python assistant` script facilitates the execution of an Isaac Sim standalone Python script provided by the user. 76 | 77 | ```bash 78 | # Go to your isaac sim standalone python directory 79 | cd 80 | # Download the script 81 | wget https://raw.githubusercontent.com/auromix/ros-install-one-click/main/isaacsim_python_assistant.sh 82 | # Grant execute permission 83 | chmod +x isaacsim_python_assistant.sh 84 | ``` 85 | 86 | ```bash 87 | # Go to your isaac sim standalone python directory 88 | cd 89 | # Run the script to launch your isaac sim standalone python file 90 | ./isaacsim_python_assistant.sh 91 | ``` 92 | 93 | ### Config Static IP 94 | 95 | This script provides a command-line method to configure a static IP address for an Ethernet interface on a robot. It is particularly useful when a graphical user interface (GUI) is not easily accessible or feasible. 96 | 97 | ```bash 98 | ./config_static_ip.sh 99 | ``` 100 | 101 | ### Config SSH for github 102 | 103 | This script provides a command-line method to configure SSH for github. 104 | 105 | ```bash 106 | script_name="config_ssh.sh" && directory_name="/tmp" && full_script_path="${directory_name}/${script_name}" && wget -O $full_script_path https://raw.githubusercontent.com/auromix/ros-install-one-click/main/$script_name && sudo chmod +x $full_script_path && bash $full_script_path && rm -rf $full_script_path 107 | ``` 108 | 109 | ### Config VPN SSH Port 110 | 111 | If you are using a VPN on router and need to access GitHub via SSH, you will likely need to reconfigure the SSH port. 112 | 113 | ```bash 114 | ./ config_vpn_ssh_port.sh 115 | ``` 116 | 117 | ### Improve Jetson performance 118 | 119 | To install the best performance setup and basic development environment for NVIDIA Jetson AGX Orin with a single command, copy and execute the following command in the terminal: 120 | 121 | ```bash 122 | wget -O $HOME/jetson_best_performance_install_v512.sh https://raw.githubusercontent.com/auromix/ros-install-one-click/main/jetson_best_performance_install_v512.sh && sudo chmod +x $HOME/jetson_best_performance_install_v512.sh && bash $HOME/jetson_best_performance_install_v512.sh 123 | ``` 124 | 125 | ### Config UDev Rules 126 | The config_udev_rules.sh script simplifies the creation of udev rules to assign persistent, user-friendly names (symlinks) to devices connected to your system. It guides you through identifying new devices, extracting udev information, and generating a custom rule to ensure consistent device naming. 127 | ```bash 128 | script_name="config_udev_rules.sh" && directory_name="/tmp" && full_script_path="${directory_name}/${script_name}" && wget -O $full_script_path https://raw.githubusercontent.com/auromix/ros-install-one-click/main/$script_name && sudo chmod +x $full_script_path && sudo bash $full_script_path && rm -rf $full_script_path 129 | ``` 130 | 131 | ### Config CUDA 132 | 133 | Run the script to configure your CUDA after CUDA installation. 134 | ```bash 135 | script_name="config_cuda.sh" && directory_name="/tmp" && download_url="https://raw.githubusercontent.com/auromix/ros-install-one-click/main" && full_script_path="${directory_name}/${script_name}" && wget -O $full_script_path $download_url/$script_name && sudo chmod +x $full_script_path && bash $full_script_path && rm -rf $full_script_path 136 | ``` 137 | ### Test CUDA and Torch 138 | 139 | This script test your CUDA and Pytorch environment. 140 | 141 | ```bash 142 | wget https://raw.githubusercontent.com/auromix/ros-install-one-click/main/test_cuda.py && python3 test_cuda.py 143 | ``` 144 | 145 | ### Config Vs Code for Isaac Sim dev 146 | 147 | Run the script in the top-level directory of your workspace to set up the Isaac Sim environment for VS Code, enabling the IDE to recognize the Isaac Sim package. 148 | ```bash 149 | script_name="setup_isaac_sim_ide_environment.sh" && directory_name="/tmp" && download_url="https://raw.githubusercontent.com/Auromix/auro_sim/main/scripts" && full_script_path="${directory_name}/${script_name}" && wget -O $full_script_path $download_url/$script_name && sudo chmod +x $full_script_path && bash $full_script_path && rm -rf $full_script_path 150 | ``` 151 | 152 | -------------------------------------------------------------------------------- /azure_kinect_dk_install.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Herman Ye @Auromix 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # Description: This script automates the installation of Azure Kinect DK on Ubuntu 20.04. 16 | # Version: 1.1 17 | # Date: 2023-08-14 18 | # Author: Herman Ye @Auromix 19 | # set -x 20 | set -e 21 | 22 | # Download key and add to system key list 23 | curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - 24 | 25 | # Add Microsoft Ubuntu18.04 packages list to source 26 | curl -sSL https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list 27 | 28 | # Update software source 29 | sudo apt update -y 30 | 31 | # Upgrade software 32 | sudo apt upgrade -y 33 | 34 | # Install package of Microsoft 35 | # sudo apt install libk4a1.3-dev -y 36 | # sudo apt install libk4abt1.0-dev -y 37 | # sudo apt install k4a-tools=1.3.0 -y 38 | sudo apt install wget -y 39 | cd /tmp 40 | wget https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3/libk4a1.3_1.3.0_amd64.deb 41 | wget https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0/libk4abt1.0_1.0.0_amd64.deb 42 | wget https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3-dev/libk4a1.3-dev_1.3.0_amd64.deb 43 | wget https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0-dev/libk4abt1.0-dev_1.0.0_amd64.deb 44 | wget https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod/pool/main/k/k4a-tools/k4a-tools_1.3.0_amd64.deb 45 | wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsoundio/libsoundio1_1.0.2-1_amd64.deb 46 | # [libk4a1.3-dev](https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3-dev) 47 | # [libk4abt1.0-dev](https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0-dev/) 48 | # [k4a-tools](https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod/pool/main/k/k4a-tools/) 49 | sudo dpkg -i libk4a1.3_1.3.0_amd64.deb 50 | sudo dpkg -i libk4abt1.0_1.0.0_amd64.deb 51 | sudo dpkg -i libk4a1.3-dev_1.3.0_amd64.deb 52 | sudo dpkg -i libk4abt1.0-dev_1.0.0_amd64.deb 53 | sudo dpkg -i libsoundio1_1.0.2-1_amd64.deb 54 | sudo dpkg -i k4a-tools_1.3.0_amd64.deb 55 | 56 | # Forbidden the DK related package to update to keep specific version 57 | sudo apt-mark hold libk4a1.3 58 | sudo apt-mark hold libk4a1.3-dev 59 | sudo apt-mark hold libk4abt1.0 60 | sudo apt-mark hold libk4abt1.0-dev 61 | sudo apt-mark hold k4a-tools 62 | 63 | # Add current user to plugdev user group 64 | sudo usermod -aG plugdev $USER 65 | 66 | # Write DK rules to /etc/udev/rules.d 67 | UDEV_RULES_FILE="/etc/udev/rules.d/99-k4a.rules" 68 | sudo tee $UDEV_RULES_FILE > /dev/null < /dev/null 100 | done 101 | 102 | sleep 3 103 | 104 | for port in $(lspci | grep USB | cut -d' ' -f1); do 105 | echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind > /dev/null 106 | done 107 | 108 | # K4a Test 109 | echo "" 110 | echo "Azure Kinect DK installed successfully!" 111 | read -n 1 -s -r -p "Press any key to open K4A Viewer for testing..." 112 | k4aviewer 113 | 114 | 115 | -------------------------------------------------------------------------------- /config_cuda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023-2024 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for Configuring CUDA env. 19 | # Version: 1.0 20 | # Date: 2024-07-11 21 | # Author: Herman Ye @Auromix 22 | # 23 | # set -x 24 | # set -e 25 | 26 | # Prompt the user to enter the CUDA version 27 | read -p "Please enter the CUDA version (e.g., 11.8): " CUDA_TO_SET 28 | 29 | # Remove existing CUDA settings 30 | sed -i '/# CUDA SETTINGS/d' ~/.bashrc 31 | sed -i '/export CUDA_HOME/d' ~/.bashrc 32 | sed -i '/export PATH=\/usr\/local\/cuda/d' ~/.bashrc 33 | sed -i '/export LD_LIBRARY_PATH=\/usr\/local\/cuda/d' ~/.bashrc 34 | 35 | # Add new CUDA settings 36 | echo "# CUDA SETTINGS" >> ~/.bashrc 37 | echo "export CUDA_HOME=/usr/local/cuda-$CUDA_TO_SET" >> ~/.bashrc 38 | echo "export PATH=/usr/local/cuda-$CUDA_TO_SET/bin:\$PATH" >> ~/.bashrc 39 | echo "export LD_LIBRARY_PATH=/usr/local/cuda-$CUDA_TO_SET/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc 40 | 41 | # Apply the new settings immediately 42 | source ~/.bashrc 43 | 44 | echo "CUDA version $CUDA_TO_SET has been configured" 45 | -------------------------------------------------------------------------------- /config_ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2024 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for Setting up SSH Keys for github. 19 | # Version: 1.0 20 | # Date: 2024-04-15 21 | # Author: Herman Ye @Auromix 22 | # 23 | # set -x 24 | set -e 25 | 26 | # Install xclip 27 | sudo apt install xclip -y 28 | 29 | # Set variables 30 | key_file="ssh_for_auromix_ed25519" 31 | key_type="ed25519" 32 | key_email="auromixsshautoconfigemail@icloud.com" 33 | github_ssh_site="https://github.com/settings/ssh/new" 34 | 35 | # Remove existing SSH key 36 | if [ -f "$HOME/.ssh/$key_file" ]; then 37 | rm "$HOME/.ssh/$key_file" 38 | echo "Existing SSH key has been removed." 39 | fi 40 | # Execute ssh-keygen command and simulate user input 41 | echo -e "\n\n\n" | ssh-keygen -t $key_type -C $key_email -f "$HOME/.ssh/$key_file" -N "" 42 | 43 | # Output prompt 44 | echo "SSH key has been generated and saved in $HOME/.ssh/$key_file." 45 | 46 | # Enable ssh agent 47 | eval "$(ssh-agent -s)" 48 | 49 | # Add private key to ssh-agent 50 | ssh-add "$HOME/.ssh/$key_file" 51 | 52 | # Output prompt 53 | echo "SSH private key has been added to ssh-agent." 54 | 55 | # Copy public key to clipboard 56 | echo " " 57 | cat "$HOME/.ssh/$key_file.pub" | xclip -selection clipboard 58 | echo "Public key has been copied to clipboard." 59 | echo "Please paste the public key in your GitHub account SSH key page." 60 | 61 | # Open GitHub SSH key page in browser 62 | echo "Press any key to open GitHub SSH key page $github_ssh_site in your browser..." 63 | read -n 1 -s 64 | if which xdg-open > /dev/null; then 65 | xdg-open $github_ssh_site 66 | elif which open > /dev/null; then 67 | open $github_ssh_site 68 | else 69 | echo "Could not open browser. Please visit $github_ssh_site in your browser." 70 | fi 71 | 72 | -------------------------------------------------------------------------------- /config_static_ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: This script is for Ethernet IPv4 Setting without GUI 18 | # 19 | # Version: 1.0 20 | # Date: 2023-08-17 21 | # Author: Herman Ye @Auromix 22 | # 23 | # set -x 24 | set -e 25 | 26 | # Get a list of all Ethernet interface names 27 | INTERFACE_LIST=($(ip link | awk -F: '$0 !~ "lo|vir|wl|^[^0-9]"{print $2}')) 28 | 29 | # Print the available Ethernet interface list for user selection 30 | echo "Here is the list of available Ethernet interfaces:" 31 | for idx in ${!INTERFACE_LIST[@]}; do 32 | echo "$((idx+1)). ${INTERFACE_LIST[idx]}" 33 | done 34 | 35 | echo "" 36 | 37 | # Prompt user to select an Ethernet interface 38 | read -p "Please select the number of the Ethernet interface to configure (press Enter for default interface): " choice 39 | 40 | # Use user's selection or default interface 41 | if [[ -z "$choice" ]]; then 42 | INTERFACE=${INTERFACE_LIST[0]} # Default to the first interface 43 | echo "" 44 | echo "Default Ethernet interface ${INTERFACE_LIST[0]} has been selected." 45 | else 46 | idx=$((choice-1)) 47 | if ((idx >= 0 && idx < ${#INTERFACE_LIST[@]})); then 48 | INTERFACE=${INTERFACE_LIST[idx]} 49 | echo "" 50 | echo "Ethernet interface ${INTERFACE_LIST[($choice-1)]} has been selected." 51 | else 52 | echo "" 53 | echo "Invalid choice. Exiting the script." 54 | exit 1 55 | fi 56 | fi 57 | 58 | # Prompt user to enter a new IP address, with a default value of "192.168.1.50" 59 | DEFAULT_IP="192.168.1.50" 60 | DEFAULT_NETMASK="255.255.255.0" 61 | DEFAULT_GATEWAY="192.168.1.1" 62 | 63 | read -p "Please enter the new IP address (press Enter for default IP): " NEW_IP && NEW_IP=${NEW_IP:-$DEFAULT_IP} && echo "New IP address: $NEW_IP" 64 | read -p "Please enter the new subnet mask (press Enter for default subnet mask): " NEW_NETMASK && NEW_NETMASK=${NEW_NETMASK:-$DEFAULT_NETMASK} && echo "New subnet mask: $NEW_NETMASK" 65 | read -p "Please enter the new gateway (press Enter for default gateway): " NEW_GATEWAY && NEW_GATEWAY=${NEW_GATEWAY:-$DEFAULT_GATEWAY} && echo "New gateway: $NEW_GATEWAY" 66 | 67 | # Prompt user for confirmation 68 | echo "" 69 | read -p $'Changes to be made:\nEthernet interface: '"$INTERFACE"$'\nIP address: '"$NEW_IP"$'\nSubnet mask: '"$NEW_NETMASK"$'\nGateway: '"$NEW_GATEWAY"$'\n\nDo you confirm the changes? (y/n) ' confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 70 | 71 | # Configure static IP address 72 | sudo ip addr add $NEW_IP/$NEW_NETMASK dev $INTERFACE 73 | 74 | # Configure gateway 75 | sudo ip route add default via $NEW_GATEWAY dev $INTERFACE 76 | 77 | # Done 78 | clear 79 | echo "Static IP configuration complete!" 80 | read -p "Press ENTER to display the new network configuration: " dummy 81 | clear 82 | ip addr show $INTERFACE 83 | echo "" 84 | echo "Route:" 85 | ip route show 86 | -------------------------------------------------------------------------------- /config_udev_rules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023-2024 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for Configuring udev rules. 19 | # Version: 1.0 20 | # Date: 2024-11-26 21 | # Author: Herman Ye @Auromix 22 | # 23 | # set -x 24 | # set -e 25 | 26 | # Check if the script is being run with root privileges 27 | if [ "$(id -u)" -ne 0 ]; then 28 | echo "Please run this script with root privileges." 29 | exit 1 30 | fi 31 | 32 | # Save the list of devices before the user plugs in any devices 33 | echo "Please unplug your device and press Enter when done." 34 | read -r 35 | 36 | # Get the list of all devices before inserting the new one 37 | before_devices=$(ls /dev/) 38 | 39 | # Ask the user to plug in the device 40 | echo "Now, please plug in the device and press Enter when done." 41 | read -r 42 | 43 | # Get the list of all devices after inserting the new one 44 | after_devices=$(ls /dev/) 45 | 46 | # Find the difference between the two device lists (new devices) 47 | new_devices=$(comm -13 <(echo "$before_devices" | sort) <(echo "$after_devices" | sort)) 48 | 49 | if [ -z "$new_devices" ]; then 50 | echo "No new devices detected." 51 | exit 1 52 | fi 53 | 54 | # Print the newly detected devices and ask the user to select one 55 | echo "The following new devices were detected. Please choose the device you need:" 56 | select device in $new_devices; do 57 | if [ -n "$device" ]; then 58 | # Set the full path of the selected device 59 | device="/dev/$device" 60 | echo "You selected the device: $device" 61 | break 62 | else 63 | echo "Invalid selection, please choose a valid device number." 64 | fi 65 | done 66 | 67 | # Get the udev information of the selected device 68 | udev_info=$(udevadm info --query=all --name="$device") 69 | # Print the udev information for the selected device 70 | echo "Udev information for $device:" 71 | echo "$udev_info" 72 | 73 | # Ask user if they want to create a udev rule for the device 74 | echo "Do you want to create a udev rule for this device? (y/n)" 75 | read -r create_rule 76 | 77 | if [ "$create_rule" == "y" ]; then 78 | # Ask the user to provide a name for the rule file 79 | default_rule_name="99-my-device.rules" 80 | echo "Please specify a name for the udev rule file (default: $default_rule_name):" 81 | read -r udev_rule_name 82 | 83 | # Use the default name if the user does not specify one 84 | if [ -z "$udev_rule_name" ]; then 85 | udev_rule_name="$default_rule_name" 86 | fi 87 | 88 | # Ensure the rule name ends with ".rules" 89 | if [[ "$udev_rule_name" != *.rules ]]; then 90 | udev_rule_name="$udev_rule_name.rules" 91 | fi 92 | 93 | # Full path to the udev rule file 94 | udev_rule_file="/etc/udev/rules.d/$udev_rule_name" 95 | echo "Creating udev rule file: $udev_rule_file" 96 | 97 | # Extract key information from udevadm info 98 | id_vendor_id=$(echo "$udev_info" | grep -oP '^E: ID_VENDOR_ID=\K.*') 99 | id_model_id=$(echo "$udev_info" | grep -oP '^E: ID_MODEL_ID=\K.*') 100 | id_serial=$(echo "$udev_info" | grep -oP '^E: ID_SERIAL=\K.*') 101 | dev_name=$(echo "$udev_info" | grep -oP '^E: DEVNAME=\K.*') 102 | 103 | # Validate extracted data 104 | if [ -z "$id_vendor_id" ] || [ -z "$id_model_id" ]; then 105 | echo "Error: Could not extract sufficient information from udevadm." 106 | exit 1 107 | fi 108 | 109 | # Prompt the user for a custom SYMLINK name, with a default value 110 | default_symlink="my_auromix_device" 111 | echo "Please specify a custom SYMLINK name (default: $default_symlink):" 112 | read -r user_symlink 113 | 114 | # Use the default SYMLINK name if the user does not specify one 115 | if [ -z "$user_symlink" ]; then 116 | user_symlink="$default_symlink" 117 | fi 118 | 119 | # Generate the udev rule 120 | udev_rule="SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"$id_vendor_id\", ATTRS{idProduct}==\"$id_model_id\", SYMLINK+=\"$user_symlink\", MODE=\"0777\"" 121 | 122 | # Save the rule to the file 123 | echo "$udev_rule" >"$udev_rule_file" 124 | echo "Udev rule created at $udev_rule_file with the following content:" 125 | echo "$udev_rule" 126 | 127 | # Reload the udev rules to apply the new rule 128 | udevadm control --reload-rules 129 | udevadm trigger 130 | echo "Udev rules reloaded. Device $dev_name should now have a persistent symlink as /dev/$user_symlink." 131 | else 132 | echo "No udev rule created." 133 | 134 | fi 135 | -------------------------------------------------------------------------------- /config_vpn_ssh_port.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2024 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for configuring the SSH port for GitHub. 19 | # Version: 1.0 20 | # Date: 2024-04-15 21 | # Author: Herman Ye @Auromix 22 | # 23 | # VPNs typically route traffic through different ports than the default SSH port (port 22). 24 | # By default, SSH connections to GitHub are made over port 22. 25 | # However, if you are using a VPN that operates on a different port (e.g., https port 443), 26 | # GitHub's SSH traffic may need to be redirected accordingly. 27 | # 28 | # set -x 29 | set -e 30 | 31 | # Set configuration parameters 32 | github_host="github.com" 33 | github_hostname="ssh.github.com" 34 | github_port="443" 35 | 36 | # Ensure the ~/.ssh directory exists 37 | mkdir -p ~/.ssh 38 | 39 | # Check if the configuration already exists in the ~/.ssh/config file 40 | if ! grep -q "Host $github_host" ~/.ssh/config; then 41 | # Create or append the configuration to the ~/.ssh/config file 42 | echo "Host $github_host" >> ~/.ssh/config 43 | echo "Hostname $github_hostname" >> ~/.ssh/config 44 | echo "Port $github_port" >> ~/.ssh/config 45 | echo "" >> ~/.ssh/config 46 | echo "Configuration added to the ~/.ssh/config file." 47 | else 48 | echo "Configuration already exists in the ~/.ssh/config file. Skipping." 49 | fi 50 | 51 | -------------------------------------------------------------------------------- /isaacsim_python_assistant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Description: This script facilitates the execution of an Isaac Sim standalone Python script provided by the user. 4 | # Version: 1.0.0 5 | # Author: Herman Ye @Auromix 6 | # Date: 2023-11-14 7 | 8 | # Exit the script immediately if a command exits with a non-zero status 9 | # set -x 10 | set -e 11 | 12 | # Clear the terminal screen 13 | clear 14 | 15 | # Get the directory of this script 16 | script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 17 | # Go to the directory of this script 18 | cd "$script_dir" 19 | 20 | # ANSI color codes 21 | red='\033[0;31m' 22 | green='\033[0;32m' 23 | yellow='\033[0;33m' 24 | reset='\033[0m' 25 | 26 | # List all Python files in the current directory 27 | echo "####################################################" 28 | echo "# #" 29 | echo -e "# ${red}Isaac Sim Standalone Python Execution Assistant${reset} #" 30 | echo "# #" 31 | echo "####################################################" 32 | echo "# #" 33 | echo "# YOU CAN EXECUTE THE FOLLOWING PYTHON FILES: #" 34 | 35 | # Loop through all Python files in the current directory 36 | for file in *.py; do 37 | file_length=${#file} 38 | space_length=$((49 - file_length)) 39 | printf "# " 40 | printf "${green}$file${reset}" 41 | printf "%0.s " $(seq 1 $space_length) 42 | printf "#\n" 43 | done 44 | 45 | echo "# #" 46 | echo "####################################################" 47 | 48 | # Prompt the user to enter the name of the Python file to execute 49 | echo "" 50 | echo "Enter the standalone Isaac sim Python filename" 51 | read -e -p "to execute (use Tab for completion): " filename 52 | 53 | # Check if the user entered a valid Python file name 54 | if [ -z "$filename" ]; then 55 | echo -e "${red}Error: Please enter a valid Python file name.${reset}" 56 | exit 1 57 | fi 58 | 59 | # Print the script directory 60 | echo "" 61 | echo "Script directory:" 62 | echo "$script_dir" 63 | 64 | # Print the Python file path 65 | python_path="$script_dir/$filename" 66 | echo "Python file:" 67 | echo "$python_path" 68 | 69 | # Check if the Python file exists 70 | if [ ! -f "$python_path" ]; then 71 | echo -e "${red}Error: Python file '$filename' not found.${reset}" 72 | exit 1 73 | fi 74 | echo -e "${green}Python file found.${reset}" 75 | 76 | # Search for a directory with 'isaac_sim' in the name under ~/.local/share/ov/pkg/ 77 | isaac_sim_dir=$(find ~/.local/share/ov/pkg/ -type d -name "*isaac_sim*" -print -quit) 78 | 79 | # Check if the directory is found 80 | if [ -z "$isaac_sim_dir" ]; then 81 | echo -e "${red}Error: Unable to find a directory with 'isaac_sim' in the name under ~/.local/share/ov/pkg/.${reset}" 82 | exit 1 83 | else 84 | echo "Isaac Sim directory:" 85 | echo "$isaac_sim_dir" 86 | echo -e "${green}Isaac Sim found.${reset}" 87 | fi 88 | 89 | # Check if the $isaacrepo environment variable is set 90 | if [ -z "$isaacrepo" ]; then 91 | echo -e "${yellow}Warning: \$isaacrepo environment variable is not set.${reset}" 92 | 93 | # Ask the user if they want to add it to the environment variable 94 | read -p "Add to the environment variable \$isaacrepo? [y/n] " -n 1 -r 95 | echo "" 96 | if [[ $REPLY =~ ^[Yy]$ ]]; then 97 | echo "Adding to the environment variable \$isaacrepo..." 98 | echo "# ISAAC SIM ENVIRONMENT VARIABLE" >> ~/.bashrc 99 | echo "export isaacrepo=$isaac_sim_dir" >> ~/.bashrc 100 | source ~/.bashrc 101 | else 102 | # Skip adding 103 | echo "Not adding to the environment variable \$isaacrepo." 104 | fi 105 | else 106 | echo "\$isaacrepo environment variable:" 107 | echo "$isaacrepo" 108 | echo -e "${green}Isaac Sim environment variable found.${reset}" 109 | fi 110 | 111 | # Change directory to Isaac Sim directory 112 | echo "Going to $isaac_sim_dir" 113 | cd "$isaac_sim_dir" 114 | 115 | # Start the Python script 116 | echo -e "${green}Starting $filename...${reset}" 117 | sleep 1 118 | bash python.sh "$python_path" 119 | exit 0 120 | 121 | -------------------------------------------------------------------------------- /jetson_best_performance_install_v512.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for installing basic development environment and setting best performance for NVIDIA Jetson AGX Orin. 19 | # Version: 1.1 20 | # Date: 2023-02-20 21 | # Author: Herman Ye @Auromix 22 | # 23 | # Warning: Only for NVIDIA Jetson AGX Orin with JetPack 5.1.2, ubuntu 20.04 24 | # set -x 25 | set -e 26 | 27 | 28 | 29 | 30 | # Get script directory 31 | SCRIPT_DIR=$(dirname "$0") 32 | 33 | # Get the username of the non-root user 34 | USERNAME=$USER 35 | echo "Current user is: $USERNAME" 36 | echo "Script directory is: $SCRIPT_DIR" 37 | 38 | 39 | # No Password sudo config 40 | echo "Setting no-passwd sudo" 41 | sudo sed -i 's/^%sudo.*/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers 42 | 43 | # No password auto login 44 | echo "Setting no-passwd auto login" 45 | echo "[Seat:*]" | sudo tee /etc/lightdm/lightdm.conf.d/50-nvidia.conf 46 | echo "autologin-user=$USERNAME" | sudo tee -a /etc/lightdm/lightdm.conf.d/50-nvidia.conf 47 | echo "autologin-user-timeout=0" | sudo tee -a /etc/lightdm/lightdm.conf.d/50-nvidia.conf 48 | 49 | # Set auto login for gdm3 50 | echo "Setting auto login for gdm3" 51 | echo "Backing up /etc/gdm3/custom.conf to /etc/gdm3/custom.conf.backup ..." 52 | sudo cp /etc/gdm3/custom.conf /etc/gdm3/custom.conf.backup 53 | echo -e "[daemon]\nWaylandEnable=false\nAutomaticLoginEnable=true\nAutomaticLogin=$USERNAME\n\n[security]\n\n[xdmcp]" | sudo tee /etc/gdm3/custom.conf 54 | 55 | # Get architecture of the system 56 | if [ $(uname -m) = "x86_64" ]; then 57 | MIRROR="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/" 58 | else 59 | MIRROR="https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/" 60 | fi 61 | echo "Current system architecture is: $(uname -m)" 62 | echo "Current mirror is: $MIRROR" 63 | 64 | # Backup original software sources 65 | echo "Backing up sources.list to /etc/apt/sources.list.backup ..." 66 | sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 67 | 68 | # Clear original software sources 69 | echo "# Ubuntu Mirror Settings" | sudo tee /etc/apt/sources.list 70 | 71 | # Replace software sources using tee 72 | echo "deb $MIRROR focal main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 73 | echo "deb $MIRROR focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 74 | echo "deb $MIRROR focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 75 | 76 | if [ $(uname -m) = "x86_64" ]; then 77 | echo "deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 78 | else 79 | echo "deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 80 | fi 81 | 82 | # System update 83 | echo "Start to update software..." 84 | sudo apt update 85 | echo "Start to upgrade software..." 86 | sudo apt upgrade -y 87 | 88 | # Install pip 89 | echo "Installing pip..." 90 | sudo apt install python3-dev -y 91 | sudo apt install pip -y 92 | 93 | # Set default pip source 94 | echo "configuring pip source..." 95 | pip config set global.index-url http://pypi.tuna.tsinghua.edu.cn/simple 96 | pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn 97 | 98 | # check for UTF-8 99 | echo "Checking locale..." 100 | echo "Current locale:" 101 | locale 102 | 103 | # Set language 104 | echo "Setting language..." 105 | sudo apt update && sudo apt install locales 106 | sudo locale-gen en_US en_US.UTF-8 107 | sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 108 | export LANG=en_US.UTF-8 109 | 110 | # verify settings 111 | echo "Checking locale..." 112 | locale 113 | 114 | # Enable Ubuntu Universe repository 115 | echo "Enabling Ubuntu Universe repository..." 116 | sudo apt install software-properties-common -y 117 | sudo add-apt-repository universe -y 118 | 119 | # Install curl 120 | sudo apt install curl -y 121 | 122 | # Backup sleep config 123 | echo "Backing up /etc/systemd/sleep.conf to /etc/systemd/sleep.conf.backup ..." 124 | sudo cp /etc/systemd/sleep.conf /etc/systemd/sleep.conf.backup 125 | # Forbid sleep 126 | sudo sed -i 's/#AllowSuspend=yes/AllowSuspend=no/g' /etc/systemd/sleep.conf 127 | sudo sed -i 's/#AllowHibernation=yes/AllowHibernation=no/g' /etc/systemd/sleep.conf 128 | sudo systemctl daemon-reload 129 | 130 | # Update apt repository caches 131 | echo "Updating software caches..." 132 | sudo apt update 133 | echo "Upgrading software..." 134 | sudo apt upgrade -y 135 | 136 | # Set fan and clock to max 137 | sudo /usr/bin/jetson_clocks --show 138 | sudo /usr/bin/jetson_clocks --fan 139 | # sudo /usr/bin/jetson_clocks --store 140 | 141 | # Set power perfomance 142 | echo "Rebooting to reset the power mode..." 143 | sleep 3 144 | sudo nvpmodel -m 0 --force 145 | 146 | echo "Basic env install done." 147 | -------------------------------------------------------------------------------- /moveit1_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for setting up a MoveIt workspace and downloading its source code along with the required dependencies on ROS1 Noetic in Ubuntu 20.04. 19 | # The script installs necessary packages, creates a catkin workspace, and clones the MoveIt source code along with example code from the respective GitHub repositories. 20 | # It then uses rosdep to install dependencies and builds the workspace using catkin. 21 | # Finally, it adds the path of the workspace to the .bashrc file for easy access. 22 | # 23 | # Version: 1.4 24 | # Date: 2023-11-11 25 | # Author: Herman Ye @Auromix 26 | # 27 | # Warning: This script assumes that the ubuntu20.04 system and ROS1 Noetic have been installed correctly 28 | # If not, please execute ros1_noetic_install.sh first. 29 | # 30 | # set -x 31 | set -e 32 | 33 | # Get script directory 34 | SCRIPT_DIR=$(dirname "$0") 35 | # Get the username of the non-root user 36 | USERNAME=$SUDO_USER 37 | echo "Current user is: $USERNAME" 38 | 39 | # Check if script is run as root (sudo) 40 | if [ "$(id -u)" != "0" ]; then 41 | echo "This script must be run with sudo privileges. for example: sudo bash moveit1_install.sh" 42 | read -p "Press any key to exit..." 43 | exit 1 44 | fi 45 | echo "sudo privileges check passed" 46 | 47 | # Check if script is run in ubuntu20.04 48 | if [ "$(lsb_release -sc)" != "focal" ]; then 49 | echo "This script must be run in ubuntu20.04" 50 | read -p "Press any key to exit..." 51 | exit 1 52 | fi 53 | 54 | echo "ubuntu20.04 check passed" 55 | 56 | # Check if script is run in ROS1 Noetic 57 | if [[ "$(sudo -u $USERNAME dpkg -l ros-noetic-desktop-full)" == *ii* ]]; then 58 | echo "ROS1 Noetic check passed" 59 | else 60 | echo "This script must be run with ROS1 Noetic-desktop-full" 61 | read -p "Press any key to exit..." 62 | exit 1 63 | fi 64 | 65 | # Save logs to files 66 | LOG_FILE="${SCRIPT_DIR}/moveit1_install.log" 67 | ERR_FILE="${SCRIPT_DIR}/moveit1_install.err" 68 | rm -f ${LOG_FILE} 69 | rm -f ${ERR_FILE} 70 | 71 | # Redirect output to console and log files 72 | exec 1> >(tee -a ${LOG_FILE} ) 73 | exec 2> >(tee -a ${ERR_FILE} >&2) 74 | 75 | # Install curl 76 | sudo apt install curl -y 77 | 78 | # Install catkin the ROS build system 79 | sudo apt install ros-noetic-catkin python3-catkin-tools python3-osrf-pycommon -y 80 | 81 | # Install wstool 82 | sudo apt install python3-wstool -y 83 | 84 | # Install moveit 85 | sudo apt-get install ros-noetic-moveit -y 86 | sudo apt-get install ros-noetic-moveit-visual-tools -y 87 | # Warning: Installing all subpackages of moveit may cause dependency conflicts, please do so with caution. 88 | # sudo apt install ros-noetic-moveit-* -y 89 | 90 | # Install ros_control 91 | sudo apt-get install ros-noetic-ros-control ros-noetic-ros-controllers -y 92 | sudo apt-get install ros-noetic-controller-interface ros-noetic-controller-manager-msgs ros-noetic-controller-manager 93 | 94 | # Create A Catkin Workspace and Download MoveIt Source 95 | sudo rm -rf /home/$USERNAME/ws_moveit 96 | mkdir -p /home/$USERNAME/ws_moveit/src 97 | cd /home/$USERNAME/ws_moveit/src 98 | 99 | clear 100 | sleep 1 101 | 102 | # Define the variables to be printed 103 | TEXT0="" 104 | TEXT1="Moveit installation completed!" 105 | TEXT2="Please open a new terminal and run roslaunch to verify the installation:" 106 | TEXT3="roslaunch panda_moveit_config demo.launch" 107 | TEXT4="1. Click 'Add' in the left panel, and add the following items:" 108 | TEXT5="2. Add 'RobotModel', 'MotionPlanning' to the left panel" 109 | TEXT6="3. Try to drag the end effector to see if the robot arm moves" 110 | TEXT7="4. Click 'Plan & Execute' to see the robot arm move" 111 | TEXT8="5. If you see the robot arm move, the installation is successful" 112 | # Define the colors 113 | RED='\033[0;31m' 114 | BLUE='\033[0;34m' 115 | GREEN='\033[1;32m' 116 | NC='\033[0m' 117 | 118 | # Calculate the center of the terminal window 119 | TERMINAL_WIDTH=$(tput cols) 120 | TEXT1_PADDING=$((($TERMINAL_WIDTH-${#TEXT1})/2)) 121 | TEXT2_PADDING=$((($TERMINAL_WIDTH-${#TEXT2})/2)) 122 | TEXT3_PADDING=$((($TERMINAL_WIDTH-${#TEXT3})/2)) 123 | 124 | # Finished 125 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 126 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 127 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 128 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 129 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 130 | echo -e "${GREEN}$(printf '%*s' $TEXT1_PADDING)${TEXT1} ${NC}" 131 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 132 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 133 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 134 | read -rp "Do you want to download the tutorial code? (y/n) " confirm 135 | if [[ "$confirm" =~ ^[Yy]$ ]]; then 136 | # Download Example Code(already in the moveit.rosinstall) 137 | # cd /home/$USERNAME/ws_moveit/src 138 | clear 139 | echo "Connecting to GitHub, please wait..." 140 | echo "If the download stuck here for a long time" 141 | echo "please check your network connection and rerun this script" 142 | # install franka robot as demo 143 | sudo apt install ros-noetic-franka-* -y 144 | git clone https://github.com/ros-planning/moveit_tutorials.git -b master 145 | git clone https://github.com/ros-planning/panda_moveit_config.git -b noetic-devel 146 | 147 | # git clone https://github.com/ros-controls/ros_control.git -b noetic-devel 148 | 149 | # Clone MoveIt packages from source 150 | # git clone https://github.com/ros-planning/moveit_msgs.git 151 | # git clone https://github.com/ros-planning/moveit_resources.git 152 | # git clone https://github.com/ros-planning/geometric_shapes.git --branch noetic-devel 153 | # git clone https://github.com/ros-planning/srdfdom.git --branch noetic-devel 154 | # git clone https://github.com/ros-planning/moveit.git 155 | # git clone https://github.com/PickNikRobotics/rviz_visual_tools.git 156 | # git clone https://github.com/ros-planning/moveit_visual_tools.git 157 | # git clone https://github.com/ros-planning/moveit_tutorials.git 158 | # git clone https://github.com/ros-planning/panda_moveit_config.git --branch noetic-devel 159 | # Rosdepc install 160 | cd /home/$USERNAME/ws_moveit/src 161 | rosdepc install -y --from-paths . --ignore-src --rosdistro noetic > /dev/null 162 | echo "Rosdep install finished" 163 | 164 | # Build the Workspace 165 | cd /home/$USERNAME/ws_moveit 166 | catkin config --extend /opt/ros/noetic --cmake-args -DCMAKE_BUILD_TYPE=Release 167 | catkin init 168 | catkin build 169 | 170 | # Environment setup 171 | if ! grep -q "/home/$USERNAME/ws_moveit/devel/setup.bash" /home/$USERNAME/.bashrc; then 172 | 173 | echo "# ws_moveit Environment Setting" | sudo tee -a /home/$USERNAME/.bashrc 174 | echo "source /home/$USERNAME/ws_moveit/devel/setup.bash" >> /home/$USERNAME/.bashrc 175 | echo "ws_moveit environment setup added to /home/$USERNAME/.bashrc" 176 | else 177 | echo "ws_moveit environment is already set in /home/$USERNAME/.bashrc" 178 | fi 179 | source /home/$USERNAME/.bashrc 180 | 181 | # Verifying Moveit1 installation 182 | clear 183 | 184 | 185 | # Print the text in the center of the screen in the desired colors 186 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 187 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 188 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 189 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 190 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 191 | echo -e "${GREEN}$(printf '%*s' $TEXT1_PADDING)${TEXT1} ${NC}" 192 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT2} ${NC}" 193 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 194 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 195 | echo -e "${RED}$(printf '%*s' $TEXT3_PADDING)${TEXT3} ${NC}" 196 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 197 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 198 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT4} ${NC}" 199 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT5} ${NC}" 200 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT6} ${NC}" 201 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT7} ${NC}" 202 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT8} ${NC}" 203 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 204 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 205 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 206 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT0} ${NC}" 207 | echo -e "${NC}$(printf '%*s' $TEXT1_PADDING)${TEXT0} ${NC}" 208 | else 209 | read -p "Ok. The installation is complete. Press any key to exit..." 210 | exit 0 211 | fi 212 | -------------------------------------------------------------------------------- /orbbec_femto_bolt_ros1_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for installing Orbbec Femto Bolt ROS 1 version. 19 | # 20 | # Version: 1.0 21 | # Date: 2023-12-12 22 | # Author: Herman Ye @Auromix 23 | # 24 | # Warning: This script assumes ROS1 Noetic is already installed on Ubuntu20.04. 25 | # set -x 26 | set -e 27 | 28 | 29 | # Get script directory 30 | SCRIPT_DIR=$(dirname "$0") 31 | 32 | # Get the username of the non-root user 33 | USERNAME=$USERNAME 34 | echo "Current user is: $USERNAME" 35 | echo "Script directory is: $SCRIPT_DIR" 36 | 37 | # Save logs to files 38 | LOG_FILE="${SCRIPT_DIR}/orbbec_femto_bolt_ros1_install.log" 39 | ERR_FILE="${SCRIPT_DIR}/orbbec_femto_bolt_ros1_install.err" 40 | echo "Cleaning up traces of last installation..." 41 | rm -f ${LOG_FILE} 42 | rm -f ${ERR_FILE} 43 | 44 | # Redirect output to console and log files 45 | exec 1> >(tee -a ${LOG_FILE} ) 46 | exec 2> >(tee -a ${ERR_FILE} >&2) 47 | 48 | # Output log info to console 49 | echo "Installation logs will be saved to ${LOG_FILE}" 50 | echo "Installation errors will be saved to ${ERR_FILE}" 51 | 52 | # Waiting to start 53 | echo "Start to install Orbbec Femto Bolt ROS1 Noetic..." 54 | echo "Warning: This script assumes ROS1 Noetic is already installed on Ubuntu20.04." 55 | sleep 3 56 | 57 | # Create ROS workspace 58 | echo "Removing old orbbec test workspace..." 59 | rm -rf /home/$USERNAME/orbbec_test_ws 60 | echo "Creating new orbbec test workspace..." 61 | mkdir -p /home/$USERNAME/orbbec_test_ws/src && cd /home/$USERNAME/orbbec_test_ws/src 62 | 63 | # Download Camera ROS SDK 64 | echo "Downloading Orbbec ROS1 SDK..." 65 | git clone https://github.com/orbbec/OrbbecSDK_ROS1.git 66 | 67 | # Install dependencies 68 | echo "Installing dependencies..." 69 | cd /home/$USERNAME/orbbec_test_ws 70 | rosdep install --from-paths src --ignore-src -r -y 71 | sudo apt install libgflags-dev ros-$ROS_DISTRO-image-geometry ros-$ROS_DISTRO-camera-info-manager -y 72 | sudo apt install ros-$ROS_DISTRO-image-transport ros-$ROS_DISTRO-image-publisher -y 73 | sudo apt install libgoogle-glog-dev libusb-1.0-0-dev libeigen3-dev -y 74 | 75 | # Build 76 | echo "Building..." 77 | cd /home/$USERNAME/orbbec_test_ws 78 | catkin_make 79 | 80 | # Set workspace environment 81 | echo "Setting workspace environment..." 82 | echo "source /home/$USERNAME/orbbec_test_ws/devel/setup.bash" >> /home/$USERNAME/.bashrc 83 | source /home/$USERNAME/orbbec_test_ws/devel/setup.bash 84 | 85 | # Set udev rules for camera 86 | echo "Setting udev rules for camera..." 87 | roscd orbbec_camera 88 | cd script 89 | sudo cp 99-obsensor-libusb.rules /etc/udev/rules.d/99-obsensor-libusb.rules 90 | 91 | # Reset udev to activate rules for camera 92 | echo "Resetting udev to activate rules for camera..." 93 | sudo udevadm control --reload && sudo udevadm trigger 94 | 95 | # Replug the camera 96 | echo "" 97 | echo "Please replug the camera now and press any key to continue!" 98 | read -n 1 99 | 100 | # Verify installation 101 | clear 102 | 103 | # Define the colors 104 | RED='\033[0;31m' 105 | BLUE='\033[0;34m' 106 | GREEN='\033[1;32m' 107 | NC='\033[0m' 108 | 109 | # Define the variables to be printed 110 | TEXT1="Orbbec Femto Bolt ROS1 installation completed!" 111 | TEXT2="Please open new terminals and run commands to verify the installation:" 112 | TEXT3="roslaunch orbbec_camera femto_bolt.launch" 113 | TEXT4="rosrun rqt_image_view rqt_image_view /camera/color/image_raw" 114 | 115 | # Calculate the center of the terminal window 116 | TERMINAL_WIDTH=$(tput cols) 117 | TEXT1_PADDING=$((($TERMINAL_WIDTH-${#TEXT1})/2)) 118 | TEXT2_PADDING=$((($TERMINAL_WIDTH-${#TEXT2})/2)) 119 | TEXT3_PADDING=$((($TERMINAL_WIDTH-${#TEXT3})/2)) 120 | TEXT4_PADDING=$((($TERMINAL_WIDTH-${#TEXT4})/2)) 121 | 122 | # Print the text in the center of the screen in the desired colors 123 | echo "" 124 | echo "" 125 | echo "" 126 | echo "" 127 | echo "" 128 | echo "" 129 | echo "" 130 | echo "" 131 | echo "" 132 | echo "" 133 | echo -e "${GREEN}$(printf '%*s' $TEXT1_PADDING)${TEXT1} ${NC}" 134 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT2} ${NC}" 135 | echo -e "${RED}$(printf '%*s' $TEXT3_PADDING)${TEXT3} ${NC}" 136 | echo -e "${RED}$(printf '%*s' $TEXT4_PADDING)${TEXT4} ${NC}" 137 | echo "" 138 | echo "" 139 | echo "" 140 | echo "" 141 | echo "" 142 | echo "" 143 | echo "" 144 | echo "" 145 | echo "" 146 | echo "" 147 | -------------------------------------------------------------------------------- /orbbec_femto_bolt_ros2_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for installing Orbbec Femto Bolt ROS 2 version. 19 | # 20 | # Version: 1.0 21 | # Date: 2023-12-12 22 | # Author: Herman Ye @Auromix 23 | # 24 | # Warning: This script assumes ROS2 Humble is already installed on Ubuntu22.04. 25 | # set -x 26 | set -e 27 | 28 | 29 | # Get script directory 30 | SCRIPT_DIR=$(dirname "$0") 31 | 32 | # Get the username of the non-root user 33 | USERNAME=$USERNAME 34 | echo "Current user is: $USERNAME" 35 | echo "Script directory is: $SCRIPT_DIR" 36 | 37 | # Save logs to files 38 | LOG_FILE="${SCRIPT_DIR}/orbbec_femto_bolt_ros2_install.log" 39 | ERR_FILE="${SCRIPT_DIR}/orbbec_femto_bolt_ros2_install.err" 40 | echo "Cleaning up traces of last installation..." 41 | rm -f ${LOG_FILE} 42 | rm -f ${ERR_FILE} 43 | 44 | # Redirect output to console and log files 45 | exec 1> >(tee -a ${LOG_FILE} ) 46 | exec 2> >(tee -a ${ERR_FILE} >&2) 47 | 48 | # Output log info to console 49 | echo "Installation logs will be saved to ${LOG_FILE}" 50 | echo "Installation errors will be saved to ${ERR_FILE}" 51 | 52 | # Waiting to start 53 | echo "Start to install Orbbec Femto Bolt ROS2 Humble..." 54 | echo "Warning: This script assumes ROS2 Humble is already installed on Ubuntu22.04." 55 | sleep 3 56 | 57 | # Create ROS2 workspace 58 | echo "Removing old orbbec test workspace..." 59 | rm -rf /home/$USERNAME/orbbec_test_ws 60 | echo "Creating new orbbec test workspace..." 61 | mkdir -p /home/$USERNAME/orbbec_test_ws/src && cd /home/$USERNAME/orbbec_test_ws/src 62 | 63 | # Download Camera ROS2 SDK 64 | echo "Downloading Orbbec ROS2 SDK..." 65 | git clone https://github.com/orbbec/OrbbecSDK_ROS2.git 66 | 67 | # Install dependencies 68 | echo "Installing dependencies..." 69 | cd /home/$USERNAME/orbbec_test_ws 70 | rosdep install --from-paths src --ignore-src -r -y 71 | sudo apt install libgflags-dev nlohmann-json3-dev libgoogle-glog-dev -y 72 | sudo apt install ros-$ROS_DISTRO-image-transport ros-$ROS_DISTRO-image-publisher ros-$ROS_DISTRO-camera-info-manager -y 73 | 74 | # Build 75 | echo "Building..." 76 | cd /home/$USERNAME/orbbec_test_ws 77 | colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release 78 | 79 | # Set workspace environment 80 | echo "Setting workspace environment..." 81 | echo "source /home/$USERNAME/orbbec_test_ws/install/setup.bash" >> /home/$USERNAME/.bashrc 82 | source /home/$USERNAME/orbbec_test_ws/install/setup.bash 83 | 84 | # Set udev rules for camera 85 | echo "Setting udev rules for camera..." 86 | cd ~/orbbec_test_ws/src/OrbbecSDK_ROS2/orbbec_camera/scripts 87 | sudo bash install_udev_rules.sh 88 | # Reset udev to activate rules for camera 89 | echo "Resetting udev to activate rules for camera..." 90 | sudo udevadm control --reload-rules && sudo udevadm trigger 91 | 92 | # Replug the camera 93 | echo "" 94 | echo "Please replug the camera now and press any key to continue!" 95 | read -n 1 96 | 97 | # Verify installation 98 | clear 99 | 100 | # Define the colors 101 | RED='\033[0;31m' 102 | BLUE='\033[0;34m' 103 | GREEN='\033[1;32m' 104 | NC='\033[0m' 105 | 106 | # Define the variables to be printed 107 | TEXT1="Orbbec Femto Bolt ROS2 installation completed!" 108 | TEXT2="Please open new terminals and run commands to verify the installation:" 109 | TEXT3="ros2 launch orbbec_camera femto_bolt.launch.py" 110 | TEXT4="ros2 run rqt_image_view rqt_image_view /camera/color/image_raw" 111 | 112 | # Calculate the center of the terminal window 113 | TERMINAL_WIDTH=$(tput cols) 114 | TEXT1_PADDING=$((($TERMINAL_WIDTH-${#TEXT1})/2)) 115 | TEXT2_PADDING=$((($TERMINAL_WIDTH-${#TEXT2})/2)) 116 | TEXT3_PADDING=$((($TERMINAL_WIDTH-${#TEXT3})/2)) 117 | TEXT4_PADDING=$((($TERMINAL_WIDTH-${#TEXT4})/2)) 118 | 119 | # Print the text in the center of the screen in the desired colors 120 | echo "" 121 | echo "" 122 | echo "" 123 | echo "" 124 | echo "" 125 | echo "" 126 | echo "" 127 | echo "" 128 | echo "" 129 | echo "" 130 | echo -e "${GREEN}$(printf '%*s' $TEXT1_PADDING)${TEXT1} ${NC}" 131 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT2} ${NC}" 132 | echo -e "${RED}$(printf '%*s' $TEXT3_PADDING)${TEXT3} ${NC}" 133 | echo -e "${RED}$(printf '%*s' $TEXT4_PADDING)${TEXT4} ${NC}" 134 | echo "" 135 | echo "" 136 | echo "" 137 | echo "" 138 | echo "" 139 | echo "" 140 | echo "" 141 | echo "" 142 | echo "" 143 | echo "" 144 | -------------------------------------------------------------------------------- /realsense_d400_series_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: This script automates the installation of Intel Realsense D400 series on x86 PC Ubuntu 20.04. 18 | # Version: 1.0 19 | # Date: 2023-08-16 20 | # Author: Herman Ye @Auromix 21 | # Reference: https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md 22 | # Warning: UEFI/BIOS Security boot must be disabled before running this script. 23 | #set -x 24 | set -e 25 | 26 | # Preconditions 27 | echo "Warning: UEFI/BIOS Security boot must be disabled before running this script." 28 | echo "Please check first if the conditions are met." 29 | sleep 3 30 | 31 | # Download transport-https 32 | sudo apt install apt-transport-https -y 33 | 34 | # Register the server's public key 35 | sudo mkdir -p /etc/apt/keyrings 36 | curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null 37 | 38 | # Add the server to the list of repositories 39 | echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \ 40 | sudo tee /etc/apt/sources.list.d/librealsense.list 41 | sudo apt update 42 | 43 | # Install the librealsense2 44 | sudo apt install librealsense2-dkms -y 45 | sudo apt install librealsense2-utils -y 46 | 47 | # Install librealsense2 ros 48 | sudo apt install ros-noetic-realsense2-camera -y 49 | sudo apt-get install ros-noetic-realsense2-description -y 50 | 51 | # Reset udev 52 | echo "Resetting udev..." 53 | sudo service udev reload 54 | sleep 1 55 | sudo service udev restart 56 | sleep 1 57 | 58 | # Reset USB 59 | echo "Resetting USB..." 60 | 61 | for port in $(lspci | grep USB | cut -d' ' -f1); do 62 | echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind > /dev/null 63 | done 64 | 65 | sleep 3 66 | 67 | for port in $(lspci | grep USB | cut -d' ' -f1); do 68 | echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind > /dev/null 69 | done 70 | 71 | # Test 72 | sleep 2 73 | clear 74 | # Set color 75 | GREEN='\033[1;32m' 76 | NC='\033[0m' 77 | COMMAND_ROS="roslaunch realsense2_camera rs_camera.launch" 78 | # Print 79 | echo "Intel Realsense Camera installed successfully!" 80 | echo "If you want to test realsense ros:" 81 | echo "Open a new terminal, then run" 82 | echo -e "${GREEN}$(printf '%s' "${COMMAND_ROS}")${NC}" 83 | echo "If you want to test realsense camera only:" 84 | read -n 1 -s -r -p "Press any key to run realsense-viewer for testing..." 85 | realsense-viewer 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /realsense_install_nvidia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This script is used to install realsense2_camera and realsense2_description 19 | # 20 | # Version: 1.1 21 | # Date: 2023-07-13 22 | # Author: Herman Ye @Auromix 23 | # 24 | # Warning: This script assumes that the ubuntu20.04 system and ROS1 Noetic have been installed correctly 25 | # If not, please execute ros1_noetic_install.sh first. 26 | # The script is tested with Nvidia Jetson Orin nano 27 | # 28 | # set -x 29 | set -e 30 | # Get script directory 31 | SCRIPT_DIR=$(dirname "$0") 32 | # Check if script is run in Ubuntu 20.04 33 | if [ "$(lsb_release -sc)" != "focal" ]; then 34 | echo "This script must be run in Ubuntu 20.04" 35 | read -p "Press any key to exit..." 36 | exit 1 37 | fi 38 | echo "Ubuntu 20.04 check passed" 39 | # Check if script is run with ROS1 Noetic 40 | if dpkg -s ros-noetic-desktop-full >/dev/null 2>&1; then 41 | echo "ROS1 Noetic check passed" 42 | else 43 | echo "This script must be run with ROS1 Noetic-desktop-full" 44 | read -p "Press any key to exit..." 45 | exit 1 46 | fi 47 | # Save logs to files 48 | LOG_FILE="${SCRIPT_DIR}/realsense_install.log" 49 | ERR_FILE="${SCRIPT_DIR}/realsense_install.err" 50 | rm -f "${LOG_FILE}" 51 | rm -f "${ERR_FILE}" 52 | # Redirect output to console and log files 53 | exec 1> >(tee -a "${LOG_FILE}") 54 | exec 2> >(tee -a "${ERR_FILE}" >&2) 55 | # Install realsense from ROS distribution 56 | sudo apt-get install ros-$ROS_DISTRO-realsense2-camera -y 57 | # Install realsense2 description 58 | sudo apt-get install ros-$ROS_DISTRO-realsense2-description -y 59 | # Register the server's public key 60 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE 61 | # Add the server to the list of repositories 62 | sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u 63 | # Install the SDK 64 | pip3 install pyrealsense2 65 | sudo apt-get install librealsense2-utils -y 66 | sudo apt-get install librealsense2-dev -y 67 | # Reconnect the RealSense device 68 | clear 69 | echo "Installation complete!" 70 | echo "Now, please reconnect the RealSense device" 71 | echo "Open a new terminal and execute the following command to test:" 72 | echo "realsense-viewer" 73 | -------------------------------------------------------------------------------- /ros1_noetic_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for installing ROS1 Noetic and its dependencies in Ubuntu 20.04 in China. 19 | # It uses mirrors from Tsinghua University to speed up the download. 20 | # The script also sets up the sudo privileges and modifies the sources.list file to update the repositories accordingly. 21 | # It installs ROS1 Noetic and its dependencies, initializes rosdep, and verifies the installation by running roscore. 22 | # It logs the installation progress and redirects the output to the console and logs files. 23 | # 24 | # Version: 1.5 25 | # Date: 2023-12-11 26 | # Author: Herman Ye @Auromix 27 | # 28 | # Warning: This script is ONLY for ROS1 Noetic in ubuntu 20.04 29 | # set -x 30 | set -e 31 | 32 | 33 | 34 | # UBUNTU CONFIGURATION BEGINS HERE 35 | 36 | # Check if script is run as root (sudo) 37 | if [ "$(id -u)" != "0" ]; then 38 | echo "This script must be run with sudo privileges. for example: sudo bash ros1_noetic_install.sh" 39 | read -p "Press any key to exit..." 40 | exit 1 41 | fi 42 | # Get script directory 43 | SCRIPT_DIR=$(dirname "$0") 44 | # Get the username of the non-root user 45 | USERNAME=$SUDO_USER 46 | echo "Current user is: $USERNAME" 47 | # Save logs to files 48 | LOG_FILE="${SCRIPT_DIR}/ros1_noetic_install.log" 49 | ERR_FILE="${SCRIPT_DIR}/ros1_noetic_install.err" 50 | rm -f ${LOG_FILE} 51 | rm -f ${ERR_FILE} 52 | 53 | # Redirect output to console and log files 54 | exec 1> >(tee -a ${LOG_FILE} ) 55 | exec 2> >(tee -a ${ERR_FILE} >&2) 56 | 57 | # Output log info to console 58 | echo "ROS1 Noetic installation started!" 59 | echo "Installation logs will be saved to ${LOG_FILE}" 60 | echo "Installation errors will be saved to ${ERR_FILE}" 61 | 62 | # sleep 63 | sleep 3 64 | 65 | # No Password sudo config 66 | sudo sed -i 's/^%sudo.*/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers 67 | 68 | # Get architecture of the system 69 | if [ $(uname -m) = "x86_64" ]; then 70 | MIRROR="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/" 71 | else 72 | MIRROR="https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/" 73 | fi 74 | echo "Current system architecture is: $(uname -m)" 75 | echo "Current mirror is: $MIRROR" 76 | 77 | # Backup original software sources 78 | sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 79 | 80 | # Clear original software sources 81 | sudo echo "" > /etc/apt/sources.list 82 | 83 | # Replace software sources 84 | echo "deb $MIRROR focal main restricted universe multiverse" >> /etc/apt/sources.list 85 | echo "deb $MIRROR focal-updates main restricted universe multiverse" >> /etc/apt/sources.list 86 | echo "deb $MIRROR focal-backports main restricted universe multiverse" >> /etc/apt/sources.list 87 | 88 | if [ $(uname -m) = "x86_64" ]; then 89 | echo "deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list 90 | else 91 | echo "deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list 92 | fi 93 | 94 | # System update 95 | sudo apt update 96 | sudo apt upgrade -y 97 | 98 | 99 | # Install pip 100 | sudo apt install python3-dev -y 101 | sudo apt install pip -y # If you haven't already installed pip 102 | 103 | 104 | 105 | # Install gnome-terminal 106 | sudo apt install gnome-terminal -y # If you haven't already installed gnome-terminal 107 | 108 | # Set default pip source 109 | pip config set global.index-url http://pypi.tuna.tsinghua.edu.cn/simple 110 | pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn 111 | 112 | 113 | 114 | # ROS1 NOETIC INSTALLATION BEGINS HERE 115 | 116 | # Configure your Ubuntu repositories 117 | sudo add-apt-repository restricted 118 | sudo add-apt-repository universe 119 | sudo add-apt-repository multiverse 120 | 121 | # Setup your sources.list 122 | sudo sh -c 'echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 123 | 124 | # Add the ROS key 125 | ros_key="${SCRIPT_DIR}/ros.key" 126 | rm -f "${ros_key}" 127 | wget http://packages.ros.org/ros.key 128 | sudo apt-key add ros.key 129 | 130 | 131 | # Install catkin_tools 132 | pip install -U catkin_tools 133 | 134 | # Install dependencies 135 | sudo apt install libvtk7-jni libvtk7-java libvtk7-dev libvtk7-qt-dev libpcl-dev -y 136 | 137 | # Update the system packages index to the latest version 138 | sudo apt update 139 | 140 | # Install Curl 141 | sudo apt install curl -y # If you haven't already installed curl 142 | 143 | # Install ROS1 Noetic 144 | sudo apt install ros-noetic-desktop-full -y 145 | 146 | # Install dependencies 147 | sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential -y 148 | 149 | # Environment setup 150 | if ! grep -q "source /opt/ros/noetic/setup.bash" /home/$USERNAME/.bashrc; then 151 | 152 | echo "# ROS1 Noetic Environment Setting" | sudo tee -a /home/$USERNAME/.bashrc 153 | echo "source /opt/ros/noetic/setup.bash" | sudo tee -a /home/$USERNAME/.bashrc 154 | echo "ROS1 Noetic environment setup added to /home/$USERNAME/.bashrc" 155 | else 156 | echo "ROS1 Noetic environment is already set in /home/$USERNAME/.bashrc" 157 | fi 158 | source /home/$USERNAME/.bashrc 159 | 160 | # Initialize rosdepc by fishros under BSD License 161 | # https://pypi.org/project/rosdepc/#files 162 | sudo pip install rosdep 163 | sudo pip install rosdepc 164 | # sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -U rosdep 165 | # Init & update rosdep 166 | sudo rosdepc init > /dev/null 167 | #sudo rosdep fix-permissions 168 | # su -l $USERNAME -c 'rosdepc update' > /dev/null 169 | echo "rosdepc init completed!" 170 | 171 | # System update again 172 | sudo apt update 173 | sudo apt dist-upgrade -y 174 | 175 | # Verifying ROS1 installation 176 | clear 177 | # Define the variables to be printed 178 | TEXT1="ROS1 Noetic installation completed!" 179 | TEXT2="Please open a new terminal and run roscore to verify the installation:" 180 | TEXT3="roscore" 181 | 182 | # Define the colors 183 | RED='\033[0;31m' 184 | BLUE='\033[0;34m' 185 | GREEN='\033[1;32m' 186 | NC='\033[0m' 187 | 188 | # Calculate the center of the terminal window 189 | TERMINAL_WIDTH=$(tput cols) 190 | TEXT1_PADDING=$((($TERMINAL_WIDTH-${#TEXT1})/2)) 191 | TEXT2_PADDING=$((($TERMINAL_WIDTH-${#TEXT2})/2)) 192 | TEXT3_PADDING=$((($TERMINAL_WIDTH-${#TEXT3})/2)) 193 | 194 | # Print the text in the center of the screen in the desired colors 195 | echo "" 196 | echo "" 197 | echo "" 198 | echo "" 199 | echo "" 200 | echo "" 201 | echo "" 202 | echo "" 203 | echo "" 204 | echo "" 205 | echo -e "${GREEN}$(printf '%*s' $TEXT1_PADDING)${TEXT1} ${NC}" 206 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT2} ${NC}" 207 | echo -e "${RED}$(printf '%*s' $TEXT3_PADDING)${TEXT3} ${NC}" 208 | echo "" 209 | echo "" 210 | echo "" 211 | echo "" 212 | echo "" 213 | echo "" 214 | echo "" 215 | echo "" 216 | echo "" 217 | echo "" 218 | -------------------------------------------------------------------------------- /ros2_humble_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2023 Herman Ye @Auromix 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Description: 18 | # This is a shell script for installing ROS2 Humble and its dependencies in Ubuntu 22.04. 19 | # It uses mirrors from Tsinghua University to speed up the download. 20 | # The script also sets up the sudo privileges and modifies the sources.list file to update the repositories accordingly. 21 | # It installs ROS2 Humble and its dependencies, initializes rosdep. 22 | # It logs the installation progress and redirects the output to the console and logs files. 23 | # 24 | # Version: 1.1 25 | # Date: 2023-12-11 26 | # Author: Herman Ye @Auromix 27 | # 28 | # Warning: This script is ONLY for ROS2 Humble in ubuntu 22.04 29 | # set -x 30 | set -e 31 | 32 | # Get script directory 33 | SCRIPT_DIR=$(dirname "$0") 34 | 35 | # Get the username of the non-root user 36 | USERNAME=$USERNAME 37 | echo "Current user is: $USERNAME" 38 | echo "Script directory is: $SCRIPT_DIR" 39 | 40 | # Save logs to files 41 | LOG_FILE="${SCRIPT_DIR}/ros2_humble_install.log" 42 | ERR_FILE="${SCRIPT_DIR}/ros2_humble_install.err" 43 | echo "Cleaning up traces of last installation..." 44 | rm -f ${LOG_FILE} 45 | rm -f ${ERR_FILE} 46 | 47 | # Redirect output to console and log files 48 | exec 1> >(tee -a ${LOG_FILE} ) 49 | exec 2> >(tee -a ${ERR_FILE} >&2) 50 | 51 | # Output log info to console 52 | echo "Installation logs will be saved to ${LOG_FILE}" 53 | echo "Installation errors will be saved to ${ERR_FILE}" 54 | 55 | # Waiting to start 56 | echo "Start to install ROS2 Humble..." 57 | sleep 3 58 | 59 | 60 | # No Password sudo config 61 | echo "Setting no-passwd sudo" 62 | sudo sed -i 's/^%sudo.*/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers 63 | 64 | # Get architecture of the system 65 | if [ $(uname -m) = "x86_64" ]; then 66 | MIRROR="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/" 67 | else 68 | MIRROR="https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/" 69 | fi 70 | echo "Current system architecture is: $(uname -m)" 71 | echo "Current mirror is: $MIRROR" 72 | 73 | # Backup original software sources 74 | echo "Backing up sources.list to /etc/apt/sources.list.backup ..." 75 | sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 76 | 77 | # Clear original software sources 78 | echo "# Ubuntu Mirror Settings" | sudo tee /etc/apt/sources.list 79 | 80 | # Replace software sources using tee 81 | echo "deb $MIRROR jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 82 | echo "deb $MIRROR jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 83 | echo "deb $MIRROR jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 84 | 85 | if [ $(uname -m) = "x86_64" ]; then 86 | echo "deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 87 | else 88 | echo "deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list 89 | fi 90 | 91 | # System update 92 | echo "Start to update software..." 93 | sudo apt update 94 | echo "Start to upgrade software..." 95 | sudo apt upgrade -y 96 | 97 | # Install pip 98 | echo "Installing pip..." 99 | sudo apt install python3-dev -y 100 | sudo apt install pip -y # If you haven't already installed pip 101 | 102 | # Set default pip source 103 | echo "configuring pip source..." 104 | pip config set global.index-url http://pypi.tuna.tsinghua.edu.cn/simple 105 | pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn 106 | 107 | # check for UTF-8 108 | echo "Checking locale..." 109 | echo "Current locale:" 110 | locale 111 | 112 | # Set language 113 | echo "Setting language..." 114 | sudo apt update && sudo apt install locales 115 | sudo locale-gen en_US en_US.UTF-8 116 | sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 117 | export LANG=en_US.UTF-8 118 | 119 | # verify settings 120 | echo "Checking locale..." 121 | locale 122 | 123 | # Enable Ubuntu Universe repository 124 | echo "Enabling Ubuntu Universe repository..." 125 | sudo apt install software-properties-common -y 126 | sudo add-apt-repository universe -y 127 | 128 | # Add the ROS 2 GPG key with apt 129 | echo "Adding the ROS 2 GPG key with apt..." 130 | sudo apt update && sudo apt install curl -y 131 | sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg 132 | 133 | # Add the repository to your sources list 134 | echo "Adding the ROS 2 repository to your sources list..." 135 | # echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null 136 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null 137 | 138 | # Update apt repository caches 139 | echo "Updating software caches..." 140 | sudo apt update 141 | echo "Upgrading software..." 142 | sudo apt upgrade -y 143 | 144 | # Install ROS 145 | echo "Installing ROS2 Humble..." 146 | # ROS Desktop Install(ROS, RViz, demos, tutorials) 147 | sudo apt install ros-humble-desktop -y 148 | # ROS Base Install(Communication libraries, message packages, command line tools but no GUI tools) 149 | sudo apt install ros-humble-ros-base -y 150 | # Development tools(Compilers and other tools to build ROS packages) 151 | sudo apt install ros-dev-tools -y 152 | # Install build tool 153 | sudo apt install python3-colcon-common-extensions -y 154 | 155 | # Environment setup 156 | if ! grep -q "source /opt/ros/humble/setup.bash" /home/$USERNAME/.bashrc; then 157 | echo "# ROS2 HUMBLE ENVIRONMENT SETTINGS" | sudo tee -a /home/$USERNAME/.bashrc 158 | echo "source /opt/ros/humble/setup.bash" | sudo tee -a /home/$USERNAME/.bashrc 159 | echo "ROS2 Humble environment setup added to /home/$USERNAME/.bashrc" 160 | else 161 | echo "ROS2 Humble environment is already set in /home/$USERNAME/.bashrc" 162 | fi 163 | source /home/$USERNAME/.bashrc 164 | 165 | # Create your ROS2 workspace 166 | if [ -d "$workspace_dir" ]; then 167 | echo " ROS2 workspace already exists, skip creating." 168 | else 169 | echo "Creating ROS2 workspace" 170 | cd /home/$USERNAME 171 | mkdir -p ros2_workspace/src 172 | cd /home/$USERNAME/ros2_workspace 173 | # Install package dependencies 174 | echo "Installing package dependencies..." 175 | sudo pip install rosdep 176 | sudo pip install rosdepc 177 | sudo rosdepc init > /dev/null 178 | rosdepc update > /dev/null 179 | rosdep install --from-paths src --ignore-src --rosdistro humble -y 180 | echo "Building workspace..." 181 | colcon build 182 | fi 183 | 184 | # System update again 185 | sudo apt update 186 | sudo apt dist-upgrade -y 187 | 188 | # Verifying ROS2 installation 189 | clear 190 | 191 | # Define the variables to be printed 192 | TEXT1="ROS2 Humble installation completed!" 193 | TEXT2="Please open new terminals and run commands to verify the installation:" 194 | TEXT3="ros2 run demo_nodes_cpp talker" 195 | TEXT4="ros2 run demo_nodes_py listener" 196 | 197 | # Define the colors 198 | RED='\033[0;31m' 199 | BLUE='\033[0;34m' 200 | GREEN='\033[1;32m' 201 | NC='\033[0m' 202 | 203 | # Calculate the center of the terminal window 204 | TERMINAL_WIDTH=$(tput cols) 205 | TEXT1_PADDING=$((($TERMINAL_WIDTH-${#TEXT1})/2)) 206 | TEXT2_PADDING=$((($TERMINAL_WIDTH-${#TEXT2})/2)) 207 | TEXT3_PADDING=$((($TERMINAL_WIDTH-${#TEXT3})/2)) 208 | TEXT4_PADDING=$((($TERMINAL_WIDTH-${#TEXT4})/2)) 209 | 210 | # Print the text in the center of the screen in the desired colors 211 | echo "" 212 | echo "" 213 | echo "" 214 | echo "" 215 | echo "" 216 | echo "" 217 | echo "" 218 | echo "" 219 | echo "" 220 | echo "" 221 | echo -e "${GREEN}$(printf '%*s' $TEXT1_PADDING)${TEXT1} ${NC}" 222 | echo -e "${NC}$(printf '%*s' $TEXT2_PADDING)${TEXT2} ${NC}" 223 | echo -e "${RED}$(printf '%*s' $TEXT3_PADDING)${TEXT3} ${NC}" 224 | echo -e "${RED}$(printf '%*s' $TEXT4_PADDING)${TEXT4} ${NC}" 225 | echo "" 226 | echo "" 227 | echo "" 228 | echo "" 229 | echo "" 230 | echo "" 231 | echo "" 232 | echo "" 233 | echo "" 234 | echo "" 235 | 236 | # # Remove ROS2 237 | # sudo apt remove ~nros-humble-* && sudo apt autoremove 238 | # sudo rm /etc/apt/sources.list.d/ros2.list 239 | # sudo apt update 240 | # sudo apt autoremove 241 | # # Consider upgrading for packages previously shadowed. 242 | # sudo apt upgrade 243 | -------------------------------------------------------------------------------- /test_cuda.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2023 Herman Ye @Auromix 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # Author: Herman Ye @Auromix 19 | # Description: Test CUDA and Pytorch environment 20 | 21 | import torch 22 | # import torchvision 23 | 24 | 25 | def main(): 26 | # Check PyTorch version 27 | torch_version = torch.__version__ 28 | print(f"Torch Version: {torch_version}") 29 | 30 | # Check torchvision version 31 | # torchvision_version = torchvision.__version__ 32 | # print(f"Torchvision Version: {torchvision_version}") 33 | 34 | # Check if CUDA is available 35 | cuda_available = torch.cuda.is_available() 36 | print(f"CUDA with torch available: {cuda_available}") 37 | 38 | # Check CUDA version 39 | cuda_version = torch.version.cuda if cuda_available else "N/A (CUDA not available)" 40 | print(f"CUDA Version: {cuda_version}") 41 | 42 | # Check cuDNN version 43 | print(f"cuDNN Version: {str(torch.backends.cudnn.version())}") 44 | 45 | if cuda_available: 46 | # Get the current CUDA device 47 | current_device = torch.cuda.current_device() 48 | print(f"Current CUDA device: {current_device}") 49 | 50 | # Get the number of CUDA devices 51 | num_devices = torch.cuda.device_count() 52 | print(f"Number of CUDA devices: {num_devices}") 53 | 54 | # Get the name of the current CUDA device 55 | device_name = torch.cuda.get_device_name(current_device) 56 | print(f"Name of current CUDA device: {device_name}") 57 | 58 | # TEST 59 | print("") 60 | print("TESTING CUDA WITH PYTORCH") 61 | print("========================") 62 | # Generate a random matrix on CPU 63 | x = torch.rand(5, 3) 64 | print("Random matrix on CPU:") 65 | print(x) 66 | 67 | if cuda_available: 68 | # Move the matrix to CUDA (GPU) 69 | x = x.cuda() 70 | print("\nRandom matrix on CUDA (GPU):") 71 | print(x) 72 | 73 | if cuda_available: 74 | print("\nTensor operations:") 75 | a = torch.cuda.FloatTensor(2).zero_() 76 | b = torch.randn(2).cuda() 77 | c = a + b 78 | print('Tensor a = ' + str(a)) 79 | print('Tensor b = ' + str(b)) 80 | print('Tensor c = ' + str(c)) 81 | 82 | # Add this function to your code if you want to check the environment before running your code 83 | # cuda_pytorch_environment_check() 84 | def cuda_pytorch_environment_check(print_info=True, print_test=False): 85 | try: 86 | # Check PyTorch version 87 | torch_version = torch.__version__ 88 | 89 | # # Check torchvision version 90 | # torchvision_version = torchvision.__version__ 91 | 92 | # Check if CUDA is available 93 | cuda_available = torch.cuda.is_available() 94 | 95 | # Check CUDA version 96 | cuda_version = torch.version.cuda if cuda_available else "N/A (CUDA not available)" 97 | 98 | # Check cuDNN version 99 | cudnn_version = str(torch.backends.cudnn.version()) 100 | 101 | # Get the current CUDA device 102 | current_device = torch.cuda.current_device() 103 | 104 | # Get the number of CUDA devices 105 | num_devices = torch.cuda.device_count() 106 | 107 | # Get the name of the current CUDA device 108 | device_name = torch.cuda.get_device_name(current_device) 109 | 110 | # Print info 111 | if print_info: 112 | print("CUDA PYTORCH ENVIRONMENT CHECK") 113 | print("##############################") 114 | print(f"Torch Version: {torch_version}") 115 | # print(f"Torchvision Version: {torchvision_version}") 116 | print(f"CUDA with torch available: {cuda_available}") 117 | print(f"CUDA Version: {cuda_version}") 118 | print(f"cuDNN Version: {cudnn_version}") 119 | print(f"Current CUDA device: {current_device}") 120 | print(f"Number of CUDA devices: {num_devices}") 121 | print(f"Name of current CUDA device: {device_name}") 122 | print("##############################") 123 | 124 | # Test CUDA tensors 125 | test_cuda_a = torch.cuda.FloatTensor(2).zero_() 126 | test_cuda_b = torch.randn(2).cuda() 127 | test_cuda_c = test_cuda_a + test_cuda_b 128 | test_cuda_d = torch.zeros(4, device="cuda:0") 129 | 130 | # Print test results 131 | if print_test: 132 | print("\nCUDA TENSOR TEST") 133 | print("##############################") 134 | print("Tensor operations:") 135 | print("Tensor a (float 2) = " + str(test_cuda_a)) 136 | print("Tensor b (randn 2) = " + str(test_cuda_b)) 137 | print("Tensor c ( a + b ) = " + str(test_cuda_c)) 138 | print("Tensor d (zeros 4) = " + str(test_cuda_d)) 139 | print("##############################") 140 | 141 | except Exception as e: 142 | print("CUDA PYTORCH CHECK FAILED") 143 | print(f"Error: {e}") 144 | else: 145 | print("\nCUDA PYTORCH CHECK DONE\n") 146 | 147 | if __name__ == "__main__": 148 | main() 149 | --------------------------------------------------------------------------------