diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..dddc35e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "IsaacLab"] + path = IsaacLab + url = https://github.com/isaac-sim/IsaacLab + branch = v1.1.0 diff --git a/IsaacLab b/IsaacLab new file mode 160000 index 0000000..454905b --- /dev/null +++ b/IsaacLab @@ -0,0 +1 @@ +Subproject commit 454905bf08c374b6162e6c4c64a320aa6261fbe6 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d95d565 --- /dev/null +++ b/README.md @@ -0,0 +1,115 @@ +

+ +

+ +

Isaac Simulation Launcher Package

+ +This package tested under ROS2 Humble. Also, IsaacSim version is 4.1 and IsaacLab version is v1.1.0. + +# Prequest +``` + Ubuntu 22.04 + ROS2 Humble + GitHub + NVIDIA Omniverse Launcher + Miniconda +``` +## Setting +### Git +``` + sudo apt-get update + sudo apt install git +``` +**Note** : Set up your configuration before creating a workspace according to [Stackoverflow](https://stackoverflow.com/questions/68775869/message-support-for-password-authentication-was-removed-please-use-a-personal). Also, GCM ensures that you do not constantly write the token for your GitHub account. +``` + git config --global credential.helper store + echo "https://username:token@github.com" >> ~/.git-credentials + usarname: github_username + token: xxx_xxxx +``` +### Pre-install Workspace +Clone Repository +``` + git clone https://github.com/robolaunch/isaacsim_launcher.git --recurse-submodules +``` +### Depencies & ROS2 Intallation +You can review the installros.sh file under isaacsim_launcher/isaacsim_ws directory. That shellscript prepared according to ROS2 Humble documentation. +``` + sh /isaacsim_ws/installros.sh +``` +### Update .bashrc +Add the following block at the end of .bashrc. You have to pay attention about the "isaacsim_launcherDirectory", it has to point the isaacsim_launcher directory. This following block just example. +``` + isaacsim_launcherDirectory=/home/${USER}/isaacsim_launcher/ + ################### + ### EXPORTS + export ROS_DOMAIN_ID=0 + export FASTRTPS_DEFAULT_PROFILES_FILE=${isaacsim_launcherDirectory}/isaacsim_ws/fastdds.xml + export _colcon_cd_root=/opt/ros/humble/ + export ISAACSIM_PATH="${HOME}/.local/share/ov/pkg/isaac-sim-4.1.0/" + export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh" + ### EXPORTS + ################### + ################### + ### SOURCES + source /opt/ros/humble/setup.bash + source ${isaacsim_launcherDirectory}/isaacsim_ws/install/setup.bash + source /usr/share/colcon_cd/function/colcon_cd.sh + source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash + ### SOURCES + ################### +``` +### Miniconda3 +``` + https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh (for x64) + sh @Downloads directory + accept eula, and no for init + conda config --set auto_activate_base false +``` +Finally, add the following block at the end of .bashrc if only if doesn't exists! +``` + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + __conda_setup="$('${HOME}/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" + if [ $? -eq 0 ]; then + eval "$__conda_setup" + else + if [ -f "${HOME}/miniconda3/etc/profile.d/conda.sh" ]; then + . "${HOME}/miniconda3/etc/profile.d/conda.sh" + else + export PATH="${HOME}/miniconda3/bin:$PATH" + fi + fi + unset __conda_setup + # <<< conda initialize <<< +``` +### IsaacLab +``` + cd ${isaacsim_launcherDirectory}/IsaacLab/ + ln -s ${ISAACSIM_PATH} _isaac_sim + ./isaaclab.sh --conda + conda activate isaaclab + pip install --upgrade pip + ./isaaclab.sh --install + ./isaaclab.sh --install rl_games + python source/standalone/tutorials/00_sim/create_empty.py (for verification) +``` + +# Workspace + +1. Install Depencies +``` + cd ${isaacsim_launcherDirectory}/isaacsim_ws/ + rosdep install --from-paths src --ignore-src -r -y +``` +2. Build +``` + colcon build +``` + +## Running +1. Launch the Isaac Sim +``` + Open the new terminal or execute "bash" + ros2 launch isaacsim run_isaacsim.launch.py +``` diff --git a/isaacsim_ws/.gitignore b/isaacsim_ws/.gitignore new file mode 100644 index 0000000..1345657 --- /dev/null +++ b/isaacsim_ws/.gitignore @@ -0,0 +1,3 @@ +build/ +install/ +log/ diff --git a/isaacsim_ws/fastdds.xml b/isaacsim_ws/fastdds.xml new file mode 100644 index 0000000..83bcc53 --- /dev/null +++ b/isaacsim_ws/fastdds.xml @@ -0,0 +1,27 @@ + + +Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. + + + + + + UdpTransport + UDPv4 + + + + + + + UdpTransport + + false + + + \ No newline at end of file diff --git a/isaacsim_ws/installros.sh b/isaacsim_ws/installros.sh new file mode 100644 index 0000000..9411235 --- /dev/null +++ b/isaacsim_ws/installros.sh @@ -0,0 +1,20 @@ +locale +sudo apt update && sudo apt install -y locales +sudo locale-gen en_US en_US.UTF-8 +sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 +locale + +sudo apt install software-properties-common +sudo add-apt-repository universe +sudo apt update && sudo apt install -y curl +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg +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 +sudo apt update +sudo apt upgrade +sudo apt install -y ros-humble-desktop +sudo apt install -y libfuse2 cmake build-essential python3-colcon-common-extensions python3-pip python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential ros-humble-vision-msgs ros-humble-ackermann-msgs +sudo rosdep init +rosdep update +pip install --upgrade pip +pip install catkin_pkg diff --git a/isaacsim_ws/src/custom_message/CMakeLists.txt b/isaacsim_ws/src/custom_message/CMakeLists.txt new file mode 100644 index 0000000..db6f8e7 --- /dev/null +++ b/isaacsim_ws/src/custom_message/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.5) +project(custom_message) + +# Default to C99 +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() + +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(std_msgs REQUIRED) +find_package(rosidl_default_generators REQUIRED) + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/SampleMsg.msg" + DEPENDENCIES std_msgs + ) +# uncomment the following section in order to fill in +# further dependencies manually. +# find_package( REQUIRED) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # uncomment the line when a copyright and license is not present in all source files + #set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # uncomment the line when this package is not in a git repo + #set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/isaacsim_ws/src/custom_message/msg/SampleMsg.msg b/isaacsim_ws/src/custom_message/msg/SampleMsg.msg new file mode 100644 index 0000000..a9a5d89 --- /dev/null +++ b/isaacsim_ws/src/custom_message/msg/SampleMsg.msg @@ -0,0 +1,2 @@ +std_msgs/String my_string +int64 my_num diff --git a/isaacsim_ws/src/custom_message/package.xml b/isaacsim_ws/src/custom_message/package.xml new file mode 100644 index 0000000..f91f9e2 --- /dev/null +++ b/isaacsim_ws/src/custom_message/package.xml @@ -0,0 +1,32 @@ + + + + custom_message + 0.0.0 + Custom Message Sample Package + Isaac Sim + + Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + NVIDIA CORPORATION and its licensors retain all intellectual property + and proprietary rights in and to this software, related documentation + and any modifications thereto. Any use, reproduction, disclosure or + distribution of this software and related documentation without an express + license agreement from NVIDIA CORPORATION is strictly prohibited. + + https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html + https://forums.developer.nvidia.com/c/omniverse/simulation/69 + + ament_cmake + + std_msgs + rosidl_default_generators + rosidl_default_runtime + rosidl_interface_packages + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/isaacsim_ws/src/isaac_ros2_messages/CMakeLists.txt b/isaacsim_ws/src/isaac_ros2_messages/CMakeLists.txt new file mode 100644 index 0000000..a61aebf --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.5) +project(isaac_ros2_messages) + +# Default to C99 +if(NOT CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() + +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +# uncomment the following section in order to fill in +# further dependencies manually. +# find_package( REQUIRED) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # uncomment the line when a copyright and license is not present in all source files + #set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # uncomment the line when this package is not in a git repo + #set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + + +find_package(builtin_interfaces REQUIRED) +find_package(rosidl_default_generators REQUIRED) + +IF (WIN32) +find_package(FastRTPS REQUIRED) +ELSE() +find_package(fastrtps REQUIRED) +ENDIF() + +find_package(std_msgs REQUIRED) +find_package(geometry_msgs REQUIRED) + +rosidl_generate_interfaces(${PROJECT_NAME} + "srv/IsaacPose.srv" + "srv/GetPrims.srv" + "srv/GetPrimAttributes.srv" + "srv/GetPrimAttribute.srv" + "srv/SetPrimAttribute.srv" + DEPENDENCIES builtin_interfaces std_msgs geometry_msgs +) + +ament_package() diff --git a/isaacsim_ws/src/isaac_ros2_messages/package.xml b/isaacsim_ws/src/isaac_ros2_messages/package.xml new file mode 100644 index 0000000..fdd3557 --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/package.xml @@ -0,0 +1,38 @@ + + + + isaac_ros2_messages + 0.2.0 + ROS2 messages for isaac ros2 bridge + Isaac Sim + + Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + NVIDIA CORPORATION and its licensors retain all intellectual property + and proprietary rights in and to this software, related documentation + and any modifications thereto. Any use, reproduction, disclosure or + distribution of this software and related documentation without an express + license agreement from NVIDIA CORPORATION is strictly prohibited. + + https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html + https://forums.developer.nvidia.com/c/omniverse/simulation/69 + + ament_cmake + + ament_lint_auto + ament_lint_common + + rosidl_default_generators + std_msgs + geometry_msgs + + builtin_interfaces + rosidl_default_runtime + std_msgs + geometry_msgs + + rosidl_interface_packages + + + ament_cmake + + diff --git a/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrimAttribute.srv b/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrimAttribute.srv new file mode 100644 index 0000000..10adbc2 --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrimAttribute.srv @@ -0,0 +1,7 @@ +string path # prim path +string attribute # attribute name +--- +string value # attribute value (as JSON) +string type # attribute type +bool success # indicate a successful execution of the service +string message # informational, e.g. for error messages \ No newline at end of file diff --git a/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrimAttributes.srv b/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrimAttributes.srv new file mode 100644 index 0000000..26eb58a --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrimAttributes.srv @@ -0,0 +1,7 @@ +string path # prim path +--- +string[] names # list of attribute base names (name used to Get or Set an attribute) +string[] displays # list of attribute display names (name displayed in Property tab) +string[] types # list of attribute data types +bool success # indicate a successful execution of the service +string message # informational, e.g. for error messages \ No newline at end of file diff --git a/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrims.srv b/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrims.srv new file mode 100644 index 0000000..7afbab6 --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/srv/GetPrims.srv @@ -0,0 +1,6 @@ +string path # get prims at path +--- +string[] paths # list of prim paths +string[] types # prim type names +bool success # indicate a successful execution of the service +string message # informational, e.g. for error messages \ No newline at end of file diff --git a/isaacsim_ws/src/isaac_ros2_messages/srv/IsaacPose.srv b/isaacsim_ws/src/isaac_ros2_messages/srv/IsaacPose.srv new file mode 100644 index 0000000..72d1a58 --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/srv/IsaacPose.srv @@ -0,0 +1,6 @@ +std_msgs/Header header +string[] names +geometry_msgs/Pose[] poses +geometry_msgs/Twist[] velocities +geometry_msgs/Vector3[] scales +--- diff --git a/isaacsim_ws/src/isaac_ros2_messages/srv/SetPrimAttribute.srv b/isaacsim_ws/src/isaac_ros2_messages/srv/SetPrimAttribute.srv new file mode 100644 index 0000000..c70a5ee --- /dev/null +++ b/isaacsim_ws/src/isaac_ros2_messages/srv/SetPrimAttribute.srv @@ -0,0 +1,6 @@ +string path # prim path +string attribute # attribute name +string value # attribute value (as JSON) +--- +bool success # indicate a successful execution of the service +string message # informational, e.g. for error messages \ No newline at end of file diff --git a/isaacsim_ws/src/isaac_tutorials/CMakeLists.txt b/isaacsim_ws/src/isaac_tutorials/CMakeLists.txt new file mode 100644 index 0000000..4d17ff7 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.5) +project(isaac_tutorials) + +find_package(ament_cmake REQUIRED) +find_package(rclpy REQUIRED) + +install(DIRECTORY + rviz2 + scripts + DESTINATION share/${PROJECT_NAME}) + +# Install Python executables +install(PROGRAMS + scripts/ros2_publisher.py + scripts/ros2_ackermann_publisher.py + DESTINATION lib/${PROJECT_NAME} +) +ament_package() diff --git a/isaacsim_ws/src/isaac_tutorials/package.xml b/isaacsim_ws/src/isaac_tutorials/package.xml new file mode 100644 index 0000000..770aa10 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/package.xml @@ -0,0 +1,37 @@ + + + + isaac_tutorials + 0.1.0 + + The isaac_tutorials package + + + Isaac Sim + + Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + NVIDIA CORPORATION and its licensors retain all intellectual property + and proprietary rights in and to this software, related documentation + and any modifications thereto. Any use, reproduction, disclosure or + distribution of this software and related documentation without an express + license agreement from NVIDIA CORPORATION is strictly prohibited. + + https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html + https://forums.developer.nvidia.com/c/omniverse/simulation/69 + + ament_cmake + rqt_image_view + + launch + launch_ros + + joint_state_publisher + ackermann_msgs + + rviz2 + + + + ament_cmake + + diff --git a/isaacsim_ws/src/isaac_tutorials/rviz2/camera_lidar.rviz b/isaacsim_ws/src/isaac_tutorials/rviz2/camera_lidar.rviz new file mode 100644 index 0000000..ac8ddd2 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/rviz2/camera_lidar.rviz @@ -0,0 +1,279 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 0 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /Camera1 - RGB1 + - /TF1 + Splitter Ratio: 0.5 + Tree Height: 871 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/Image + Enabled: false + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Camera1 - Depth + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera_1/depth/image_rect_raw + Value: false + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Camera2 - Depth + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera_2/depth/image_rect_raw + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 34 + Min Color: 0; 0; 0 + Min Intensity: 1 + Name: LaserScan + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.05000000074505806 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /laser_scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Camera2 - RGB + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera_2/rgb/image_raw + Value: true + - Class: rviz_default_plugins/Image + Enabled: false + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Camera1 - RGB + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera_1/rgb/image_raw + Value: false + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + Camera_1: + Value: true + Camera_2: + Value: true + base_footprint: + Value: true + base_link: + Value: true + base_scan: + Value: true + caster_back_link: + Value: true + imu_link: + Value: true + odom: + Value: true + wheel_left_link: + Value: true + wheel_right_link: + Value: true + world: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + world: + Camera_1: + {} + Camera_2: + {} + base_link: + base_footprint: + {} + base_scan: + {} + caster_back_link: + {} + imu_link: + {} + wheel_left_link: + {} + wheel_right_link: + {} + Update Interval: 0 + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: world + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 8.917070388793945 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: -1.0011783838272095 + Y: 1.8463866710662842 + Z: 0.4111546277999878 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.329797625541687 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.25040191411972046 + Saved: ~ +Window Geometry: + Camera1 - Depth: + collapsed: false + Camera1 - RGB: + collapsed: false + Camera2 - Depth: + collapsed: false + Camera2 - RGB: + collapsed: false + Displays: + collapsed: false + Height: 1022 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd0000000400000000000002a1000003a4fc020000000efb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000003a4000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000001a00430061006d00650072006100310020002d002000520047004202000009db000002a3000001ee00000163fb0000001e00430061006d00650072006100320020002d00200044006500700074006803000009a2000002f10000020800000148fb0000001e00430061006d00650072006100310020002d00200044006500700074006802000009ba0000014c00000203000000e4fb0000001a00430061006d00650072006100320020002d00200052004700420300000991000001420000020500000149fb0000001a00430061006d00650072006100320020002d002000520047004201000002730000009d0000000000000000fb0000001a00430061006d00650072006100310020002d00200052004700420100000316000000cb0000000000000000000000010000015f000003a4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000003a4000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000a9e000000a9fc0100000003fb0000000c00430061006d006500720061000000000000000a9e0000000000000000fb0000000c00430061006d00650072006103000023f30000029f0000020100000149fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000005d3000003a400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 2527 + X: 1351 + Y: 96 diff --git a/isaacsim_ws/src/isaac_tutorials/rviz2/camera_manual.rviz b/isaacsim_ws/src/isaac_tutorials/rviz2/camera_manual.rviz new file mode 100644 index 0000000..50a3a3e --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/rviz2/camera_manual.rviz @@ -0,0 +1,161 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 138 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + Splitter Ratio: 0.5 + Tree Height: 1286 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/Camera + Enabled: true + Image Rendering: background and overlay + Name: Depth + Overlay Alpha: 0.5 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /depth + Value: true + Visibility: + Grid: true + RGB: true + Value: true + Zoom Factor: 1 + - Class: rviz_default_plugins/Camera + Enabled: true + Image Rendering: background and overlay + Name: RGB + Overlay Alpha: 0.5 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /rgb + Value: true + Visibility: + Depth: true + Grid: true + Value: true + Zoom Factor: 1 + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: sim_camera + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 10 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.785398006439209 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.785398006439209 + Saved: ~ +Window Geometry: + Depth: + collapsed: false + Displays: + collapsed: false + Height: 1690 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd0000000400000000000001f7000005fefc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b000000b000fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000006e000005fe0000018200fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a004400650070007400680300001343000008170000030b000001f8fb000000060052004700420300001010000008160000030a000001f5000000010000015f000005fefc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000006e000005fe0000013200fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000006ae000005fe00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + RGB: + collapsed: false + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 2588 + X: 3535 + Y: 1306 diff --git a/isaacsim_ws/src/isaac_tutorials/rviz2/carter_stereo.rviz b/isaacsim_ws/src/isaac_tutorials/rviz2/carter_stereo.rviz new file mode 100644 index 0000000..c904dcd --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/rviz2/carter_stereo.rviz @@ -0,0 +1,318 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 138 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /TF1 + - /Odometry1/Topic1 + - /Left Camera - RGB1 + - /Right Camera - RGB1 + Splitter Ratio: 0.5 + Tree Height: 733 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + base_link: + Value: true + chassis_link: + Value: true + front_2d_lidar: + Value: true + front_3d_lidar: + Value: true + front_stereo_camera_imu: + Value: true + front_stereo_camera_left_optical: + Value: true + front_stereo_camera_right_optical: + Value: true + left_stereo_camera_imu: + Value: true + left_stereo_camera_left_optical: + Value: true + left_stereo_camera_right_optical: + Value: true + odom: + Value: true + rear_2d_lidar: + Value: true + rear_stereo_camera:imu: + Value: true + rear_stereo_camera:left_rgb: + Value: true + rear_stereo_camera:right_rgb: + Value: true + right_stereo_camera_imu: + Value: true + right_stereo_camera_left_optical: + Value: true + right_stereo_camera_right_optical: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + odom: + base_link: + chassis_link: + {} + front_2d_lidar: + {} + front_3d_lidar: + {} + front_stereo_camera_imu: + {} + front_stereo_camera_left_optical: + {} + front_stereo_camera_right_optical: + {} + left_stereo_camera_imu: + {} + left_stereo_camera_left_optical: + {} + left_stereo_camera_right_optical: + {} + rear_2d_lidar: + {} + rear_stereo_camera:imu: + {} + rear_stereo_camera:left_rgb: + {} + rear_stereo_camera:right_rgb: + {} + right_stereo_camera_imu: + {} + right_stereo_camera_left_optical: + {} + right_stereo_camera_right_optical: + {} + Update Interval: 0 + Value: true + - Angle Tolerance: 0.10000000149011612 + Class: rviz_default_plugins/Odometry + Covariance: + Orientation: + Alpha: 0.5 + Color: 255; 255; 127 + Color Style: Unique + Frame: Local + Offset: 1 + Scale: 1 + Value: true + Position: + Alpha: 0.30000001192092896 + Color: 204; 51; 204 + Scale: 1 + Value: true + Value: true + Enabled: true + Keep: 100 + Name: Odometry + Position Tolerance: 0.10000000149011612 + Shape: + Alpha: 1 + Axes Length: 1 + Axes Radius: 0.10000000149011612 + Color: 255; 25; 0 + Head Length: 0.30000001192092896 + Head Radius: 0.10000000149011612 + Shaft Length: 1 + Shaft Radius: 0.05000000074505806 + Value: Arrow + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: odom + Value: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Left Camera - RGB + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /front_stereo_camera/left/image_raw + Value: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Right Camera - RGB + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /front_stereo_camera/right/image_raw + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: PointCloud2 + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /front_3d_lidar/lidar_points + Use Fixed Frame: true + Use rainbow: true + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: odom + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 7.74399995803833 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0.7320740818977356 + Y: 0.9904739856719971 + Z: 1.7632932662963867 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.7803976535797119 + Target Frame: + Value: Orbit (rviz) + Yaw: 1.0203975439071655 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1022 + Hide Left Dock: false + Hide Right Dock: true + Left Camera - RGB: + collapsed: false + QMainWindow State: 000000ff00000000fd0000000400000000000001f7000003a4fc020000000dfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000003a4000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000002800520069006700680074002000430061006d0065007200610020002d002000440065007000740068020000128b00000218000002390000017ffb00000026004c006500660074002000430061006d0065007200610020002d002000440065007000740068020000102e000002180000023c00000181fb00000022004c006500660074002000430061006d0065007200610020002d002000520047004203000010200000020c000001f30000011efb0000002400520069006700680074002000430061006d0065007200610020002d002000520047004203000012530000020d000001f30000011efb0000000a0049006d006100670065030000236c0000040e0000023e0000017e000000010000015f000003a4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d000003a4000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000004e5000003a400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Right Camera - RGB: + collapsed: false + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: true + Width: 1762 + X: 3585 + Y: 352 diff --git a/isaacsim_ws/src/isaac_tutorials/rviz2/rtx_lidar.rviz b/isaacsim_ws/src/isaac_tutorials/rviz2/rtx_lidar.rviz new file mode 100644 index 0000000..115ab37 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/rviz2/rtx_lidar.rviz @@ -0,0 +1,191 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 138 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /PointCloud21 + - /LaserScan1 + Splitter Ratio: 0.5 + Tree Height: 938 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: PointCloud2 + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /point_cloud + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 28 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: LaserScan + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.03999999910593033 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /scan + Use Fixed Frame: true + Use rainbow: true + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: sim_lidar + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 33.790897369384766 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 4.0773420333862305 + Y: 8.741633415222168 + Z: 1.6276212930679321 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.4153982698917389 + Target Frame: + Value: Orbit (rviz) + Yaw: 3.3785688877105713 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1342 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd0000000400000000000001f7000004a2fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b000000b000fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000006e000004a20000018200fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000015f000004a2fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000006e000004a20000013200fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000006a4000004a200000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 2578 + X: 1999 + Y: 339 diff --git a/isaacsim_ws/src/isaac_tutorials/rviz2/turtle_stereo.rviz b/isaacsim_ws/src/isaac_tutorials/rviz2/turtle_stereo.rviz new file mode 100644 index 0000000..faec1d2 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/rviz2/turtle_stereo.rviz @@ -0,0 +1,160 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 138 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Camera1 + - /Camera2 + Splitter Ratio: 0.5 + Tree Height: 1120 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/Camera + Enabled: true + Image Rendering: background and overlay + Name: Camera + Overlay Alpha: 0.5 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /rgb + Value: true + Visibility: + Camera: true + Grid: true + Value: true + Zoom Factor: 1 + - Class: rviz_default_plugins/Camera + Enabled: true + Image Rendering: background and overlay + Name: Camera + Overlay Alpha: 0.5 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /rgb_2 + Value: true + Visibility: + Camera: true + Grid: true + Value: true + Zoom Factor: 1 + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: sim_camera + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 10 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: -7.855632781982422 + Y: -8.80923843383789 + Z: 11.783849716186523 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.785398006439209 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.785398006439209 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 1658 + Hide Left Dock: false + Hide Right Dock: true + QMainWindow State: 000000ff00000000fd0000000400000000000001f70000007afc0200000007fb0000001200530065006c0065006300740069006f006e00000001e10000009b000000b000fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000015f00000132fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000051a000001320000013200fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000a1500000558fc0100000004fb000000100044006900730070006c0061007900730100000000000001f7000001f700fffffffb0000000c00430061006d006500720061010000020300000404000000a500fffffffb0000000c00430061006d006500720061010000061300000402000000a500fffffffb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d0065010000000000000450000000000000000000000a150000007a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: true + Width: 2581 + X: 8243 + Y: 317 diff --git a/isaacsim_ws/src/isaac_tutorials/scripts/ros2_ackermann_publisher.py b/isaacsim_ws/src/isaac_tutorials/scripts/ros2_ackermann_publisher.py new file mode 100644 index 0000000..abcb420 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/scripts/ros2_ackermann_publisher.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +import rclpy +from rclpy.node import Node + +from ackermann_msgs.msg import AckermannDriveStamped +import numpy as np + +class MinimalPublisher(Node): + + def __init__(self): + super().__init__('test_ackermann') + self.publisher_ = self.create_publisher(AckermannDriveStamped, 'ackermann_cmd', 10) + timer_period = 0.05 # seconds + self.timer = self.create_timer(timer_period, self.timer_callback) + self.i = 0 + + def timer_callback(self): + msg = AckermannDriveStamped() + + # Only command forklift using acceleration and steering angle + degrees1 = np.arange(0, 60) + degrees2 = np.arange(-60, 0) + degrees = np.concatenate((degrees1, degrees1[::-1], degrees2[::-1], degrees2)) + msg.header.frame_id = "forklift" + msg.header.stamp = self.get_clock().now().to_msg() + msg.drive.steering_angle = 0.0174533 * (degrees[self.i % degrees.size]) + + msg.drive.acceleration = float(degrees[self.i % degrees.size]) + + self.publisher_.publish(msg) + self.i += 1 + + +def main(args=None): + + rclpy.init(args=args) + + minimal_publisher = MinimalPublisher() + + rclpy.spin(minimal_publisher) + + minimal_publisher.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() diff --git a/isaacsim_ws/src/isaac_tutorials/scripts/ros2_publisher.py b/isaacsim_ws/src/isaac_tutorials/scripts/ros2_publisher.py new file mode 100644 index 0000000..a47f723 --- /dev/null +++ b/isaacsim_ws/src/isaac_tutorials/scripts/ros2_publisher.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +import rclpy +from rclpy.node import Node +from sensor_msgs.msg import JointState +import numpy as np +import time + + +class TestROS2Bridge(Node): + def __init__(self): + + super().__init__("test_ros2bridge") + + # Create the publisher. This publisher will publish a JointState message to the /joint_command topic. + self.publisher_ = self.create_publisher(JointState, "joint_command", 10) + + # Create a JointState message + self.joint_state = JointState() + + self.joint_state.name = [ + "panda_joint1", + "panda_joint2", + "panda_joint3", + "panda_joint4", + "panda_joint5", + "panda_joint6", + "panda_joint7", + "panda_finger_joint1", + "panda_finger_joint2", + ] + + num_joints = len(self.joint_state.name) + + # make sure kit's editor is playing for receiving messages + self.joint_state.position = np.array([0.0] * num_joints, dtype=np.float64).tolist() + self.default_joints = [0.0, -1.16, -0.0, -2.3, -0.0, 1.6, 1.1, 0.4, 0.4] + + # limiting the movements to a smaller range (this is not the range of the robot, just the range of the movement + self.max_joints = np.array(self.default_joints) + 0.5 + self.min_joints = np.array(self.default_joints) - 0.5 + + # position control the robot to wiggle around each joint + self.time_start = time.time() + + timer_period = 0.05 # seconds + self.timer = self.create_timer(timer_period, self.timer_callback) + + def timer_callback(self): + self.joint_state.header.stamp = self.get_clock().now().to_msg() + + joint_position = ( + np.sin(time.time() - self.time_start) * (self.max_joints - self.min_joints) * 0.5 + self.default_joints + ) + self.joint_state.position = joint_position.tolist() + + # Publish the message to the topic + self.publisher_.publish(self.joint_state) + + +def main(args=None): + rclpy.init(args=args) + + ros2_publisher = TestROS2Bridge() + + rclpy.spin(ros2_publisher) + + # Destroy the node explicitly + ros2_publisher.destroy_node() + rclpy.shutdown() + + +if __name__ == "__main__": + main() diff --git a/isaacsim_ws/src/isaacsim/CMakeLists.txt b/isaacsim_ws/src/isaacsim/CMakeLists.txt new file mode 100644 index 0000000..968b438 --- /dev/null +++ b/isaacsim_ws/src/isaacsim/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.5) +project(isaacsim) + +find_package(ament_cmake REQUIRED) +find_package(rclpy REQUIRED) + +install(DIRECTORY + scripts + launch + DESTINATION share/${PROJECT_NAME}) + +# Install Python executables +install(PROGRAMS + scripts/run_isaacsim.py + scripts/open_isaacsim_stage.py + DESTINATION lib/${PROJECT_NAME} +) +ament_package() diff --git a/isaacsim_ws/src/isaacsim/launch/run_isaacsim.launch.py b/isaacsim_ws/src/isaacsim/launch/run_isaacsim.launch.py new file mode 100644 index 0000000..1802953 --- /dev/null +++ b/isaacsim_ws/src/isaacsim/launch/run_isaacsim.launch.py @@ -0,0 +1,93 @@ +## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +## NVIDIA CORPORATION and its licensors retain all intellectual property +## and proprietary rights in and to this software, related documentation +## and any modifications thereto. Any use, reproduction, disclosure or +## distribution of this software and related documentation without an express +## license agreement from NVIDIA CORPORATION is strictly prohibited. + +from launch import LaunchDescription +from ament_index_python.packages import get_package_share_directory +from launch_ros.actions import Node +from launch.actions import DeclareLaunchArgument, ExecuteProcess, OpaqueFunction +from launch.substitutions import LaunchConfiguration, Command, PythonExpression +from launch.conditions import IfCondition +from launch_ros.substitutions import FindPackageShare + + +# Declare all launch arguments corresponding to the bash script options +launch_args = [ + DeclareLaunchArgument('version', default_value='4.1.0', description='Specify the version of Isaac Sim to use. Isaac Sim will be run from default install root folder for the specified version. Leave empty to use latest version of Isaac Sim.'), + + DeclareLaunchArgument('install_path', default_value='', description='If Isaac Sim is insalled in a non-default location, provide a specific path to Isaac Sim installation root folder. (If defined, "version" parameter will be ignored)'), + + DeclareLaunchArgument('use_internal_libs', default_value='false', description='Set to true if you wish to use internal ROS libraries shipped with Isaac Sim.'), + + DeclareLaunchArgument('dds_type', default_value='fastdds', description='Set to "fastdds" or "cyclonedds" (Cyclone only supported for ROS Humble) to run Isaac Sim with a specific dds type.'), + + DeclareLaunchArgument('gui', default_value='', description='Provide the path to a usd file to open it when starting Isaac Sim in standard gui mode. If left empty, Isaac Sim will open an empty stage in standard gui mode.'), + + DeclareLaunchArgument('standalone', default_value='', description='Provide the path to the python file to open it and start Isaac Sim in standalone workflow. If left empty, Isaac Sim will open an empty stage in standard Gui mode.'), + + DeclareLaunchArgument('play_sim_on_start', default_value='false', description='If enabled and Isaac Sim will start playing the scene after it is loaded. (Only applicable when in standard gui mode and loading a scene)'), + + DeclareLaunchArgument('ros_distro', default_value='humble', description='Provide ROS version to use. Only Humble and Foxy is supported.'), + + DeclareLaunchArgument('ros_installation_path', default_value='', description='If ROS is installed in a non-default location (as in not under /opt/ros/), provide the path to your main setup.bash file for your ROS install. (/path/to/custom/ros/install/setup.bash)'), + + DeclareLaunchArgument('headless', default_value='', description='Set to "native" or "webrtc" to run Isaac Sim with different headless modes, if left blank, Isaac Sim will run in the regular GUI workflow. This parameter can be overridden by "standalone" parameter.'), + +] + +# List of parameters to check +parameters_to_check = [ + 'version', 'install_path', 'use_internal_libs', 'dds_type', + 'standalone', 'play_sim_on_start', 'ros_distro', 'ros_installation_path', 'gui' +] + +def launch_setup(context): + + def add_parameter_argument(param_name, command_list): + param_value = LaunchConfiguration(param_name).perform(context) # Here you'll get the runtime config value + + if param_value != '': + if param_value == 'true': + return command_list + ['--' + param_name.replace('_', '-')] + elif param_value == 'false': + return command_list + else: + return command_list + ['--' + param_name.replace('_', '-'), param_value,] + else: + return command_list + + bash_command = [] + + # Add parameters to the command list if they are set + for param in parameters_to_check: + bash_command = add_parameter_argument(param, bash_command) + + # Run isaac sim as a ROS2 node with default parameters. Parameters can be overridden here or via launch arguments from other launch files. + isaacsim_node = Node( + package='isaacsim', executable='run_isaacsim.py', + name='isaacsim', output="screen", + parameters=[{ + 'version': LaunchConfiguration('version'), + 'install_path': LaunchConfiguration('install_path'), + 'use_internal_libs': LaunchConfiguration('use_internal_libs'), + 'dds_type': LaunchConfiguration('dds_type'), + 'gui': LaunchConfiguration('gui'), + 'standalone': LaunchConfiguration('standalone'), + 'play_sim_on_start': LaunchConfiguration('play_sim_on_start'), + 'ros_distro': LaunchConfiguration('ros_distro'), + 'ros_installation_path': LaunchConfiguration('ros_installation_path'), + 'headless': LaunchConfiguration('headless') + }] + ) + return [isaacsim_node] + + +# Create and return the launch description with all declared arguments and the execute launch_setup +def generate_launch_description(): + opfunc = OpaqueFunction(function = launch_setup) + ld = LaunchDescription(launch_args) + ld.add_action(opfunc) + return ld diff --git a/isaacsim_ws/src/isaacsim/package.xml b/isaacsim_ws/src/isaacsim/package.xml new file mode 100644 index 0000000..d5f2f87 --- /dev/null +++ b/isaacsim_ws/src/isaacsim/package.xml @@ -0,0 +1,30 @@ + + + + isaacsim + 0.1.0 + + The isaacsim package that contains the script which can used to launch Isaac Sim as a ROS2 node from a launch file. + + + Isaac Sim + + Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + NVIDIA CORPORATION and its licensors retain all intellectual property + and proprietary rights in and to this software, related documentation + and any modifications thereto. Any use, reproduction, disclosure or + distribution of this software and related documentation without an express + license agreement from NVIDIA CORPORATION is strictly prohibited. + + https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html + https://forums.developer.nvidia.com/c/omniverse/simulation/69 + + ament_cmake + + launch + launch_ros + + + ament_cmake + + diff --git a/isaacsim_ws/src/isaacsim/scripts/open_isaacsim_stage.py b/isaacsim_ws/src/isaacsim/scripts/open_isaacsim_stage.py new file mode 100644 index 0000000..2fdc67a --- /dev/null +++ b/isaacsim_ws/src/isaacsim/scripts/open_isaacsim_stage.py @@ -0,0 +1,84 @@ +"""Script to open a USD stage in Isaac Sim (in standard gui mode). This script along with its arguments are automatically passed to Isaac Sim via the ROS2 launch workflow""" + +import carb +import argparse +import omni.usd +import asyncio +import omni.client +import omni.kit.async_engine +import omni.timeline + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--path', type=str, required=True, help='The path to USD stage') + + # Add the --start-on-play option + # If --start-on-play is specified, it sets the value to True + parser.add_argument('--start-on-play', action='store_true', + help='If present, to true.') + + try: + options = parser.parse_args() + except Exception as e: + carb.log_error(str(e)) + return + + omni.kit.async_engine.run_coroutine(open_stage_async(options.path, options.start_on_play)) + +async def open_stage_async(path: str, start_on_play: bool): + timeline_interface = None + if start_on_play: + timeline_interface = omni.timeline.get_timeline_interface() + + async def _open_stage_internal(path): + is_stage_with_session = False + try: + import omni.kit.usd.layers as layers + live_session_name = layers.get_live_session_name_from_shared_link(path) + is_stage_with_session = live_session_name is not None + except Exception: + pass + + if is_stage_with_session: + # Try to open the stage with specified live session. + (success, error) = await layers.get_live_syncing().open_stage_with_live_session_async(path) + else: + # Otherwise, use normal stage open. + (success, error) = await omni.usd.get_context().open_stage_async(path) + + if not success: + carb.log_error(f"Failed to open stage {path}: {error}.") + else: + if timeline_interface is not None: + await omni.kit.app.get_app().next_update_async() + await omni.kit.app.get_app().next_update_async() + timeline_interface.play() + print("Stage loaded and simulation is playing.") + pass + result, _ = await omni.client.stat_async(path) + if result == omni.client.Result.OK: + await _open_stage_internal(path) + + return + + broken_url = omni.client.break_url(path) + if broken_url.scheme == 'omniverse': + # Attempt to connect to nucleus server before opening stage + try: + from omni.kit.widget.nucleus_connector import get_nucleus_connector + nucleus_connector = get_nucleus_connector() + except Exception: + carb.log_warn("Open stage: Could not import Nucleus connector.") + return + + server_url = omni.client.make_url(scheme='omniverse', host=broken_url.host) + nucleus_connector.connect( + broken_url.host, server_url, + on_success_fn=lambda *_: asyncio.ensure_future(_open_stage_internal(path)), + on_failed_fn=lambda *_: carb.log_error(f"Open stage: Failed to connect to server '{server_url}'.") + ) + else: + carb.log_warn(f"Open stage: Could not open non-existent url '{path}'.") + + +main() diff --git a/isaacsim_ws/src/isaacsim/scripts/run_isaacsim.py b/isaacsim_ws/src/isaacsim/scripts/run_isaacsim.py new file mode 100755 index 0000000..ac97425 --- /dev/null +++ b/isaacsim_ws/src/isaacsim/scripts/run_isaacsim.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +import rclpy +from rclpy.node import Node +import argparse +import os +import subprocess +import signal +import sys +import atexit +import psutil + +# Default values +defaults = { + "isaac_sim_version": "4.1.0", + "isaac_sim_path": "", + "use_internal_libs": False, + "dds_type": "fastdds", + "gui": "", + "standalone": "", + "play_sim_on_start": False, + "ros_distro_var": "foxy", + "ros_installation_path": "", + "headless": "" +} + +# List to keep track of subprocesses +subprocesses = [] + +def signal_handler(sig, frame): + print('Ctrl+C received, shutting down...') + isaac_sim_shutdown() + sys.exit(0) + +def isaac_sim_shutdown(): + for proc_id in subprocesses: + if sys.platform == "win32": + os.kill(proc_id, signal.SIGTERM) + else: + os.killpg(os.getpgid(proc_id), signal.SIGKILL) + print("All subprocesses terminated.") + +# Register the signal handler for SIGINT +signal.signal(signal.SIGINT, signal_handler) + +def version_ge(v1, v2): + return tuple(map(int, (v1.split(".")))) >= tuple(map(int, (v2.split(".")))) + +def version_gt(v1, v2): + return tuple(map(int, (v1.split(".")))) > tuple(map(int, (v2.split(".")))) + +def update_env_vars(version_to_remove, specified_path_to_remove, env_var_name): + env_var_value = os.environ.get(env_var_name, "") + new_env_var_value = [] + for path in env_var_value.split(os.pathsep): + if not version_to_remove in path and not path.startswith(specified_path_to_remove): + new_env_var_value.append(path) + os.environ[env_var_name] = os.pathsep.join(new_env_var_value) + +class IsaacSimLauncherNode(Node): + def __init__(self): + super().__init__('isaac_sim_launcher_node') + self.declare_parameters( + namespace='', + parameters=[ + ('version', defaults['isaac_sim_version']), + ('install_path', defaults['isaac_sim_path']), + ('use_internal_libs', defaults['use_internal_libs']), + ('dds_type', defaults['dds_type']), + ('gui', defaults['gui']), + ('standalone', defaults['standalone']), + ('play_sim_on_start', defaults['play_sim_on_start']), + ('ros_distro', defaults['ros_distro_var']), + ('ros_installation_path', defaults['ros_installation_path']), + ('headless', defaults['headless']) + ] + ) + self.execute_launch() + + def execute_launch(self): + args = argparse.Namespace() + args.version = self.get_parameter('version').get_parameter_value().string_value + args.install_path = self.get_parameter('install_path').get_parameter_value().string_value + args.use_internal_libs = self.get_parameter('use_internal_libs').get_parameter_value().bool_value + args.dds_type = self.get_parameter('dds_type').get_parameter_value().string_value + args.gui = self.get_parameter('gui').get_parameter_value().string_value + args.standalone = self.get_parameter('standalone').get_parameter_value().string_value + args.play_sim_on_start = self.get_parameter('play_sim_on_start').get_parameter_value().bool_value + args.ros_distro = self.get_parameter('ros_distro').get_parameter_value().string_value + args.ros_installation_path = self.get_parameter('ros_installation_path').get_parameter_value().string_value + args.headless = self.get_parameter('headless').get_parameter_value().string_value + + filepath_root = "" + + if args.install_path != "": + filepath_root = args.install_path + else: + # If custom Isaac Sim Installation folder not given, use the default path using version number provided. + home_var = "USERPROFILE" if sys.platform == "win32" else "HOME" + home_path = os.getenv(home_var) + if version_ge(args.version, "4.1.0") and not version_gt(args.version, "2021.2.0"): + if sys.platform == "win32": + filepath_root = os.path.join(home_path, "AppData", "Local", "ov", "pkg", f"isaac-sim-{args.version}") + else: + filepath_root = os.path.join(home_path, ".local", "share", "ov", "pkg", f"isaac-sim-{args.version}") + elif version_ge(args.version, "2021.2.1") and not version_ge(args.version, "2023.1.2"): + if sys.platform == "win32": + filepath_root = os.path.join(home_path, "AppData", "Local", "ov", "pkg", f"isaac_sim-{args.version}") + else: + filepath_root = os.path.join(home_path, ".local", "share", "ov", "pkg", f"isaac_sim-{args.version}") + else: + print(f"Unsupported Isaac Sim version: {args.version}") + sys.exit(0) + + os.environ["ROS_DISTRO"] = args.ros_distro + + if args.use_internal_libs: + if sys.platform == "win32": + print("use_internal_libs parameter is not supported in Windows") + sys.exit(0) + else: + os.environ["LD_LIBRARY_PATH"] = f"{os.getenv('LD_LIBRARY_PATH')}:{filepath_root}/exts/omni.isaac.ros2_bridge/{args.ros_distro}/lib" + specific_path_to_remove = f"/opt/ros/{args.ros_distro}" + version_to_remove = "foxy" if args.ros_distro == "humble" else "humble" + update_env_vars(version_to_remove, specific_path_to_remove, "LD_LIBRARY_PATH") + update_env_vars(version_to_remove, specific_path_to_remove, "PYTHONPATH") + update_env_vars(version_to_remove, specific_path_to_remove, "PATH") + + elif args.ros_installation_path: + # If a custom ros installation path is provided + if sys.platform == "win32": + proc = subprocess.Popen(f"call {args.ros_installation_path}", shell=True, start_new_session=True) + subprocesses.append(proc.pid) + else: + proc = subprocess.Popen(f"source {args.ros_installation_path}", shell=True, start_new_session=True) + subprocesses.append(proc.pid) + + os.environ["RMW_IMPLEMENTATION"] = "rmw_cyclonedds_cpp" if args.dds_type == "cyclonedds" else "rmw_fastrtps_cpp" + play_sim_on_start_arg = "--start-on-play" if args.play_sim_on_start else "" + + if args.standalone != "": + executable_path = os.path.join(filepath_root, "python.sh" if sys.platform != "win32" else "python.bat") + proc = subprocess.Popen(f"{executable_path} {args.standalone}", shell=True, start_new_session=True) + subprocesses.append(proc.pid) + else: + # Default command + executable_command = f'{os.path.join(filepath_root, "isaac-sim.sh" if sys.platform != "win32" else "isaac-sim.bat")} --/isaac/startup/ros_bridge_extension=omni.isaac.ros2_bridge' + + if args.headless == "native": + executable_command = f'{os.path.join(filepath_root, "isaac-sim.headless.native.sh" if sys.platform != "win32" else "isaac-sim.headless.native.bat")} --/isaac/startup/ros_bridge_extension=omni.isaac.ros2_bridge' + elif args.headless == "webrtc": + executable_command = f'{os.path.join(filepath_root, "isaac-sim.headless.webrtc.sh" if sys.platform != "win32" else "isaac-sim.headless.webrtc.bat")} --/isaac/startup/ros_bridge_extension=omni.isaac.ros2_bridge' + + if args.gui != "": + script_dir = os.path.dirname(__file__) + file_arg = os.path.join(script_dir, "open_isaacsim_stage.py") + f" --path {args.gui} {play_sim_on_start_arg}" + command = f"{executable_command} --exec '{file_arg}'" + proc = subprocess.Popen(command, shell=True, start_new_session=True) + subprocesses.append(proc.pid) + else: + proc = subprocess.Popen(executable_command, shell=True, start_new_session=True) + subprocesses.append(proc.pid) + +def main(args=None): + rclpy.init(args=args) + isaac_sim_launcher_node = IsaacSimLauncherNode() + rclpy.spin(isaac_sim_launcher_node) + # Ensure all subprocesses are terminated before exiting + isaac_sim_shutdown() + isaac_sim_launcher_node.destroy_node() + rclpy.shutdown() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/isaacsim_ws/src/navigation/carter_navigation/CMakeLists.txt b/isaacsim_ws/src/navigation/carter_navigation/CMakeLists.txt new file mode 100644 index 0000000..d10d578 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.5) +project(carter_navigation) + +find_package(ament_cmake REQUIRED) + +install(DIRECTORY + launch + params + maps + rviz2 + DESTINATION share/${PROJECT_NAME}) + +ament_package() diff --git a/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation.launch.py b/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation.launch.py new file mode 100644 index 0000000..11304cb --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation.launch.py @@ -0,0 +1,81 @@ +## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +## NVIDIA CORPORATION and its licensors retain all intellectual property +## and proprietary rights in and to this software, related documentation +## and any modifications thereto. Any use, reproduction, disclosure or +## distribution of this software and related documentation without an express +## license agreement from NVIDIA CORPORATION is strictly prohibited. + +import os +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node + + +def generate_launch_description(): + + use_sim_time = LaunchConfiguration("use_sim_time", default="True") + + map_dir = LaunchConfiguration( + "map", + default=os.path.join( + get_package_share_directory("carter_navigation"), "maps", "carter_warehouse_navigation.yaml" + ), + ) + + param_dir = LaunchConfiguration( + "params_file", + default=os.path.join( + get_package_share_directory("carter_navigation"), "params", "carter_navigation_params.yaml" + ), + ) + + + nav2_bringup_launch_dir = os.path.join(get_package_share_directory("nav2_bringup"), "launch") + + rviz_config_dir = os.path.join(get_package_share_directory("carter_navigation"), "rviz2", "carter_navigation.rviz") + + return LaunchDescription( + [ + DeclareLaunchArgument("map", default_value=map_dir, description="Full path to map file to load"), + DeclareLaunchArgument( + "params_file", default_value=param_dir, description="Full path to param file to load" + ), + DeclareLaunchArgument( + "use_sim_time", default_value="true", description="Use simulation (Omniverse Isaac Sim) clock if true" + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(nav2_bringup_launch_dir, "rviz_launch.py")), + launch_arguments={"namespace": "", "use_namespace": "False", "rviz_config": rviz_config_dir}.items(), + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource([nav2_bringup_launch_dir, "/bringup_launch.py"]), + launch_arguments={"map": map_dir, "use_sim_time": use_sim_time, "params_file": param_dir}.items(), + ), + + Node( + package='pointcloud_to_laserscan', executable='pointcloud_to_laserscan_node', + remappings=[('cloud_in', ['/front_3d_lidar/lidar_points']), + ('scan', ['/scan'])], + parameters=[{ + 'target_frame': 'front_3d_lidar', + 'transform_tolerance': 0.01, + 'min_height': -0.4, + 'max_height': 1.5, + 'angle_min': -1.5708, # -M_PI/2 + 'angle_max': 1.5708, # M_PI/2 + 'angle_increment': 0.0087, # M_PI/360.0 + 'scan_time': 0.3333, + 'range_min': 0.05, + 'range_max': 100.0, + 'use_inf': True, + 'inf_epsilon': 1.0, + # 'concurrency_level': 1, + }], + name='pointcloud_to_laserscan' + ) + ] + ) diff --git a/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation_individual.launch.py b/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation_individual.launch.py new file mode 100644 index 0000000..b8736b6 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation_individual.launch.py @@ -0,0 +1,100 @@ +## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +## NVIDIA CORPORATION and its licensors retain all intellectual property +## and proprietary rights in and to this software, related documentation +## and any modifications thereto. Any use, reproduction, disclosure or +## distribution of this software and related documentation without an express +## license agreement from NVIDIA CORPORATION is strictly prohibited. + +import os + +from ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, ExecuteProcess, IncludeLaunchDescription +from launch.conditions import IfCondition +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration, PythonExpression, TextSubstitution +from launch_ros.actions import Node + + +def generate_launch_description(): + + # Get the launch directory + nav2_launch_dir = os.path.join(get_package_share_directory("nav2_bringup"), "launch") + + # Create the launch configuration variables + slam = LaunchConfiguration("slam") + namespace = LaunchConfiguration("namespace") + use_namespace = LaunchConfiguration("use_namespace") + map_yaml_file = LaunchConfiguration("map") + use_sim_time = LaunchConfiguration("use_sim_time") + params_file = LaunchConfiguration("params_file") + default_bt_xml_filename = LaunchConfiguration("default_bt_xml_filename") + autostart = LaunchConfiguration("autostart") + + # Declare the launch arguments + declare_namespace_cmd = DeclareLaunchArgument("namespace", default_value="", description="Top-level namespace") + + declare_use_namespace_cmd = DeclareLaunchArgument( + "use_namespace", default_value="false", description="Whether to apply a namespace to the navigation stack" + ) + + declare_slam_cmd = DeclareLaunchArgument("slam", default_value="False", description="Whether run a SLAM") + + declare_map_yaml_cmd = DeclareLaunchArgument( + "map", + default_value=os.path.join(nav2_launch_dir, "maps", "carter_warehouse_navigation.yaml"), + description="Full path to map file to load", + ) + + declare_use_sim_time_cmd = DeclareLaunchArgument( + "use_sim_time", default_value="True", description="Use simulation (Isaac Sim) clock if true" + ) + + declare_params_file_cmd = DeclareLaunchArgument( + "params_file", + default_value=os.path.join(nav2_launch_dir, "params", "nav2_params.yaml"), + description="Full path to the ROS2 parameters file to use for all launched nodes", + ) + + declare_bt_xml_cmd = DeclareLaunchArgument( + "default_bt_xml_filename", + default_value=os.path.join( + get_package_share_directory("nav2_bt_navigator"), "behavior_trees", "navigate_w_replanning_and_recovery.xml" + ), + description="Full path to the behavior tree xml file to use", + ) + + declare_autostart_cmd = DeclareLaunchArgument( + "autostart", default_value="true", description="Automatically startup the nav2 stack" + ) + + bringup_cmd = IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(nav2_launch_dir, "bringup_launch.py")), + launch_arguments={ + "namespace": namespace, + "use_namespace": use_namespace, + "slam": slam, + "map": map_yaml_file, + "use_sim_time": use_sim_time, + "params_file": params_file, + "default_bt_xml_filename": default_bt_xml_filename, + "autostart": autostart, + }.items(), + ) + + # Create the launch description and populate + ld = LaunchDescription() + + # Declare the launch options + ld.add_action(declare_namespace_cmd) + ld.add_action(declare_use_namespace_cmd) + ld.add_action(declare_slam_cmd) + ld.add_action(declare_map_yaml_cmd) + ld.add_action(declare_use_sim_time_cmd) + ld.add_action(declare_params_file_cmd) + ld.add_action(declare_bt_xml_cmd) + ld.add_action(declare_autostart_cmd) + ld.add_action(bringup_cmd) + + return ld diff --git a/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation_isaacsim.launch.py b/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation_isaacsim.launch.py new file mode 100644 index 0000000..556c01e --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/launch/carter_navigation_isaacsim.launch.py @@ -0,0 +1,125 @@ +## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +## NVIDIA CORPORATION and its licensors retain all intellectual property +## and proprietary rights in and to this software, related documentation +## and any modifications thereto. Any use, reproduction, disclosure or +## distribution of this software and related documentation without an express +## license agreement from NVIDIA CORPORATION is strictly prohibited. + +import os +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node +from launch.actions import RegisterEventHandler, ExecuteProcess +from launch.event_handlers import OnProcessStart, OnProcessIO +from launch.substitutions import FindExecutable + +def generate_launch_description(): + + use_sim_time = LaunchConfiguration("use_sim_time", default="True") + + map_dir = LaunchConfiguration( + "map", + default=os.path.join( + get_package_share_directory("carter_navigation"), "maps", "carter_warehouse_navigation.yaml" + ), + ) + + param_dir = LaunchConfiguration( + "params_file", + default=os.path.join( + get_package_share_directory("carter_navigation"), "params", "carter_navigation_params.yaml" + ), + ) + + + nav2_bringup_launch_dir = os.path.join(get_package_share_directory("nav2_bringup"), "launch") + + rviz_config_dir = os.path.join(get_package_share_directory("carter_navigation"), "rviz2", "carter_navigation.rviz") + + ld_automatic_goal = IncludeLaunchDescription( + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory("isaac_ros_navigation_goal"), "launch", "isaac_ros_navigation_goal.launch.py" + ), + ] + ), + ) + + + + def execute_second_node_if_condition_met(event, second_node_action): + output = event.text.decode().strip() + # Look for fully loaded message from Isaac Sim. Only applicable in Gui mode. + if "Stage loaded and simulation is playing." in output: + # Log a message indicating the condition has been met + print("Condition met, launching the second node.") + + return second_node_action + + + return LaunchDescription( + [ + # Declaring the Isaac Sim scene path. 'gui' launch argument is already used withing run_isaac_sim.launch.py + DeclareLaunchArgument("gui", default_value='omniverse://localhost/NVIDIA/Assets/Isaac/4.1/Isaac/Samples/ROS2/Scenario/carter_warehouse_navigation.usd', description="Path to isaac sim scene"), + + # Include Isaac Sim launch file from isaacsim package with given launch parameters. + IncludeLaunchDescription( + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory("isaacsim"), "launch", "run_isaacsim.launch.py" + ), + ] + ), + launch_arguments={ + 'version': '4.1.0', + 'play_sim_on_start': 'true', + }.items(), + ), + + DeclareLaunchArgument("map", default_value=map_dir, description="Full path to map file to load"), + DeclareLaunchArgument( + "params_file", default_value=param_dir, description="Full path to param file to load" + ), + DeclareLaunchArgument( + "use_sim_time", default_value="true", description="Use simulation (Omniverse Isaac Sim) clock if true" + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(nav2_bringup_launch_dir, "rviz_launch.py")), + launch_arguments={"namespace": "", "use_namespace": "False", "rviz_config": rviz_config_dir}.items(), + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource([nav2_bringup_launch_dir, "/bringup_launch.py"]), + launch_arguments={"map": map_dir, "use_sim_time": use_sim_time, "params_file": param_dir}.items(), + ), + Node( + package='pointcloud_to_laserscan', executable='pointcloud_to_laserscan_node', + remappings=[('cloud_in', ['/front_3d_lidar/lidar_points']), + ('scan', ['/scan'])], + parameters=[{ + 'target_frame': 'front_3d_lidar', + 'transform_tolerance': 0.01, + 'min_height': -0.4, + 'max_height': 1.5, + 'angle_min': -1.5708, # -M_PI/2 + 'angle_max': 1.5708, # M_PI/2 + 'angle_increment': 0.0087, # M_PI/360.0 + 'scan_time': 0.3333, + 'range_min': 0.05, + 'range_max': 100.0, + 'use_inf': True, + 'inf_epsilon': 1.0, + # 'concurrency_level': 1, + }], + name='pointcloud_to_laserscan' + ), + + # Launch automatic goal generator node when Isaac Sim has finished loading. + RegisterEventHandler( + OnProcessIO( + on_stdout=lambda event: execute_second_node_if_condition_met(event, ld_automatic_goal) + ) + ), + ] + ) diff --git a/isaacsim_ws/src/navigation/carter_navigation/launch/multiple_robot_carter_navigation_hospital.launch.py b/isaacsim_ws/src/navigation/carter_navigation/launch/multiple_robot_carter_navigation_hospital.launch.py new file mode 100644 index 0000000..b190dae --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/launch/multiple_robot_carter_navigation_hospital.launch.py @@ -0,0 +1,191 @@ +## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +## NVIDIA CORPORATION and its licensors retain all intellectual property +## and proprietary rights in and to this software, related documentation +## and any modifications thereto. Any use, reproduction, disclosure or +## distribution of this software and related documentation without an express +## license agreement from NVIDIA CORPORATION is strictly prohibited. + +""" +Example for spawing multiple robots in Gazebo. + +This is an example on how to create a launch file for spawning multiple robots into Gazebo +and launch multiple instances of the navigation stack, each controlling one robot. +The robots co-exist on a shared environment and are controlled by independent nav stacks +""" + +import os + +from ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, ExecuteProcess, GroupAction, IncludeLaunchDescription, LogInfo +from launch.conditions import IfCondition +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration, TextSubstitution +from launch_ros.actions import Node + + +def generate_launch_description(): + # Get the launch and rviz directories + carter_nav2_bringup_dir = get_package_share_directory("carter_navigation") + + nav2_bringup_dir = get_package_share_directory("nav2_bringup") + nav2_bringup_launch_dir = os.path.join(nav2_bringup_dir, "launch") + + rviz_config_dir = os.path.join(carter_nav2_bringup_dir, "rviz2", "carter_navigation_namespaced.rviz") + + # Names and poses of the robots + robots = [{"name": "carter1"}, {"name": "carter2"}, {"name": "carter3"}] + + # Common settings + ENV_MAP_FILE = "carter_hospital_navigation.yaml" + use_sim_time = LaunchConfiguration("use_sim_time", default="True") + map_yaml_file = LaunchConfiguration("map") + default_bt_xml_filename = LaunchConfiguration("default_bt_xml_filename") + autostart = LaunchConfiguration("autostart") + rviz_config_file = LaunchConfiguration("rviz_config") + use_rviz = LaunchConfiguration("use_rviz") + log_settings = LaunchConfiguration("log_settings", default="true") + + # Declare the launch arguments + declare_map_yaml_cmd = DeclareLaunchArgument( + "map", + default_value=os.path.join(carter_nav2_bringup_dir, "maps", ENV_MAP_FILE), + description="Full path to map file to load", + ) + + declare_robot1_params_file_cmd = DeclareLaunchArgument( + "carter1_params_file", + default_value=os.path.join( + carter_nav2_bringup_dir, "params", "hospital", "multi_robot_carter_navigation_params_1.yaml" + ), + description="Full path to the ROS2 parameters file to use for robot1 launched nodes", + ) + + declare_robot2_params_file_cmd = DeclareLaunchArgument( + "carter2_params_file", + default_value=os.path.join( + carter_nav2_bringup_dir, "params", "hospital", "multi_robot_carter_navigation_params_2.yaml" + ), + description="Full path to the ROS2 parameters file to use for robot2 launched nodes", + ) + + declare_robot3_params_file_cmd = DeclareLaunchArgument( + "carter3_params_file", + default_value=os.path.join( + carter_nav2_bringup_dir, "params", "hospital", "multi_robot_carter_navigation_params_3.yaml" + ), + description="Full path to the ROS2 parameters file to use for robot3 launched nodes", + ) + + declare_bt_xml_cmd = DeclareLaunchArgument( + "default_bt_xml_filename", + default_value=os.path.join( + get_package_share_directory("nav2_bt_navigator"), "behavior_trees", "navigate_w_replanning_and_recovery.xml" + ), + description="Full path to the behavior tree xml file to use", + ) + + declare_autostart_cmd = DeclareLaunchArgument( + "autostart", default_value="True", description="Automatically startup the stacks" + ) + + declare_rviz_config_file_cmd = DeclareLaunchArgument( + "rviz_config", default_value=rviz_config_dir, description="Full path to the RVIZ config file to use." + ) + + declare_use_rviz_cmd = DeclareLaunchArgument("use_rviz", default_value="True", description="Whether to start RVIZ") + + # Define commands for launching the navigation instances + nav_instances_cmds = [] + for robot in robots: + params_file = LaunchConfiguration(robot["name"] + "_params_file") + + group = GroupAction( + [ + IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(nav2_bringup_launch_dir, "rviz_launch.py")), + condition=IfCondition(use_rviz), + launch_arguments={ + "namespace": TextSubstitution(text=robot["name"]), + "use_namespace": "True", + "rviz_config": rviz_config_file, + }.items(), + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(carter_nav2_bringup_dir, "launch", "carter_navigation_individual.launch.py") + ), + launch_arguments={ + "namespace": robot["name"], + "use_namespace": "True", + "map": map_yaml_file, + "use_sim_time": use_sim_time, + "params_file": params_file, + "default_bt_xml_filename": default_bt_xml_filename, + "autostart": autostart, + "use_rviz": "False", + "use_simulator": "False", + "headless": "False", + }.items(), + ), + + Node( + package='pointcloud_to_laserscan', executable='pointcloud_to_laserscan_node', + remappings=[('cloud_in', ['front_3d_lidar/lidar_points']), + ('scan', ['scan'])], + parameters=[{ + 'target_frame': 'front_3d_lidar', + 'transform_tolerance': 0.01, + 'min_height': -0.4, + 'max_height': 1.5, + 'angle_min': -1.5708, # -M_PI/2 + 'angle_max': 1.5708, # M_PI/2 + 'angle_increment': 0.0087, # M_PI/360.0 + 'scan_time': 0.3333, + 'range_min': 0.05, + 'range_max': 100.0, + 'use_inf': True, + 'inf_epsilon': 1.0, + # 'concurrency_level': 1, + }], + name='pointcloud_to_laserscan', + namespace = robot["name"] + ), + + LogInfo(condition=IfCondition(log_settings), msg=["Launching ", robot["name"]]), + LogInfo(condition=IfCondition(log_settings), msg=[robot["name"], " map yaml: ", map_yaml_file]), + LogInfo(condition=IfCondition(log_settings), msg=[robot["name"], " params yaml: ", params_file]), + LogInfo( + condition=IfCondition(log_settings), + msg=[robot["name"], " behavior tree xml: ", default_bt_xml_filename], + ), + LogInfo( + condition=IfCondition(log_settings), msg=[robot["name"], " rviz config file: ", rviz_config_file] + ), + LogInfo(condition=IfCondition(log_settings), msg=[robot["name"], " autostart: ", autostart]), + ] + ) + + nav_instances_cmds.append(group) + + # Create the launch description and populate + ld = LaunchDescription() + + # Declare the launch options + + ld.add_action(declare_map_yaml_cmd) + + ld.add_action(declare_robot1_params_file_cmd) + ld.add_action(declare_robot2_params_file_cmd) + ld.add_action(declare_robot3_params_file_cmd) + + ld.add_action(declare_bt_xml_cmd) + ld.add_action(declare_use_rviz_cmd) + ld.add_action(declare_autostart_cmd) + ld.add_action(declare_rviz_config_file_cmd) + + for simulation_instance_cmd in nav_instances_cmds: + ld.add_action(simulation_instance_cmd) + + return ld diff --git a/isaacsim_ws/src/navigation/carter_navigation/launch/multiple_robot_carter_navigation_office.launch.py b/isaacsim_ws/src/navigation/carter_navigation/launch/multiple_robot_carter_navigation_office.launch.py new file mode 100644 index 0000000..620f3f5 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/launch/multiple_robot_carter_navigation_office.launch.py @@ -0,0 +1,191 @@ +## Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +## NVIDIA CORPORATION and its licensors retain all intellectual property +## and proprietary rights in and to this software, related documentation +## and any modifications thereto. Any use, reproduction, disclosure or +## distribution of this software and related documentation without an express +## license agreement from NVIDIA CORPORATION is strictly prohibited. + +""" +Example for spawing multiple robots in Gazebo. + +This is an example on how to create a launch file for spawning multiple robots into Gazebo +and launch multiple instances of the navigation stack, each controlling one robot. +The robots co-exist on a shared environment and are controlled by independent nav stacks +""" + +import os + +from ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, ExecuteProcess, GroupAction, IncludeLaunchDescription, LogInfo +from launch.conditions import IfCondition +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration, TextSubstitution +from launch_ros.actions import Node + + +def generate_launch_description(): + # Get the launch and rviz directories + carter_nav2_bringup_dir = get_package_share_directory("carter_navigation") + + nav2_bringup_dir = get_package_share_directory("nav2_bringup") + nav2_bringup_launch_dir = os.path.join(nav2_bringup_dir, "launch") + + rviz_config_dir = os.path.join(carter_nav2_bringup_dir, "rviz2", "carter_navigation_namespaced.rviz") + + # Names and poses of the robots + robots = [{"name": "carter1"}, {"name": "carter2"}, {"name": "carter3"}] + + # Common settings + ENV_MAP_FILE = "carter_office_navigation.yaml" + use_sim_time = LaunchConfiguration("use_sim_time", default="True") + map_yaml_file = LaunchConfiguration("map") + default_bt_xml_filename = LaunchConfiguration("default_bt_xml_filename") + autostart = LaunchConfiguration("autostart") + rviz_config_file = LaunchConfiguration("rviz_config") + use_rviz = LaunchConfiguration("use_rviz") + log_settings = LaunchConfiguration("log_settings", default="true") + + # Declare the launch arguments + declare_map_yaml_cmd = DeclareLaunchArgument( + "map", + default_value=os.path.join(carter_nav2_bringup_dir, "maps", ENV_MAP_FILE), + description="Full path to map file to load", + ) + + declare_robot1_params_file_cmd = DeclareLaunchArgument( + "carter1_params_file", + default_value=os.path.join( + carter_nav2_bringup_dir, "params", "office", "multi_robot_carter_navigation_params_1.yaml" + ), + description="Full path to the ROS2 parameters file to use for robot1 launched nodes", + ) + + declare_robot2_params_file_cmd = DeclareLaunchArgument( + "carter2_params_file", + default_value=os.path.join( + carter_nav2_bringup_dir, "params", "office", "multi_robot_carter_navigation_params_2.yaml" + ), + description="Full path to the ROS2 parameters file to use for robot2 launched nodes", + ) + + declare_robot3_params_file_cmd = DeclareLaunchArgument( + "carter3_params_file", + default_value=os.path.join( + carter_nav2_bringup_dir, "params", "office", "multi_robot_carter_navigation_params_3.yaml" + ), + description="Full path to the ROS2 parameters file to use for robot3 launched nodes", + ) + + declare_bt_xml_cmd = DeclareLaunchArgument( + "default_bt_xml_filename", + default_value=os.path.join( + get_package_share_directory("nav2_bt_navigator"), "behavior_trees", "navigate_w_replanning_and_recovery.xml" + ), + description="Full path to the behavior tree xml file to use", + ) + + declare_autostart_cmd = DeclareLaunchArgument( + "autostart", default_value="True", description="Automatically startup the stacks" + ) + + declare_rviz_config_file_cmd = DeclareLaunchArgument( + "rviz_config", default_value=rviz_config_dir, description="Full path to the RVIZ config file to use." + ) + + declare_use_rviz_cmd = DeclareLaunchArgument("use_rviz", default_value="True", description="Whether to start RVIZ") + + # Define commands for launching the navigation instances + nav_instances_cmds = [] + for robot in robots: + params_file = LaunchConfiguration(robot["name"] + "_params_file") + + group = GroupAction( + [ + IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(nav2_bringup_launch_dir, "rviz_launch.py")), + condition=IfCondition(use_rviz), + launch_arguments={ + "namespace": TextSubstitution(text=robot["name"]), + "use_namespace": "True", + "rviz_config": rviz_config_file, + }.items(), + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(carter_nav2_bringup_dir, "launch", "carter_navigation_individual.launch.py") + ), + launch_arguments={ + "namespace": robot["name"], + "use_namespace": "True", + "map": map_yaml_file, + "use_sim_time": use_sim_time, + "params_file": params_file, + "default_bt_xml_filename": default_bt_xml_filename, + "autostart": autostart, + "use_rviz": "False", + "use_simulator": "False", + "headless": "False", + }.items(), + ), + + Node( + package='pointcloud_to_laserscan', executable='pointcloud_to_laserscan_node', + remappings=[('cloud_in', ['front_3d_lidar/lidar_points']), + ('scan', ['scan'])], + parameters=[{ + 'target_frame': 'front_3d_lidar', + 'transform_tolerance': 0.01, + 'min_height': -0.4, + 'max_height': 1.5, + 'angle_min': -1.5708, # -M_PI/2 + 'angle_max': 1.5708, # M_PI/2 + 'angle_increment': 0.0087, # M_PI/360.0 + 'scan_time': 0.3333, + 'range_min': 0.05, + 'range_max': 100.0, + 'use_inf': True, + 'inf_epsilon': 1.0, + # 'concurrency_level': 1, + }], + name='pointcloud_to_laserscan', + namespace = robot["name"] + ), + + LogInfo(condition=IfCondition(log_settings), msg=["Launching ", robot["name"]]), + LogInfo(condition=IfCondition(log_settings), msg=[robot["name"], " map yaml: ", map_yaml_file]), + LogInfo(condition=IfCondition(log_settings), msg=[robot["name"], " params yaml: ", params_file]), + LogInfo( + condition=IfCondition(log_settings), + msg=[robot["name"], " behavior tree xml: ", default_bt_xml_filename], + ), + LogInfo( + condition=IfCondition(log_settings), msg=[robot["name"], " rviz config file: ", rviz_config_file] + ), + LogInfo(condition=IfCondition(log_settings), msg=[robot["name"], " autostart: ", autostart]), + ] + ) + + nav_instances_cmds.append(group) + + # Create the launch description and populate + ld = LaunchDescription() + + # Declare the launch options + + ld.add_action(declare_map_yaml_cmd) + + ld.add_action(declare_robot1_params_file_cmd) + ld.add_action(declare_robot2_params_file_cmd) + ld.add_action(declare_robot3_params_file_cmd) + + ld.add_action(declare_bt_xml_cmd) + ld.add_action(declare_use_rviz_cmd) + ld.add_action(declare_autostart_cmd) + ld.add_action(declare_rviz_config_file_cmd) + + for simulation_instance_cmd in nav_instances_cmds: + ld.add_action(simulation_instance_cmd) + + return ld diff --git a/isaacsim_ws/src/navigation/carter_navigation/maps/carter_hospital_navigation.png b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_hospital_navigation.png new file mode 100644 index 0000000..b276166 Binary files /dev/null and b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_hospital_navigation.png differ diff --git a/isaacsim_ws/src/navigation/carter_navigation/maps/carter_hospital_navigation.yaml b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_hospital_navigation.yaml new file mode 100644 index 0000000..7768e0c --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_hospital_navigation.yaml @@ -0,0 +1,7 @@ +image: carter_hospital_navigation.png +mode: trinary +resolution: 0.05 +origin: [-49.625, -4.675, 0.0000] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.196 diff --git a/isaacsim_ws/src/navigation/carter_navigation/maps/carter_office_navigation.png b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_office_navigation.png new file mode 100644 index 0000000..6133123 Binary files /dev/null and b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_office_navigation.png differ diff --git a/isaacsim_ws/src/navigation/carter_navigation/maps/carter_office_navigation.yaml b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_office_navigation.yaml new file mode 100644 index 0000000..e2cc42c --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_office_navigation.yaml @@ -0,0 +1,7 @@ +image: carter_office_navigation.png +mode: trinary +resolution: 0.05 +origin: [-29.975, -39.975, 0.0000] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.196 diff --git a/isaacsim_ws/src/navigation/carter_navigation/maps/carter_warehouse_navigation.png b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_warehouse_navigation.png new file mode 100644 index 0000000..d2fec12 Binary files /dev/null and b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_warehouse_navigation.png differ diff --git a/isaacsim_ws/src/navigation/carter_navigation/maps/carter_warehouse_navigation.yaml b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_warehouse_navigation.yaml new file mode 100644 index 0000000..c84bc1d --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/maps/carter_warehouse_navigation.yaml @@ -0,0 +1,7 @@ +image: carter_warehouse_navigation.png +mode: trinary +resolution: 0.05 +origin: [-11.975, -17.975, 0.0000] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.196 diff --git a/isaacsim_ws/src/navigation/carter_navigation/package.xml b/isaacsim_ws/src/navigation/carter_navigation/package.xml new file mode 100644 index 0000000..fcb21ee --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/package.xml @@ -0,0 +1,56 @@ + + + + carter_navigation + 0.1.0 + + The carter_navigation package + + + Isaac Sim + + Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + NVIDIA CORPORATION and its licensors retain all intellectual property + and proprietary rights in and to this software, related documentation + and any modifications thereto. Any use, reproduction, disclosure or + distribution of this software and related documentation without an express + license agreement from NVIDIA CORPORATION is strictly prohibited. + + https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html + https://forums.developer.nvidia.com/c/omniverse/simulation/69 + + ament_cmake + + launch + launch_ros + + joint_state_publisher + + rviz2 + + navigation2 + nav2_amcl + nav2_bringup + nav2_bt_navigator + nav2_costmap_2d + nav2_core + nav2_dwb_controller + nav2_lifecycle_manager + nav2_map_server + nav2_behaviors + nav2_planner + nav2_msgs + nav2_navfn_planner + nav2_rviz_plugins + nav2_behavior_tree + nav2_util + nav2_voxel_grid + nav2_controller + nav2_waypoint_follower + pointcloud_to_laserscan + + + + ament_cmake + + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/carter_navigation_params.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/carter_navigation_params.yaml new file mode 100644 index 0000000..aadc983 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/carter_navigation_params.yaml @@ -0,0 +1,395 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: -6.0 + y: -1.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: /chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 10 + height: 10 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + # rolling_window: True + # width: 200 + # height: 200 + resolution: 0.05 + # origin_x: -100.0 + # origin_y: -100.0 + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_warehouse_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_1.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_1.yaml new file mode 100644 index 0000000..161e2de --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_1.yaml @@ -0,0 +1,392 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: 0.0 + y: 0.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 7 + height: 7 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /carter1/front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter1/front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter1/back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + + resolution: 0.05 + + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter1/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_hospital_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_2.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_2.yaml new file mode 100644 index 0000000..2473516 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_2.yaml @@ -0,0 +1,392 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: 4.0 + y: -1.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 7 + height: 7 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /carter2/front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter2/front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter2/back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + + resolution: 0.05 + + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter2/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_hospital_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_3.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_3.yaml new file mode 100644 index 0000000..a236741 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/hospital/multi_robot_carter_navigation_params_3.yaml @@ -0,0 +1,392 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: 7.0 + y: 3.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 7 + height: 7 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /carter3/front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter3/front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter3/back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + + resolution: 0.05 + + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter3/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_hospital_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_1.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_1.yaml new file mode 100644 index 0000000..2b8c677 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_1.yaml @@ -0,0 +1,392 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: -3.0 + y: -6.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 10 + height: 10 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /carter1/front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter1/front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter1/back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + + resolution: 0.05 + + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter1/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_hospital_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_2.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_2.yaml new file mode 100644 index 0000000..63da6b5 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_2.yaml @@ -0,0 +1,392 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: 2.5 + y: 0.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 10 + height: 10 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /carter2/front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter2/front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter2/back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + + resolution: 0.05 + + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter2/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_hospital_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_3.yaml b/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_3.yaml new file mode 100644 index 0000000..052cba2 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/params/office/multi_robot_carter_navigation_params_3.yaml @@ -0,0 +1,392 @@ +amcl: + ros__parameters: + use_sim_time: True + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 360 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 3 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + map_topic: map + set_initial_pose: true + always_reset_initial_pose: false + first_map_only: false + initial_pose: + x: -2.0 + y: 5.0 + z: 0.0 + yaw: 3.14159 + +amcl_map_client: + ros__parameters: + use_sim_time: True + +amcl_rclcpp_node: + ros__parameters: + use_sim_time: True +bt_navigator: + ros__parameters: + use_sim_time: True + global_frame: map + robot_base_frame: base_link + odom_topic: chassis/odom + bt_loop_duration: 20 + default_server_timeout: 40 + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + plugin_lib_names: + - nav2_compute_path_to_pose_action_bt_node + - nav2_compute_path_through_poses_action_bt_node + - nav2_smooth_path_action_bt_node + - nav2_follow_path_action_bt_node + - nav2_spin_action_bt_node + - nav2_wait_action_bt_node + - nav2_back_up_action_bt_node + - nav2_drive_on_heading_bt_node + - nav2_clear_costmap_service_bt_node + - nav2_is_stuck_condition_bt_node + - nav2_goal_reached_condition_bt_node + - nav2_goal_updated_condition_bt_node + - nav2_globally_updated_goal_condition_bt_node + - nav2_is_path_valid_condition_bt_node + - nav2_initial_pose_received_condition_bt_node + - nav2_reinitialize_global_localization_service_bt_node + - nav2_rate_controller_bt_node + - nav2_distance_controller_bt_node + - nav2_speed_controller_bt_node + - nav2_truncate_path_action_bt_node + - nav2_truncate_path_local_action_bt_node + - nav2_goal_updater_node_bt_node + - nav2_recovery_node_bt_node + - nav2_pipeline_sequence_bt_node + - nav2_round_robin_node_bt_node + - nav2_transform_available_condition_bt_node + - nav2_time_expired_condition_bt_node + - nav2_path_expiring_timer_condition + - nav2_distance_traveled_condition_bt_node + - nav2_single_trigger_bt_node + - nav2_is_battery_low_condition_bt_node + - nav2_navigate_through_poses_action_bt_node + - nav2_navigate_to_pose_action_bt_node + - nav2_remove_passed_goals_action_bt_node + - nav2_planner_selector_bt_node + - nav2_controller_selector_bt_node + - nav2_goal_checker_selector_bt_node + - nav2_controller_cancel_bt_node + - nav2_path_longer_on_approach_bt_node + - nav2_wait_cancel_bt_node + - nav2_spin_cancel_bt_node + - nav2_back_up_cancel_bt_node + - nav2_drive_on_heading_cancel_bt_node + +bt_navigator_rclcpp_node: + ros__parameters: + use_sim_time: True + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + scale_velocities: false + feedback: "OPEN_LOOP" + max_velocity: [1.8, 0.0, 1.2] + min_velocity: [-1.8, 0.0, -1.2] + # deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + # max_accel: [1.0, 0.0, 1.25] + # max_decel: [-1.0, 0.0, -1.25] + odom_topic: "chassis/odom" + odom_duration: 0.1 + +controller_server: + ros__parameters: + use_sim_time: True + controller_frequency: 20.0 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugin: "progress_checker" + goal_checker_plugin: ["stopped_goal_checker"] + controller_plugins: ["FollowPath"] + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + stopped_goal_checker: + plugin: "nav2_controller::StoppedGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + stateful: True + # DWB parameters + FollowPath: + plugin: "dwb_core::DWBLocalPlanner" + debug_trajectory_details: True + min_vel_x: 0.0 + min_vel_y: 0.0 + max_vel_x: 1.8 + max_vel_y: 0.0 + max_vel_theta: 1.2 + min_speed_xy: 0.0 + max_speed_xy: 1.0 + min_speed_theta: 0.0 + acc_lim_x: 2.5 + acc_lim_y: 0.0 + acc_lim_theta: 3.2 + decel_lim_x: -2.5 + decel_lim_y: 0.0 + decel_lim_theta: -3.2 + vx_samples: 20 + vy_samples: 5 + vtheta_samples: 20 + sim_time: 1.7 + linear_granularity: 0.05 + angular_granularity: 0.025 + transform_tolerance: 0.2 + xy_goal_tolerance: 0.25 + trans_stopped_velocity: 0.25 + short_circuit_trajectory_evaluation: True + stateful: True + critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] + BaseObstacle.scale: 0.02 + PathAlign.scale: 32.0 + PathAlign.forward_point_distance: 0.1 + GoalAlign.scale: 24.0 + GoalAlign.forward_point_distance: 0.1 + PathDist.scale: 32.0 + GoalDist.scale: 24.0 + RotateToGoal.scale: 32.0 + RotateToGoal.slowing_factor: 5.0 + RotateToGoal.lookahead_time: -1.0 + +controller_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + footprint_padding: 0.25 + global_frame: odom + robot_base_frame: base_link + use_sim_time: True + rolling_window: True + width: 10 + height: 10 + resolution: 0.05 + transform_tolerance: 0.3 + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + plugins: ["hesai_voxel_layer", "front_rplidar_obstacle_layer", "back_rplidar_obstacle_layer", "inflation_layer"] + # plugins: ["hesai_voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + enabled: True + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + hesai_voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + footprint_clearing_enabled: true + max_obstacle_height: 2.0 + publish_voxel_map: False + origin_z: 0.0 + z_voxels: 16 + z_resolution: 0.2 + unknown_threshold: 15 + observation_sources: pointcloud + pointcloud: # no frame set, uses frame from message + topic: /carter3/front_3d_lidar/lidar_points + max_obstacle_height: 2.0 + min_obstacle_height: 0.1 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + clearing: True + marking: True + data_type: "PointCloud2" + front_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter3/front_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + back_rplidar_obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter3/back_2d_lidar/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + local_costmap_client: + ros__parameters: + use_sim_time: True + local_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + + + +global_costmap: + global_costmap: + ros__parameters: + footprint_padding: 0.25 + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + use_sim_time: True + footprint: "[ [0.14, 0.25], [0.14, -0.25], [-0.607, -0.25], [-0.607, 0.25] ]" + + resolution: 0.05 + + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /carter3/scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 10.0 + raytrace_min_range: 0.0 + obstacle_max_range: 10.0 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 0.3 + inflation_radius: 1.0 + always_send_full_costmap: True + global_costmap_client: + ros__parameters: + use_sim_time: True + global_costmap_rclcpp_node: + ros__parameters: + use_sim_time: True + +map_server: + ros__parameters: + use_sim_time: True + yaml_filename: "carter_hospital_navigation.yaml" + +map_saver: + ros__parameters: + use_sim_time: True + save_map_timeout: 5000 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 10.0 + use_sim_time: True + planner_plugins: ["GridBased"] + GridBased: + plugin: "nav2_navfn_planner/NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +planner_server_rclcpp_node: + ros__parameters: + use_sim_time: True + +smoother_server: + ros__parameters: + use_sim_time: True + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + costmap_topic: local_costmap/costmap_raw + footprint_topic: local_costmap/published_footprint + cycle_frequency: 5.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] + spin: + plugin: "nav2_behaviors/Spin" + backup: + plugin: "nav2_behaviors/BackUp" + drive_on_heading: + plugin: "nav2_behaviors/DriveOnHeading" + wait: + plugin: "nav2_behaviors/Wait" + global_frame: odom + robot_base_frame: base_link + transform_tolerance: 0.2 + use_sim_time: true + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +robot_state_publisher: + ros__parameters: + use_sim_time: True + +waypoint_follower: + ros__parameters: + use_sim_time: True + loop_rate: 20 + stop_on_failure: false + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + diff --git a/isaacsim_ws/src/navigation/carter_navigation/rviz2/carter_navigation.rviz b/isaacsim_ws/src/navigation/carter_navigation/rviz2/carter_navigation.rviz new file mode 100644 index 0000000..79c3b79 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/rviz2/carter_navigation.rviz @@ -0,0 +1,696 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 0 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /RobotModel1 + - /TF1/Frames1 + - /TF1/Tree1 + - /Controller1 + - /Controller1/Local Costmap1 + Splitter Ratio: 0.5833333134651184 + Tree Height: 203 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: nav2_rviz_plugins/Navigation 2 + Name: Navigation 2 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: File + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: "" + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: false + back_2d_lidar: + Value: true + base_link: + Value: true + chassis_link: + Value: true + front_2d_lidar: + Value: true + front_3d_lidar: + Value: true + front_stereo_camera_imu: + Value: true + front_stereo_camera_left_optical: + Value: true + front_stereo_camera_right_optical: + Value: true + left_stereo_camera_imu: + Value: true + left_stereo_camera_left_optical: + Value: true + left_stereo_camera_right_optical: + Value: true + map: + Value: true + odom: + Value: true + rear_stereo_camera:imu: + Value: true + rear_stereo_camera:left_rgb: + Value: true + rear_stereo_camera:right_rgb: + Value: true + right_stereo_camera_imu: + Value: true + right_stereo_camera_left_optical: + Value: true + right_stereo_camera_right_optical: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + map: + odom: + base_link: + back_2d_lidar: + {} + chassis_link: + {} + front_2d_lidar: + {} + front_3d_lidar: + {} + front_stereo_camera_imu: + {} + front_stereo_camera_left_optical: + {} + front_stereo_camera_right_optical: + {} + left_stereo_camera_imu: + {} + left_stereo_camera_left_optical: + {} + left_stereo_camera_right_optical: + {} + rear_stereo_camera:imu: + {} + rear_stereo_camera:left_rgb: + {} + rear_stereo_camera:right_rgb: + {} + right_stereo_camera_imu: + {} + right_stereo_camera_left_optical: + {} + right_stereo_camera_right_optical: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 0 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: LaserScan + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Best Effort + Value: /scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: "" + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: Bumper Hit + Position Transformer: "" + Selectable: true + Size (Pixels): 3 + Size (m): 0.07999999821186066 + Style: Spheres + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Best Effort + Value: /mobile_base/sensors/bumper_pointcloud + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Class: rviz_default_plugins/Map + Color Scheme: map + Draw Behind: true + Enabled: true + Name: Map + Topic: + Depth: 1 + Durability Policy: Transient Local + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map_updates + Use Timestamp: false + Value: true + - Alpha: 1 + Arrow Length: 0.019999999552965164 + Axes Length: 0.30000001192092896 + Axes Radius: 0.009999999776482582 + Class: rviz_default_plugins/PoseArray + Color: 0; 180; 0 + Enabled: true + Head Length: 0.07000000029802322 + Head Radius: 0.029999999329447746 + Name: Amcl Particle Swarm + Shaft Length: 0.23000000417232513 + Shaft Radius: 0.009999999776482582 + Shape: Arrow (Flat) + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Best Effort + Value: /particlecloud + Value: true + - Class: rviz_common/Group + Displays: + - Alpha: 0.30000001192092896 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Global Costmap + Topic: + Depth: 1 + Durability Policy: Transient Local + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap_updates + Use Timestamp: false + Value: true + - Alpha: 0.30000001192092896 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Downsampled Costmap + Topic: + Depth: 1 + Durability Policy: Transient Local + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /downsampled_costmap + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /downsampled_costmap_updates + Use Timestamp: false + Value: true + - Alpha: 1 + Buffer Length: 1 + Class: rviz_default_plugins/Path + Color: 255; 0; 0 + Enabled: true + Head Diameter: 0.019999999552965164 + Head Length: 0.019999999552965164 + Length: 0.30000001192092896 + Line Style: Lines + Line Width: 0.029999999329447746 + Name: Path + Offset: + X: 0 + Y: 0 + Z: 0 + Pose Color: 255; 85; 255 + Pose Style: Arrows + Radius: 0.029999999329447746 + Shaft Diameter: 0.004999999888241291 + Shaft Length: 0.019999999552965164 + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /plan + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud + Color: 125; 125; 125 + Color Transformer: FlatColor + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: VoxelGrid + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.05000000074505806 + Style: Boxes + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/voxel_marked_cloud + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Class: rviz_default_plugins/Polygon + Color: 25; 255; 0 + Enabled: false + Name: Polygon + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/published_footprint + Value: false + Enabled: true + Name: Global Planner + - Class: rviz_common/Group + Displays: + - Alpha: 0.699999988079071 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Local Costmap + Topic: + Depth: 1 + Durability Policy: Transient Local + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_costmap/costmap + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_costmap/costmap_updates + Use Timestamp: false + Value: true + - Alpha: 1 + Buffer Length: 1 + Class: rviz_default_plugins/Path + Color: 0; 12; 255 + Enabled: true + Head Diameter: 0.30000001192092896 + Head Length: 0.20000000298023224 + Length: 0.30000001192092896 + Line Style: Lines + Line Width: 0.029999999329447746 + Name: Local Plan + Offset: + X: 0 + Y: 0 + Z: 0 + Pose Color: 255; 85; 255 + Pose Style: None + Radius: 0.029999999329447746 + Shaft Diameter: 0.10000000149011612 + Shaft Length: 0.10000000149011612 + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_plan + Value: true + - Class: rviz_default_plugins/MarkerArray + Enabled: false + Name: Trajectories + Namespaces: + {} + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /marker + Value: false + - Alpha: 1 + Class: rviz_default_plugins/Polygon + Color: 25; 255; 0 + Enabled: true + Name: Polygon + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_costmap/published_footprint + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud + Color: 255; 255; 255 + Color Transformer: RGB8 + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: VoxelGrid + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_costmap/voxel_marked_cloud + Use Fixed Frame: true + Use rainbow: true + Value: true + Enabled: true + Name: Controller + - Class: rviz_common/Group + Displays: + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: RealsenseCamera + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /intel_realsense_r200_depth/image_raw + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: RGB8 + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: RealsenseDepthImage + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /intel_realsense_r200_depth/points + Use Fixed Frame: true + Use rainbow: true + Value: true + Enabled: false + Name: Realsense + - Class: rviz_default_plugins/MarkerArray + Enabled: true + Name: MarkerArray + Namespaces: + {} + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /waypoints + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 5.605445384979248 + Min Value: 0.0022323131561279297 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: AxisColor + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: PointCloud2 + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.019999999552965164 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /front_3d_lidar/lidar_points + Use Fixed Frame: true + Use rainbow: true + Value: true + - Class: rviz_default_plugins/Image + Enabled: false + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Image + Normalize Range: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /front_stereo_camera/left/image_raw + Value: false + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: map + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + - Class: nav2_rviz_plugins/GoalTool + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 27.449058532714844 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 1.9582393169403076 + Y: 3.2220561504364014 + Z: 0.8917599320411682 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 1.2897965908050537 + Target Frame: + Value: Orbit (rviz_default_plugins) + Yaw: 6.277405261993408 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 736 + Hide Left Dock: false + Hide Right Dock: true + Image: + collapsed: false + Navigation 2: + collapsed: false + QMainWindow State: 000000ff00000000fd00000004000000000000016a0000028afc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afc0000003b00000106000000c700fffffffa000000010100000002fb0000000a0049006d0061006700650200000526000002090000016a000000e7fb000000100044006900730070006c00610079007301000000000000016a0000015600fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000018004e0061007600690067006100740069006f006e0020003201000001470000017e0000012300fffffffb0000001e005200650061006c00730065006e0073006500430061006d00650072006100000002c6000000c10000002800ffffff000000010000010f0000028afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003b0000028a000000a000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b2000000000000000000000002000004ba00000094fc0100000002fb0000000a0049006d006100670065030000037d000002170000016c00000104fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d006501000000000000045000000000000000000000034a0000028a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + RealsenseCamera: + collapsed: false + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: true + Width: 1210 + X: 470 + Y: 28 diff --git a/isaacsim_ws/src/navigation/carter_navigation/rviz2/carter_navigation_namespaced.rviz b/isaacsim_ws/src/navigation/carter_navigation/rviz2/carter_navigation_namespaced.rviz new file mode 100644 index 0000000..2a024f7 --- /dev/null +++ b/isaacsim_ws/src/navigation/carter_navigation/rviz2/carter_navigation_namespaced.rviz @@ -0,0 +1,371 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 195 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /RobotModel1/Status1 + - /TF1/Frames1 + - /TF1/Tree1 + - /Global Planner1/Global Costmap1 + Splitter Ratio: 0.5833333134651184 + Tree Height: 464 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: nav2_rviz_plugins/Navigation 2 + Name: Navigation 2 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: false + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: false + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 0 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: LaserScan + Position Transformer: XYZ + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Best Effort + Value: /scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: "" + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: Bumper Hit + Position Transformer: "" + Selectable: true + Size (Pixels): 3 + Size (m): 0.07999999821186066 + Style: Spheres + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Best Effort + Value: /mobile_base/sensors/bumper_pointcloud + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Class: rviz_default_plugins/Map + Color Scheme: map + Draw Behind: true + Enabled: true + Name: Map + Topic: + Depth: 1 + Durability Policy: Transient Local + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map + Use Timestamp: false + Value: true + - Alpha: 1 + Arrow Length: 0.019999999552965164 + Axes Length: 0.30000001192092896 + Axes Radius: 0.009999999776482582 + Class: rviz_default_plugins/PoseArray + Color: 0; 180; 0 + Enabled: true + Head Length: 0.07000000029802322 + Head Radius: 0.029999999329447746 + Name: Amcl Particle Swarm + Shaft Length: 0.23000000417232513 + Shaft Radius: 0.009999999776482582 + Shape: Arrow (Flat) + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Best Effort + Value: /particlecloud + Value: true + - Class: rviz_common/Group + Displays: + - Alpha: 0.30000001192092896 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Global Costmap + Topic: + Depth: 1 + Durability Policy: Transient Local + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap + Use Timestamp: false + Value: true + - Alpha: 1 + Buffer Length: 1 + Class: rviz_default_plugins/Path + Color: 255; 0; 0 + Enabled: true + Head Diameter: 0.019999999552965164 + Head Length: 0.019999999552965164 + Length: 0.30000001192092896 + Line Style: Lines + Line Width: 0.029999999329447746 + Name: Path + Offset: + X: 0 + Y: 0 + Z: 0 + Pose Color: 255; 85; 255 + Pose Style: Arrows + Radius: 0.029999999329447746 + Shaft Diameter: 0.004999999888241291 + Shaft Length: 0.019999999552965164 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /plan + Value: true + - Alpha: 1 + Class: rviz_default_plugins/Polygon + Color: 25; 255; 0 + Enabled: false + Name: Polygon + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/published_footprint + Value: false + Enabled: true + Name: Global Planner + - Class: rviz_common/Group + Displays: + - Alpha: 0.699999988079071 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Local Costmap + Topic: + Depth: 1 + Durability Policy: Transient Local + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_costmap/costmap + Use Timestamp: false + Value: true + - Alpha: 1 + Buffer Length: 1 + Class: rviz_default_plugins/Path + Color: 0; 12; 255 + Enabled: true + Head Diameter: 0.30000001192092896 + Head Length: 0.20000000298023224 + Length: 0.30000001192092896 + Line Style: Lines + Line Width: 0.029999999329447746 + Name: Local Plan + Offset: + X: 0 + Y: 0 + Z: 0 + Pose Color: 255; 85; 255 + Pose Style: None + Radius: 0.029999999329447746 + Shaft Diameter: 0.10000000149011612 + Shaft Length: 0.10000000149011612 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_plan + Value: true + - Class: rviz_default_plugins/MarkerArray + Enabled: false + Name: Trajectories + Namespaces: + {} + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /marker + Value: false + - Alpha: 1 + Class: rviz_default_plugins/Polygon + Color: 25; 255; 0 + Enabled: true + Name: Polygon + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /local_costmap/published_footprint + Value: true + Enabled: true + Name: Controller + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: map + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: nav2_rviz_plugins/GoalTool + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Angle: -1.5700000524520874 + Class: rviz_default_plugins/TopDownOrtho + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Scale: 134.638427734375 + Target Frame: + Value: TopDownOrtho (rviz_default_plugins) + X: -0.032615214586257935 + Y: -0.0801941454410553 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 914 + Hide Left Dock: false + Hide Right Dock: true + Navigation 2: + collapsed: false + QMainWindow State: 000000ff00000000fd00000004000000000000016a00000338fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000002c4000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000018004e0061007600690067006100740069006f006e0020003201000003070000006e0000006200ffffff000000010000010f00000338fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000338000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000004990000033800000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: true + Width: 1545 + X: 186 + Y: 117 diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/CMakeLists.txt b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/CMakeLists.txt new file mode 100644 index 0000000..d047da0 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.5) +project(isaac_ros_navigation_goal LANGUAGES PYTHON) + +# Default to C++17 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE) +message( STATUS "Architecture: ${ARCHITECTURE}" ) + +set(CUDA_MIN_VERSION "10.2") + +# Find dependencies +find_package(ament_cmake REQUIRED) +find_package(ament_cmake_auto REQUIRED) +find_package(ament_cmake_python REQUIRED) +find_package(rclpy REQUIRED) +ament_auto_find_build_dependencies() + +# Install Python modules +ament_python_install_package(${PROJECT_NAME}) + +# Install Python executables +install(PROGRAMS + isaac_ros_navigation_goal/set_goal.py + DESTINATION lib/${PROJECT_NAME} + ) + +ament_auto_package(INSTALL_TO_SHARE) diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/carter_warehouse_navigation.png b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/carter_warehouse_navigation.png new file mode 100644 index 0000000..d2fec12 Binary files /dev/null and b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/carter_warehouse_navigation.png differ diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/carter_warehouse_navigation.yaml b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/carter_warehouse_navigation.yaml new file mode 100644 index 0000000..70618b3 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/carter_warehouse_navigation.yaml @@ -0,0 +1,6 @@ +image: carter_warehouse_navigation.png +resolution: 0.05 +origin: [-11.975, -17.975, 0.0000] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.196 diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/goals.txt b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/goals.txt new file mode 100644 index 0000000..6c36b99 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/assets/goals.txt @@ -0,0 +1,3 @@ +1 2 0 0 1 0 +2 3 0 0 1 1 +3.4 4.5 0.5 0.5 0.5 0.5 \ No newline at end of file diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/__init__.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/__init__.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/__init__.py new file mode 100644 index 0000000..1d12286 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/__init__.py @@ -0,0 +1,2 @@ +from .random_goal_generator import RandomGoalGenerator +from .goal_reader import GoalReader diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/goal_generator.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/goal_generator.py new file mode 100644 index 0000000..7c7c7d1 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/goal_generator.py @@ -0,0 +1,25 @@ +from abc import ABC, abstractmethod + + +class GoalGenerator(ABC): + """ + Parent class for the Goal generators + """ + + def __init__(self): + pass + + @abstractmethod + def generate_goal(self, max_num_of_trials=2000): + """ + Generate the goal. + + Parameters + ---------- + max_num_of_trials: maximum number of pose generations when generated pose keep is not a valid pose. + + Returns + ------- + [List][Pose]: Pose in format [pose.x,pose.y,orientaion.x,orientaion.y,orientaion.z,orientaion.w] + """ + pass diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/goal_reader.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/goal_reader.py new file mode 100644 index 0000000..06c65e3 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/goal_reader.py @@ -0,0 +1,17 @@ +from .goal_generator import GoalGenerator + + +class GoalReader(GoalGenerator): + def __init__(self, file_path): + self.__file_path = file_path + self.__generator = self.__get_goal() + + def generate_goal(self, max_num_of_trials=1000): + try: + return next(self.__generator) + except StopIteration: + return + + def __get_goal(self): + for row in open(self.__file_path, "r"): + yield list(map(float, row.strip().split(" "))) diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/random_goal_generator.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/random_goal_generator.py new file mode 100644 index 0000000..d451d36 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/goal_generators/random_goal_generator.py @@ -0,0 +1,43 @@ +import numpy as np +from .goal_generator import GoalGenerator + + +class RandomGoalGenerator(GoalGenerator): + """ + Random goal generator. + + parameters + ---------- + grid_map: GridMap Object + distance: distance in meters to check vicinity for obstacles. + """ + + def __init__(self, grid_map, distance): + self.__grid_map = grid_map + self.__distance = distance + + def generate_goal(self, max_num_of_trials=1000): + """ + Generate the goal. + + Parameters + ---------- + max_num_of_trials: maximum number of pose generations when generated pose keep is not a valid pose. + + Returns + ------- + [List][Pose]: Pose in format [pose.x,pose.y,orientaion.x,orientaion.y,orientaion.z,orientaion.w] + """ + range_ = self.__grid_map.get_range() + trial_count = 0 + while trial_count < max_num_of_trials: + x = np.random.uniform(range_[0][0], range_[0][1]) + y = np.random.uniform(range_[1][0], range_[1][1]) + orient_x = np.random.uniform(0, 1) + orient_y = np.random.uniform(0, 1) + orient_z = np.random.uniform(0, 1) + orient_w = np.random.uniform(0, 1) + if self.__grid_map.is_valid_pose([x, y], self.__distance): + goal = [x, y, orient_x, orient_y, orient_z, orient_w] + return goal + trial_count += 1 diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/obstacle_map.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/obstacle_map.py new file mode 100644 index 0000000..82ec985 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/obstacle_map.py @@ -0,0 +1,157 @@ +import numpy as np +import yaml +import os +import math +from PIL import Image + + +class GridMap: + def __init__(self, yaml_file_path): + self.__get_meta_from_yaml(yaml_file_path) + self.__get_raw_map() + self.__add_max_range_to_meta() + # print(self.__map_meta) + + def __get_meta_from_yaml(self, yaml_file_path): + """ + Reads map meta from the yaml file. + + Parameters + ---------- + yaml_file_path: path of the yaml file. + """ + + with open(yaml_file_path, "r") as f: + file_content = f.read() + self.__map_meta = yaml.safe_load(file_content) + self.__map_meta["image"] = os.path.join(os.path.dirname(yaml_file_path), self.__map_meta["image"]) + + def __get_raw_map(self): + """ + Reads the map image and generates the grid map.\n + Grid map is a 2D boolean matrix where True=>occupied space & False=>Free space. + """ + + img = Image.open(self.__map_meta.get("image")) + img = np.array(img) + + # Anything greater than free_thresh is considered as occupied + if self.__map_meta["negate"]: + res = np.where((img / 255)[:, :, 0] > self.__map_meta["free_thresh"]) + else: + res = np.where(((255 - img) / 255)[:, :, 0] > self.__map_meta["free_thresh"]) + + self.__grid_map = np.zeros(shape=(img.shape[:2]), dtype=bool) + + for i in range(res[0].shape[0]): + self.__grid_map[res[0][i], res[1][i]] = 1 + + def __add_max_range_to_meta(self): + """ + Calculates and adds the max value of pose in x & y direction to the meta. + """ + + max_x = self.__grid_map.shape[1] * self.__map_meta["resolution"] + self.__map_meta["origin"][0] + max_y = self.__grid_map.shape[0] * self.__map_meta["resolution"] + self.__map_meta["origin"][1] + self.__map_meta["max_x"] = round(max_x, 2) + self.__map_meta["max_y"] = round(max_y, 2) + + def __pad_obstacles(self, distance): + pass + + def get_range(self): + """ + Returns the bounds of pose values in x & y direction.\n + + Returns + ------- + [List]:\n + Where list[0][0]: min value in x direction + list[0][1]: max value in x direction + list[1][0]: min value in y direction + list[1][1]: max value in y direction + """ + + return [ + [self.__map_meta["origin"][0], self.__map_meta["max_x"]], + [self.__map_meta["origin"][1], self.__map_meta["max_y"]], + ] + + def __transform_to_image_coordinates(self, point): + """ + Transforms a pose in meters to image pixel coordinates. + + Parameters + ---------- + Point: A point as list. where list[0]=>pose.x and list[1]=pose.y + + Returns + ------- + [Tuple]: tuple[0]=>pixel value in x direction. i.e column index. + tuple[1]=> pixel vlaue in y direction. i.e row index. + """ + + p_x, p_y = point + i_x = math.floor((p_x - self.__map_meta["origin"][0]) / self.__map_meta["resolution"]) + i_y = math.floor((p_y - self.__map_meta["origin"][1]) / self.__map_meta["resolution"]) + + # because origin in yaml is at bottom left of image + i_y = self.__grid_map.shape[0] - i_y + return i_x, i_y + + def __transform_distance_to_pixels(self, distance): + """ + Converts the distance in meters to number of pixels based on the resolution. + + Parameters + ---------- + distance: value in meters + + Returns + ------- + [Integer]: number of pixel which represent the same distance. + """ + return math.ceil(distance / self.__map_meta["resolution"]) + + def __is_obstacle_in_distance(self, img_point, distance): + """ + Checks if any obstacle is in vicinity of the given image point. + + Parameters + ---------- + img_point: pixel values of the point + distance: distnace in pixels in which there shouldn't be any obstacle. + + Returns + ------- + [Bool]: True if any obstacle found else False. + """ + # need to make sure that patch xmin & ymin are >=0, + # because of python's negative indexing capability + row_start_idx = 0 if img_point[1] - distance < 0 else img_point[1] - distance + col_start_idx = 0 if img_point[0] - distance < 0 else img_point[0] - distance + + # image point acts as the center of the square, where each side of square is of size + # 2xdistance + patch = self.__grid_map[row_start_idx : img_point[1] + distance, col_start_idx : img_point[0] + distance] + obstacles = np.where(patch == True) + return len(obstacles[0]) > 0 + + def is_valid_pose(self, point, distance=0.2): + """ + Checks if a given pose is "distance" away from a obstacle. + + Parameters + ---------- + point: pose in 2D space. where point[0]=pose.x and point[1]=pose.y + distance: distance in meters. + + Returns + ------- + [Bool]: True if pose is valid else False + """ + assert len(point) == 2 + img_point = self.__transform_to_image_coordinates(point) + img_pixel_distance = self.__transform_distance_to_pixels(distance) + # Pose is not valid if there is obstacle in the vicinity + return not self.__is_obstacle_in_distance(img_point, img_pixel_distance) diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/set_goal.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/set_goal.py new file mode 100644 index 0000000..7f2f8dd --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/isaac_ros_navigation_goal/set_goal.py @@ -0,0 +1,204 @@ +import rclpy +from rclpy.action import ActionClient +from rclpy.node import Node +from nav2_msgs.action import NavigateToPose +from .obstacle_map import GridMap +from .goal_generators import RandomGoalGenerator, GoalReader +import sys +from geometry_msgs.msg import PoseWithCovarianceStamped +import time + + +class SetNavigationGoal(Node): + def __init__(self): + super().__init__("set_navigation_goal") + + self.declare_parameters( + namespace="", + parameters=[ + ("iteration_count", 1), + ("goal_generator_type", "RandomGoalGenerator"), + ("action_server_name", "navigate_to_pose"), + ("obstacle_search_distance_in_meters", 0.2), + ("frame_id", "map"), + ("map_yaml_path", rclpy.Parameter.Type.STRING), + ("goal_text_file_path", rclpy.Parameter.Type.STRING), + ("initial_pose", rclpy.Parameter.Type.DOUBLE_ARRAY), + ], + ) + + self.__goal_generator = self.__create_goal_generator() + action_server_name = self.get_parameter("action_server_name").value + self._action_client = ActionClient(self, NavigateToPose, action_server_name) + + self.MAX_ITERATION_COUNT = self.get_parameter("iteration_count").value + assert self.MAX_ITERATION_COUNT > 0 + self.curr_iteration_count = 1 + + self.__initial_goal_publisher = self.create_publisher(PoseWithCovarianceStamped, "/initialpose", 1) + + self.__initial_pose = self.get_parameter("initial_pose").value + self.__is_initial_pose_sent = True if self.__initial_pose is None else False + + def __send_initial_pose(self): + """ + Publishes the initial pose. + This function is only called once that too before sending any goal pose + to the mission server. + """ + goal = PoseWithCovarianceStamped() + goal.header.frame_id = self.get_parameter("frame_id").value + goal.header.stamp = self.get_clock().now().to_msg() + goal.pose.pose.position.x = self.__initial_pose[0] + goal.pose.pose.position.y = self.__initial_pose[1] + goal.pose.pose.position.z = self.__initial_pose[2] + goal.pose.pose.orientation.x = self.__initial_pose[3] + goal.pose.pose.orientation.y = self.__initial_pose[4] + goal.pose.pose.orientation.z = self.__initial_pose[5] + goal.pose.pose.orientation.w = self.__initial_pose[6] + self.__initial_goal_publisher.publish(goal) + + def send_goal(self): + """ + Sends the goal to the action server. + """ + + if not self.__is_initial_pose_sent: + self.get_logger().info("Sending initial pose") + self.__send_initial_pose() + self.__is_initial_pose_sent = True + + # Assumption is that initial pose is set after publishing first time in this duration. + # Can be changed to more sophisticated way. e.g. /particlecloud topic has no msg until + # the initial pose is set. + time.sleep(10) + self.get_logger().info("Sending first goal") + + self._action_client.wait_for_server() + goal_msg = self.__get_goal() + + if goal_msg is None: + rclpy.shutdown() + sys.exit(1) + + self._send_goal_future = self._action_client.send_goal_async( + goal_msg, feedback_callback=self.__feedback_callback + ) + self._send_goal_future.add_done_callback(self.__goal_response_callback) + + def __goal_response_callback(self, future): + """ + Callback function to check the response(goal accpted/rejected) from the server.\n + If the Goal is rejected it stops the execution for now.(We can change to resample the pose if rejected.) + """ + + goal_handle = future.result() + if not goal_handle.accepted: + self.get_logger().info("Goal rejected :(") + rclpy.shutdown() + return + + self.get_logger().info("Goal accepted :)") + + self._get_result_future = goal_handle.get_result_async() + self._get_result_future.add_done_callback(self.__get_result_callback) + + def __get_goal(self): + """ + Get the next goal from the goal generator. + + Returns + ------- + [NavigateToPose][goal] or None if the next goal couldn't be generated. + + """ + + goal_msg = NavigateToPose.Goal() + goal_msg.pose.header.frame_id = self.get_parameter("frame_id").value + goal_msg.pose.header.stamp = self.get_clock().now().to_msg() + pose = self.__goal_generator.generate_goal() + + # couldn't sample a pose which is not close to obstacles. Rare but might happen in dense maps. + if pose is None: + self.get_logger().error( + "Could not generate next goal. Returning. Possible reasons for this error could be:" + ) + self.get_logger().error( + "1. If you are using GoalReader then please make sure iteration count <= number of goals avaiable in file." + ) + self.get_logger().error( + "2. If RandomGoalGenerator is being used then it was not able to sample a pose which is given distance away from the obstacles." + ) + return + + self.get_logger().info("Generated goal pose: {0}".format(pose)) + goal_msg.pose.pose.position.x = pose[0] + goal_msg.pose.pose.position.y = pose[1] + goal_msg.pose.pose.orientation.x = pose[2] + goal_msg.pose.pose.orientation.y = pose[3] + goal_msg.pose.pose.orientation.z = pose[4] + goal_msg.pose.pose.orientation.w = pose[5] + return goal_msg + + def __get_result_callback(self, future): + """ + Callback to check result.\n + It calls the send_goal() function in case current goal sent count < required goals count. + """ + # Nav2 is sending empty message for success as well as for failure. + result = future.result().result + self.get_logger().info("Result: {0}".format(result.result)) + + if self.curr_iteration_count < self.MAX_ITERATION_COUNT: + self.curr_iteration_count += 1 + self.send_goal() + else: + rclpy.shutdown() + + def __feedback_callback(self, feedback_msg): + """ + This is feeback callback. We can compare/compute/log while the robot is on its way to goal. + """ + # self.get_logger().info('FEEDBACK: {}\n'.format(feedback_msg)) + pass + + def __create_goal_generator(self): + """ + Creates the GoalGenerator object based on the specified ros param value. + """ + + goal_generator_type = self.get_parameter("goal_generator_type").value + goal_generator = None + if goal_generator_type == "RandomGoalGenerator": + if self.get_parameter("map_yaml_path").value is None: + self.get_logger().info("Yaml file path is not given. Returning..") + sys.exit(1) + + yaml_file_path = self.get_parameter("map_yaml_path").value + grid_map = GridMap(yaml_file_path) + obstacle_search_distance_in_meters = self.get_parameter("obstacle_search_distance_in_meters").value + assert obstacle_search_distance_in_meters > 0 + goal_generator = RandomGoalGenerator(grid_map, obstacle_search_distance_in_meters) + + elif goal_generator_type == "GoalReader": + if self.get_parameter("goal_text_file_path").value is None: + self.get_logger().info("Goal text file path is not given. Returning..") + sys.exit(1) + + file_path = self.get_parameter("goal_text_file_path").value + goal_generator = GoalReader(file_path) + else: + self.get_logger().info("Invalid goal generator specified. Returning...") + sys.exit(1) + return goal_generator + + +def main(): + rclpy.init() + set_goal = SetNavigationGoal() + result = set_goal.send_goal() + rclpy.spin(set_goal) + + +if __name__ == "__main__": + main() diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/launch/isaac_ros_navigation_goal.launch.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/launch/isaac_ros_navigation_goal.launch.py new file mode 100644 index 0000000..4f3d712 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/launch/isaac_ros_navigation_goal.launch.py @@ -0,0 +1,48 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +import os +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node + + +def generate_launch_description(): + + map_yaml_file = LaunchConfiguration( + "map_yaml_path", + default=os.path.join( + get_package_share_directory("isaac_ros_navigation_goal"), "assets", "carter_warehouse_navigation.yaml" + ), + ) + + goal_text_file = LaunchConfiguration( + "goal_text_file_path", + default=os.path.join(get_package_share_directory("isaac_ros_navigation_goal"), "assets", "goals.txt"), + ) + + navigation_goal_node = Node( + name="set_navigation_goal", + package="isaac_ros_navigation_goal", + executable="SetNavigationGoal", + parameters=[ + { + "map_yaml_path": map_yaml_file, + "iteration_count": 3, + "goal_generator_type": "RandomGoalGenerator", + "action_server_name": "navigate_to_pose", + "obstacle_search_distance_in_meters": 0.2, + "goal_text_file_path": goal_text_file, + "initial_pose": [-6.4, -1.04, 0.0, 0.0, 0.0, 0.99, 0.02], + } + ], + output="screen", + ) + + return LaunchDescription([navigation_goal_node]) diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/package.xml b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/package.xml new file mode 100644 index 0000000..bd666eb --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/package.xml @@ -0,0 +1,33 @@ + + + + isaac_ros_navigation_goal + 0.1.0 + Package to set goals for navigation stack. + + Isaac Sim + + Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. + NVIDIA CORPORATION and its licensors retain all intellectual property + and proprietary rights in and to this software, related documentation + and any modifications thereto. Any use, reproduction, disclosure or + distribution of this software and related documentation without an express + license agreement from NVIDIA CORPORATION is strictly prohibited. + + https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html + https://forums.developer.nvidia.com/c/omniverse/simulation/69 + https://developer.nvidia.com/isaac-ros-gems/ + + rclpy + std_msgs + sensor_msgs + geometry_msgs + nav2_msgs + ament_flake8 + ament_pep257 + python3-pytest + + + ament_python + + diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/resource/isaac_ros_navigation_goal b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/resource/isaac_ros_navigation_goal new file mode 100644 index 0000000..e69de29 diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/setup.cfg b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/setup.cfg new file mode 100644 index 0000000..1aa9f68 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script_dir=$base/lib/isaac_ros_navigation_goal +[install] +install_scripts=$base/lib/isaac_ros_navigation_goal diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/setup.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/setup.py new file mode 100644 index 0000000..e3474a6 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/setup.py @@ -0,0 +1,25 @@ +from setuptools import setup +from glob import glob +import os + +package_name = "isaac_ros_navigation_goal" + +setup( + name=package_name, + version="0.0.1", + packages=[package_name, package_name + "/goal_generators"], + data_files=[ + ("share/ament_index/resource_index/packages", ["resource/" + package_name]), + ("share/" + package_name, ["package.xml"]), + (os.path.join("share", package_name, "launch"), glob("launch/*.launch.py")), + ("share/" + package_name + "/assets", glob("assets/*")), + ], + install_requires=["setuptools"], + zip_safe=True, + maintainer="isaac sim", + maintainer_email="isaac-sim@todo.todo", + description="Package to set goals for navigation stack.", + license="NVIDIA Isaac ROS Software License", + tests_require=["pytest"], + entry_points={"console_scripts": ["SetNavigationGoal = isaac_ros_navigation_goal.set_goal:main"]}, +) diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/test/test_flake8.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/test/test_flake8.py new file mode 100644 index 0000000..49c1644 --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/test/test_flake8.py @@ -0,0 +1,23 @@ +# Copyright 2017 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_flake8.main import main_with_errors +import pytest + + +@pytest.mark.flake8 +@pytest.mark.linter +def test_flake8(): + rc, errors = main_with_errors(argv=[]) + assert rc == 0, "Found %d code style errors / warnings:\n" % len(errors) + "\n".join(errors) diff --git a/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/test/test_pep257.py b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/test/test_pep257.py new file mode 100644 index 0000000..a2c3deb --- /dev/null +++ b/isaacsim_ws/src/navigation/isaac_ros_navigation_goal/test/test_pep257.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_pep257.main import main +import pytest + + +@pytest.mark.linter +@pytest.mark.pep257 +def test_pep257(): + rc = main(argv=[".", "test"]) + assert rc == 0, "Found code style errors / warnings"