From 5216d785a1b72b98b1b2bb2bbff56bb5a3dd37fc Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Tue, 27 Aug 2024 12:49:02 +0200 Subject: [PATCH 1/8] O3DE installation for Ubuntu Signed-off-by: Wiktoria Siekierska --- .../Simulators/O3DE/Installation-Ubuntu.rst | 65 +++++++++++++++++++ .../Simulators/O3DE/Simulation-O3DE.rst | 14 ++++ .../Advanced/Simulators/Simulation-Main.rst | 1 + 3 files changed, 80 insertions(+) create mode 100644 source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst create mode 100644 source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst new file mode 100644 index 00000000000..d18fec5ec9e --- /dev/null +++ b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst @@ -0,0 +1,65 @@ +Installation (Ubuntu) +====================================== + +**Goal:** Install the package and run simulation examples on Ubuntu. + +**Tutorial level:** Advanced + +**Time:** 10 minutes + +.. contents:: Contents + :depth: 2 + :local: + +Background + + +Prerequisites +------------- + +It is recommended to understand basic ROS principles covered in the beginner :doc:`../../../../Tutorials`. +In particular, :doc:`../../../Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace` and :doc:`../../../Beginner-Client-Libraries/Creating-Your-First-ROS2-Package` are useful prerequisites. + +To install the O3DE software, you should follow the `installation procedure `_ from the official O3DE website. + + +Install ``o3de-extras`` +------------------------ + +Clone the Repository +^^^^^^^^^^^^^^^^^^^^ +To get started, clone the ``o3de-extras`` repository: + +.. code-block:: bash + + git clone https://github.com/o3de/o3de-extras + +Setting up o3de-extras +^^^^^^^^^^^^^^^^^^^^^^ +The ``o3de-extras`` repository can be cloned to any location on your local machine. Once cloned, you need to inform O3DE about the location of the extra assets in this repository by registering them. From the O3DE repository folder, you can register some or all of the extra assets using the ``o3de register`` command. Since these are optional assets, you may choose to register only those that you need. For example, to register a specific gem, use the following command: + +.. code-block:: bash + + scripts\o3de.bat register --gem-path /Gems/ + +If you want to register all the gems, you can do so since the repository follows the standard O3DE compound repository structure, with all gems located in the ``/Gems`` directory. To register all gems at once, use: + +.. code-block:: bash + + scripts\o3de.bat register --all-gems-path /Gems + +This process can be repeated for any other object types, if they exist: + +.. code-block:: bash + + scripts\o3de.bat register --all-engines-path /Engines + scripts\o3de.bat register --all-projects-path /Projects + scripts\o3de.bat register --all-gems-path /Gems + scripts\o3de.bat register --all-templates-path /Templates + scripts\o3de.bat register --all-restricted-path /Restricted + +If you've registered a gem, which functions like a plugin or component within a project, and you wish to use it in your project, you need to enable it by using the ``o3de enable-gem`` command: + +.. code-block:: bash + + scripts\o3de.bat enable-gem --gem-name --project-name \ No newline at end of file diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst b/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst new file mode 100644 index 00000000000..891dd28a3b7 --- /dev/null +++ b/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst @@ -0,0 +1,14 @@ +O3DE +====== + +This set of tutorials will teach you how to configure the O3DE simulator with ROS 2. + +.. contents:: Contents + :depth: 2 + :local: + +.. toctree:: + :maxdepth: 1 + + Installation-Ubuntu + Setting-Up-Simulation-O3DE-Basic \ No newline at end of file diff --git a/source/Tutorials/Advanced/Simulators/Simulation-Main.rst b/source/Tutorials/Advanced/Simulators/Simulation-Main.rst index 8aaf9611921..7b2bee28ab2 100644 --- a/source/Tutorials/Advanced/Simulators/Simulation-Main.rst +++ b/source/Tutorials/Advanced/Simulators/Simulation-Main.rst @@ -22,3 +22,4 @@ This set of tutorials will teach you how to configure different simulators with Webots/Simulation-Webots Gazebo/Simulation-Gazebo + O3DE/Simulation-O3DE From 5bc6e0f2b4afc573d54697d40427b402dc5fc19a Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Tue, 27 Aug 2024 14:13:25 +0200 Subject: [PATCH 2/8] O3DE installation for Linux from Github Signed-off-by: Wiktoria Siekierska --- .../Simulators/O3DE/Installation-Ubuntu.rst | 107 +++++++++++++++++- .../Simulators/O3DE/Simulation-O3DE.rst | 3 +- 2 files changed, 106 insertions(+), 4 deletions(-) diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst index d18fec5ec9e..7c2b183fbe1 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst @@ -5,14 +5,16 @@ Installation (Ubuntu) **Tutorial level:** Advanced -**Time:** 10 minutes +**Time:** 15 minutes .. contents:: Contents :depth: 2 :local: Background +------------- +This tutorial will guide you through the steps to set up Open 3D Engine (O3DE) directly from the GitHub repository on a Linux system. This guide assumes you are not creating a fork of the repository. Prerequisites ------------- @@ -20,11 +22,110 @@ Prerequisites It is recommended to understand basic ROS principles covered in the beginner :doc:`../../../../Tutorials`. In particular, :doc:`../../../Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace` and :doc:`../../../Beginner-Client-Libraries/Creating-Your-First-ROS2-Package` are useful prerequisites. -To install the O3DE software, you should follow the `installation procedure `_ from the official O3DE website. +Before you begin, ensure you have the following installed on your Linux system: + +- **Git**: To clone the O3DE repository. +- **CMake (version 3.20 or later)**: For building the project. +- **Ninja or Make**: Build systems supported by O3DE. +- **Python (version 3.7 or later)**: Required for various scripts. +- **Clang (version 12 or later)**: The recommended compiler for O3DE. + + +Setting up O3DE from GitHub on Linux +------------------------------------ +Step 1: Install Required Dependencies +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, install the necessary dependencies by running the following commands in your terminal: + +.. code-block:: bash + + sudo apt-get update + sudo apt-get install -y build-essential ninja-build python3 python3-pip python3-venv \ + libglu1-mesa-dev libxcb-xinerama0 libxcb-xinput0 libxcb-xinput-dev \ + libfontconfig1 libssl-dev uuid-dev clang lld + +Step 2: Clone the O3DE Repository +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Next, clone the O3DE repository from GitHub: + +.. code-block:: bash + + git clone https://github.com/o3de/o3de.git + cd o3de + +This command downloads the O3DE source code into a directory named ``o3de`` and changes the current working directory to it. + +Step 3: Configure the O3DE Project +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Run the ``cmake`` command to configure the project. This will generate the necessary build files in the ``build`` directory. + +.. code-block:: bash + + cmake -B build/ -S . -G "Ninja Multi-Config" + +Here’s what each argument does: + +- ``-B build/``: Specifies the output directory for the build files. +- ``-S .``: Specifies the source directory (current directory). +- ``-G "Ninja Multi-Config"``: Specifies Ninja as the build system with multi-config support. + +Step 4: Build O3DE +^^^^^^^^^^^^^^^^^^ + +Now, build O3DE using the ``cmake`` command: + +.. code-block:: bash + + cmake --build build/ --config profile + +This command builds O3DE in ``profile`` mode, which is recommended for development. You can replace ``profile`` with ``debug`` or ``release`` depending on your needs. + +Step 5: Set Up the Project Environment +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before launching the O3DE Editor, you need to set up the project environment. Run the following script to do so: + +.. code-block:: bash + + ./scripts/o3de.sh register --this-engine + +This command registers the engine, allowing you to create and manage projects with O3DE. + +Step 6: Create or Open a Project +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +With O3DE set up, you can create a new project or open an existing one. +To create a new project: + +.. code-block:: bash + + ./scripts/o3de.sh create-project --project-path --template Default + +Replace ```` with the desired directory for your new project. + +To open an existing project, navigate to the project directory and use the following command: + +.. code-block:: bash + + ./scripts/o3de.sh edit-project --project-path + +Step 7: Launch the O3DE Editor +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Finally, launch the O3DE Editor by running: + +.. code-block:: bash + + ./build/bin/profile/Editor + +This command starts the O3DE Editor in ``profile`` mode. Install ``o3de-extras`` ------------------------- +----------------------- Clone the Repository ^^^^^^^^^^^^^^^^^^^^ diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst b/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst index 891dd28a3b7..d384eb2a9a2 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Simulation-O3DE.rst @@ -11,4 +11,5 @@ This set of tutorials will teach you how to configure the O3DE simulator with RO :maxdepth: 1 Installation-Ubuntu - Setting-Up-Simulation-O3DE-Basic \ No newline at end of file + Setting-Up-Simulation-O3DE-Basic + Setting-Up-Simulation-O3DE-Advanced \ No newline at end of file From f8d62a75dcfbad9a2a48687bfe226cead5ff84bf Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Tue, 27 Aug 2024 14:14:24 +0200 Subject: [PATCH 3/8] Setting up basic simulation in O3DE Signed-off-by: Wiktoria Siekierska --- .../O3DE/Setting-Up-Simulation-O3DE-Basic.rst | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst new file mode 100644 index 00000000000..71fbcace0eb --- /dev/null +++ b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst @@ -0,0 +1,111 @@ +.. redirect-from:: + + Tutorials/Simulators/O3DE/Setting-up-a-Robot-Simulation-O3DE + Tutorials/Advanced/Simulators/O3DE + +Setting up a robot simulation (Basic) +====================================== + +**Goal:** Setup a robot simulation and control it from ROS 2. + +**Tutorial level:** Advanced + +**Time:** 30 minutes + +.. contents:: Contents + :depth: 2 + :local: + +Background +---------- + +In this tutorial, you will use the Open 3D Engine (O3DE) to set up and run a basic ROS 2 simulation scenario. + +The ``o3de-extras`` repository provides additional tools and templates for enhancing your O3DE projects with ROS 2 capabilities. In this tutorial, you will use the ``Ros2ProjectTemplate`` from the ``o3de-extras`` repository to create a project that integrates ROS 2 with O3DE for simulating a robot in a virtual environment. This template includes several example projects, but for this tutorial, you will focus on the ``slam_navigation`` example, which demonstrates how to simulate a robot performing SLAM (Simultaneous Localization and Mapping) and navigation tasks. + +For more detailed examples and use cases, you can refer to the `O3DE ROS 2 Examples `_ page. + + +Prerequisites +------------- + +Before you begin, ensure that you have the following installed: + +- O3DE set up on your machine. For instructions, refer to the ``Setting Up O3DE from GitHub`` guide. +- ROS 2 (Foxy or later) installed on your system. +- The ``o3de-extras`` repository cloned locally. + + +Creating a New ROS 2 Project +---------------------------- + +1. **Register the ROS 2 Project Template**: + + Navigate to your O3DE directory and register the ROS 2 Project Template from the ``o3de-extras`` repository: + + .. code-block:: bash + + scripts\o3de.bat register --all-templates-path \Templates + + This command registers all templates within the ``o3de-extras`` repository, including the ROS 2 Project Template. + +2. **Create a New Project**: + + Create a new project using the ROS 2 Project Template: + + .. code-block:: bash + + scripts\o3de.bat create-project --project-name --template-name Ros2ProjectTemplate --project-path + + Replace ```` with your desired project name and ```` with the directory where you want the project to be created. + +3. **Build the Project**: + + After creating the project, build it using the following command: + + .. code-block:: bash + + cmake --build --target Editor + + Ensure the build completes without errors. + +Setting Up the SLAM Navigation Example +-------------------------------------- + +The ROS 2 Project Template includes several example projects. In this tutorial, you will use the SLAM navigation example to simulate a robot performing SLAM and navigation tasks. + +1. **Navigate to the Example Directory**: + + The SLAM navigation example is located in the following directory: + + .. code-block:: bash + + \Gems\ROS2\Examples\slam_navigation + +2. **Run the Example**: + + Launch the example by opening the O3DE Editor: + + .. code-block:: bash + + \scripts\o3de.bat Editor + + Once in the Editor, open the SLAM navigation level by navigating to the ``Levels`` tab and selecting the SLAM navigation level. + + Press ``Ctrl+G`` to start the simulation. + +3. **Launching ROS 2 Nodes**: + + In a new terminal, source your ROS 2 environment and launch the ROS 2 nodes required for SLAM and navigation: + + .. code-block:: bash + + source /opt/ros/foxy/setup.bash + ros2 launch slam_navigation slam_navigation_launch.py + + This command starts the ROS 2 nodes, enabling the robot in the simulation to perform SLAM and navigation. + +Exploring Further +----------------- + +Now that your ROS 2 project is up and running in O3DE, you can explore and customize the simulation further. For more detailed examples and documentation, refer to the `O3DE ROS 2 Examples `_ page. From f3d18275e4d9f2d986ec3b5c32ef5a3e3eae47f0 Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Wed, 28 Aug 2024 12:26:19 +0200 Subject: [PATCH 4/8] Refactor setting up basic simulation in O3DE Signed-off-by: Wiktoria Siekierska --- .../Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst index 71fbcace0eb..dfbec17515d 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst @@ -31,7 +31,7 @@ Prerequisites Before you begin, ensure that you have the following installed: -- O3DE set up on your machine. For instructions, refer to the ``Setting Up O3DE from GitHub`` guide. +- O3DE set up on your machine. For instructions, follow the `O3DE installation for Ubuntu ` guide. - ROS 2 (Foxy or later) installed on your system. - The ``o3de-extras`` repository cloned locally. From 613477060f6f3714af4f20ab2daec32541905fa4 Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Wed, 28 Aug 2024 12:26:53 +0200 Subject: [PATCH 5/8] Setting up an advanced simulation in O3DE Signed-off-by: Wiktoria Siekierska --- .../Setting-Up-Simulation-O3DE-Advanced.rst | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst new file mode 100644 index 00000000000..b0dad45f8fc --- /dev/null +++ b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst @@ -0,0 +1,118 @@ +Setting up a robot simulation (Advanced) +======================================== + +**Goal:** Setup a robot simulation and control it from ROS 2. + +**Tutorial level:** Advanced + +**Time:** 30 minutes + +.. contents:: Contents + :depth: 2 + :local: + +Background +---------- + +In this tutorial, you will use the Open 3D Engine (O3DE) to set up and execute a ROS 2 robotic manipulation simulation. + +The ``o3de-extras`` repository offers additional tools and templates to enhance O3DE projects with ROS 2 functionality. In this tutorial, you will use the ``Ros2RoboticManipulationTemplate`` from the ``o3de-extras`` repository. This template provides a foundation for integrating ROS 2 with O3DE to simulate robotic manipulation tasks in a virtual environment. It includes predefined configurations and examples to demonstrate how to control and interact with robotic manipulators within O3DE. + +For detailed instructions and further examples on using the ROS 2 Robotic Manipulation Template, you can refer to the `O3DE ROS 2 Robotic Manipulation Template `_ page. + + +Prerequisites +------------- +Ensure you have the following before starting: + +- O3DE set up on your machine. For instructions, follow the `O3DE installation for Ubuntu ` guide. +- ROS 2 (Foxy or later) installed on your system. +- The ``o3de-extras`` repository cloned locally. +- **MoveIt**, which is used for motion planning in ROS 2. Follow the MoveIt 2 documentation for installation instructions. + + +Creating a New ROS 2 Project +---------------------------- + +1. **Register the Template**: + +Register the template with O3DE so that it can be used to create a new project. + +From the root directory of your O3DE installation, run: + +.. code-block:: bash + + scripts\o3de.bat register --all-templates-path /Templates + +This command registers all templates in the ``o3de-extras`` repository, including the Robotic Manipulation Template. + +2. **Create a New Project**: + +Create a new project using the ROS 2 Robotic Manipulation Template: + +.. code-block:: bash + + scripts\o3de.bat create-project --project-name --template-name Ros2RoboticManipulationTemplate + +This will generate a new project directory with the necessary files and configurations. + +3. **Install Dependencies**: + +Navigate to your project directory: + +.. code-block:: bash + + cd + +Install the required Python packages and dependencies for the project. Typically, you will need to install ROS 2 and MoveIt dependencies. This can often be done with: + +.. code-block:: bash + + rosdep install --from-paths src --ignore-src -r -y + +Ensure that you also have any additional dependencies specified in the project's ``requirements.txt`` or equivalent configuration files. + +4. **Build the Project**: + +Build the project to ensure that all components are correctly compiled: + +.. code-block:: bash + + scripts\o3de.bat build + + +Configurations and launch of the project +---------------------------------------- + +1. **Configure ROS 2 and MoveIt**: + +The template may include configuration files for ROS 2 and MoveIt. Ensure these are properly configured to match your simulation setup. Key files include: + +- **ROS 2 Launch Files**: Typically found in the ``launch`` directory, configure these files to start the ROS 2 nodes required for your simulation. +- **MoveIt Configuration**: Check the ``moveit_config`` directory for MoveIt configuration files. Ensure these files are correctly set up for your robot and planning requirements. + +2. **Launch the Simulation**: + +Start the O3DE Editor: + +.. code-block:: bash + + scripts\o3de.bat Editor + +In the O3DE Editor: + +1. Open the example level provided by the template. Navigate to the ``File`` menu, select ``Open Level``, and choose the example level from the ``Levels`` directory. +2. Launch the ROS 2 nodes and MoveIt components required for the simulation. Typically, this can be done with: + +.. code-block:: bash + + ros2 launch .launch.py + +3. **Simulate Robotic Manipulation**: + +With the simulation running, you can interact with the robotic manipulator in the O3DE Editor. Test different manipulation tasks and adjust configurations as needed. Use the MoveIt interface to plan and execute robotic movements. + +For further details on configuring ROS 2 and MoveIt for your specific needs, refer to the `MoveIt 2 Documentation`_ and the `O3DE Robotics Project Configuration`_ guide. + +.. _MoveIt 2 Documentation: https://moveit.ros.org/documentation/ +.. _O3DE Robotics Project Configuration: https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/project-configuration/ From 5b5d867a2a8c38bf04682f16c49aafd30f86101c Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Wed, 28 Aug 2024 14:27:25 +0200 Subject: [PATCH 6/8] Refactor Signed-off-by: Wiktoria Siekierska --- .../Simulators/O3DE/Installation-Ubuntu.rst | 63 ++++++++++++++----- .../Setting-Up-Simulation-O3DE-Advanced.rst | 24 ++++--- .../O3DE/Setting-Up-Simulation-O3DE-Basic.rst | 24 ++++--- 3 files changed, 78 insertions(+), 33 deletions(-) diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst index 7c2b183fbe1..95ec1aca9bb 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst @@ -59,6 +59,7 @@ This command downloads the O3DE source code into a directory named ``o3de`` and Step 3: Configure the O3DE Project ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. @TODO: Restricted in manifest file Run the ``cmake`` command to configure the project. This will generate the necessary build files in the ``build`` directory. @@ -72,21 +73,18 @@ Here’s what each argument does: - ``-S .``: Specifies the source directory (current directory). - ``-G "Ninja Multi-Config"``: Specifies Ninja as the build system with multi-config support. -Step 4: Build O3DE -^^^^^^^^^^^^^^^^^^ - -Now, build O3DE using the ``cmake`` command: +If you experience any issues regarding the ``restricted.json`` file, try opening the ``o3de_manifest.json``: .. code-block:: bash - cmake --build build/ --config profile + nano ~/.o3de/o3de_manifest.json -This command builds O3DE in ``profile`` mode, which is recommended for development. You can replace ``profile`` with ``debug`` or ``release`` depending on your needs. +then, remove the ``restricted`` list located in the file. -Step 5: Set Up the Project Environment +Step 4: Set Up the Project Environment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Before launching the O3DE Editor, you need to set up the project environment. Run the following script to do so: +Before building the O3DE, you need to set up the project environment. Run the following script to do so: .. code-block:: bash @@ -94,6 +92,18 @@ Before launching the O3DE Editor, you need to set up the project environment. Ru This command registers the engine, allowing you to create and manage projects with O3DE. +Step 5: Build O3DE +^^^^^^^^^^^^^^^^^^ + +Now, build O3DE using the ``cmake`` command: + +.. code-block:: bash + + cmake --build build/ --config profile + +This command builds O3DE in ``profile`` mode, which is recommended for development. You can replace ``profile`` with ``debug`` or ``release`` depending on your needs. + + Step 6: Create or Open a Project ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -137,30 +147,49 @@ To get started, clone the ``o3de-extras`` repository: Setting up o3de-extras ^^^^^^^^^^^^^^^^^^^^^^ -The ``o3de-extras`` repository can be cloned to any location on your local machine. Once cloned, you need to inform O3DE about the location of the extra assets in this repository by registering them. From the O3DE repository folder, you can register some or all of the extra assets using the ``o3de register`` command. Since these are optional assets, you may choose to register only those that you need. For example, to register a specific gem, use the following command: +The ``o3de-extras`` repository can be cloned to any location on your local machine. Once cloned, you need to switch to the ``stablization`` branch of the repository. Run the following command to check on what branch you're working at the moment: + +.. code-block:: bash + + git branch + +If you are on the ``development`` branch, you will need to switch. Run this command to find the name of the latest stabilization branch: + +.. code-block:: bash + + git branch -a + +Now you can ``git checkout`` to our desired branch, for example: + +.. code-block:: bash + + git checkout stabilization/2409 + + +Now, you need to inform O3DE about the location of the extra assets in this repository by registering them. From the O3DE repository folder, you can register some or all of the extra assets using the ``o3de register`` command. Since these are optional assets, you may choose to register only those that you need. For example, to register a specific gem, use the following command: .. code-block:: bash - scripts\o3de.bat register --gem-path /Gems/ + ./scripts/o3de.sh register --gem-path /Gems/ If you want to register all the gems, you can do so since the repository follows the standard O3DE compound repository structure, with all gems located in the ``/Gems`` directory. To register all gems at once, use: .. code-block:: bash - scripts\o3de.bat register --all-gems-path /Gems + ./scripts/o3de.sh register --all-gems-path /Gems This process can be repeated for any other object types, if they exist: .. code-block:: bash - scripts\o3de.bat register --all-engines-path /Engines - scripts\o3de.bat register --all-projects-path /Projects - scripts\o3de.bat register --all-gems-path /Gems - scripts\o3de.bat register --all-templates-path /Templates - scripts\o3de.bat register --all-restricted-path /Restricted + ./scripts/o3de.sh register --all-engines-path /Engines + ./scripts/o3de.sh register --all-projects-path /Projects + ./scripts/o3de.sh register --all-gems-path /Gems + ./scripts/o3de.sh register --all-templates-path /Templates + ./scripts/o3de.sh register --all-restricted-path /Restricted If you've registered a gem, which functions like a plugin or component within a project, and you wish to use it in your project, you need to enable it by using the ``o3de enable-gem`` command: .. code-block:: bash - scripts\o3de.bat enable-gem --gem-name --project-name \ No newline at end of file + ./scripts/o3de.sh enable-gem --gem-name --project-name \ No newline at end of file diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst index b0dad45f8fc..1684e9f0ba9 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst @@ -27,7 +27,7 @@ Ensure you have the following before starting: - O3DE set up on your machine. For instructions, follow the `O3DE installation for Ubuntu ` guide. - ROS 2 (Foxy or later) installed on your system. -- The ``o3de-extras`` repository cloned locally. +- The ``o3de-extras`` repository cloned locally (on the ``stabilization`` branch). - **MoveIt**, which is used for motion planning in ROS 2. Follow the MoveIt 2 documentation for installation instructions. @@ -42,7 +42,7 @@ From the root directory of your O3DE installation, run: .. code-block:: bash - scripts\o3de.bat register --all-templates-path /Templates + ./scripts/o3de.sh register --all-templates-path /Templates This command registers all templates in the ``o3de-extras`` repository, including the Robotic Manipulation Template. @@ -52,7 +52,7 @@ Create a new project using the ROS 2 Robotic Manipulation Template: .. code-block:: bash - scripts\o3de.bat create-project --project-name --template-name Ros2RoboticManipulationTemplate + ./scripts/o3de.sh create-project --project-name --template-name Ros2RoboticManipulationTemplate --project-path This will generate a new project directory with the necessary files and configurations. @@ -62,23 +62,29 @@ Navigate to your project directory: .. code-block:: bash - cd + cd Install the required Python packages and dependencies for the project. Typically, you will need to install ROS 2 and MoveIt dependencies. This can often be done with: .. code-block:: bash - rosdep install --from-paths src --ignore-src -r -y + sudo apt install ros-${ROS_DISTRO}-moveit ros-${ROS_DISTRO}-moveit-resources ros-${ROS_DISTRO}-depth-image-proc Ensure that you also have any additional dependencies specified in the project's ``requirements.txt`` or equivalent configuration files. -4. **Build the Project**: +4. **Configure and build the Project**: -Build the project to ensure that all components are correctly compiled: +After installing dependencies, cofigure and build the project using the following commands: .. code-block:: bash - scripts\o3de.bat build + cmake -B build/ -S . -G "Ninja Multi-Config" + +.. code-block:: bash + + cmake --build --target Editor + +Ensure the build completes without errors. Configurations and launch of the project @@ -97,7 +103,7 @@ Start the O3DE Editor: .. code-block:: bash - scripts\o3de.bat Editor + /build/bin/profile/Editor In the O3DE Editor: diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst index dfbec17515d..29eeff11259 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Basic.rst @@ -33,7 +33,7 @@ Before you begin, ensure that you have the following installed: - O3DE set up on your machine. For instructions, follow the `O3DE installation for Ubuntu ` guide. - ROS 2 (Foxy or later) installed on your system. -- The ``o3de-extras`` repository cloned locally. +- The ``o3de-extras`` repository cloned locally (on the ``stabilization`` branch). Creating a New ROS 2 Project @@ -45,7 +45,7 @@ Creating a New ROS 2 Project .. code-block:: bash - scripts\o3de.bat register --all-templates-path \Templates + ./scripts/o3de.sh register --all-templates-path /Templates This command registers all templates within the ``o3de-extras`` repository, including the ROS 2 Project Template. @@ -55,13 +55,23 @@ Creating a New ROS 2 Project .. code-block:: bash - scripts\o3de.bat create-project --project-name --template-name Ros2ProjectTemplate --project-path + ./scripts/o3de.sh create-project --project-name --template-name Ros2ProjectTemplate --project-path Replace ```` with your desired project name and ```` with the directory where you want the project to be created. -3. **Build the Project**: +3. **Configure and build the Project**: - After creating the project, build it using the following command: + After creating the project, you need to cofigure and build it: + + Navigate to your project directory: + + .. code-block:: bash + + cd + + .. code-block:: bash + + cmake -B build/ -S . -G "Ninja Multi-Config" .. code-block:: bash @@ -80,7 +90,7 @@ The ROS 2 Project Template includes several example projects. In this tutorial, .. code-block:: bash - \Gems\ROS2\Examples\slam_navigation + /Examples/slam_navigation 2. **Run the Example**: @@ -88,7 +98,7 @@ The ROS 2 Project Template includes several example projects. In this tutorial, .. code-block:: bash - \scripts\o3de.bat Editor + /build/bin/profile/Editor Once in the Editor, open the SLAM navigation level by navigating to the ``Levels`` tab and selecting the SLAM navigation level. From 26dfc8d38f41a5cb869a5d2927e559c2ce81c133 Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Wed, 28 Aug 2024 15:24:45 +0200 Subject: [PATCH 7/8] Refactor Signed-off-by: Wiktoria Siekierska --- .../O3DE/Setting-Up-Simulation-O3DE-Advanced.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst index 1684e9f0ba9..03e1dca49a7 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Setting-Up-Simulation-O3DE-Advanced.rst @@ -108,11 +108,19 @@ Start the O3DE Editor: In the O3DE Editor: 1. Open the example level provided by the template. Navigate to the ``File`` menu, select ``Open Level``, and choose the example level from the ``Levels`` directory. -2. Launch the ROS 2 nodes and MoveIt components required for the simulation. Typically, this can be done with: +2. Launch the ROS 2 nodes and MoveIt components required for the simulation. For manipulation, this can be done with: .. code-block:: bash - ros2 launch .launch.py + ros2 launch Examples/panda_moveit_config_demo.launch.py + +And for the palletization try: + +.. code-block:: bash + + source install/setup.bash + ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur10 use_sim_time:=true use_fake_hardware:=true + 3. **Simulate Robotic Manipulation**: From 0944d62153867a307cbb1ed9fbacbb383c9ce1bd Mon Sep 17 00:00:00 2001 From: Wiktoria Siekierska Date: Fri, 13 Sep 2024 17:08:01 +0200 Subject: [PATCH 8/8] Downloading o3de-extras from .zip package and launching basic simulation Signed-off-by: Wiktoria Siekierska --- .../Simulators/O3DE/Installation-Ubuntu.rst | 147 +++++++++++------- 1 file changed, 89 insertions(+), 58 deletions(-) diff --git a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst index 95ec1aca9bb..f875c5ee732 100644 --- a/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst +++ b/source/Tutorials/Advanced/Simulators/O3DE/Installation-Ubuntu.rst @@ -1,11 +1,11 @@ Installation (Ubuntu) ====================================== -**Goal:** Install the package and run simulation examples on Ubuntu. +**Goal:** Install Open 3D Engine (O3DE) from the .deb package and run a simulation using the O3DE-extras template. **Tutorial level:** Advanced -**Time:** 15 minutes +**Time:** 20-30 minutes .. contents:: Contents :depth: 2 @@ -14,7 +14,7 @@ Installation (Ubuntu) Background ------------- -This tutorial will guide you through the steps to set up Open 3D Engine (O3DE) directly from the GitHub repository on a Linux system. This guide assumes you are not creating a fork of the repository. +This tutorial will guide you through the steps to install Open 3D Engine (O3DE) from a .deb package and set up the O3DE-extras package for simulation on Ubuntu. The guide minimizes terminal use and focuses on GUI-based steps where possible. Prerequisites ------------- @@ -22,17 +22,13 @@ Prerequisites It is recommended to understand basic ROS principles covered in the beginner :doc:`../../../../Tutorials`. In particular, :doc:`../../../Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace` and :doc:`../../../Beginner-Client-Libraries/Creating-Your-First-ROS2-Package` are useful prerequisites. -Before you begin, ensure you have the following installed on your Linux system: - -- **Git**: To clone the O3DE repository. -- **CMake (version 3.20 or later)**: For building the project. -- **Ninja or Make**: Build systems supported by O3DE. -- **Python (version 3.7 or later)**: Required for various scripts. -- **Clang (version 12 or later)**: The recommended compiler for O3DE. +Before you begin, ensure you have the following: +- **ROS 2 installed**: The o3de-extras package assumes that ROS 2 is already installed on your system. Setting up O3DE from GitHub on Linux ------------------------------------ + Step 1: Install Required Dependencies ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -104,92 +100,127 @@ Now, build O3DE using the ``cmake`` command: This command builds O3DE in ``profile`` mode, which is recommended for development. You can replace ``profile`` with ``debug`` or ``release`` depending on your needs. -Step 6: Create or Open a Project -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Download and Install o3de-extras +---------------------------------- -With O3DE set up, you can create a new project or open an existing one. -To create a new project: +Downloading a .zip package +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: bash + 1. Navigate to the `o3de-extras GitHub repository `_. + 2. Download the necessary files as a ZIP package. To do this, click the **Code** button on the repository's main page and select **Download ZIP**. + 3. Once the ZIP file is downloaded, extract its contents to a folder of your choice. - ./scripts/o3de.sh create-project --project-path --template Default -Replace ```` with the desired directory for your new project. +Setting up o3de-extras +^^^^^^^^^^^^^^^^^^^^^^ -To open an existing project, navigate to the project directory and use the following command: +Now, you need to inform O3DE about the location of the extra assets in this repository by registering them. From the O3DE repository folder, you can register some or all of the extra assets using the ``o3de register`` command. Since these are optional assets, you may choose to register only those that you need. For example, to register a specific gem, use the following command: .. code-block:: bash - ./scripts/o3de.sh edit-project --project-path - -Step 7: Launch the O3DE Editor -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ./scripts/o3de.sh register --gem-path /Gems/ -Finally, launch the O3DE Editor by running: +If you want to register all the gems, you can do so since the repository follows the standard O3DE compound repository structure, with all gems located in the ``/Gems`` directory. To register all gems at once, use: .. code-block:: bash - ./build/bin/profile/Editor + ./scripts/o3de.sh register --all-gems-path /Gems -This command starts the O3DE Editor in ``profile`` mode. +This process can be repeated for any other object types, if they exist: +.. code-block:: bash -Install ``o3de-extras`` ------------------------ + ./scripts/o3de.sh register --all-engines-path /Engines + ./scripts/o3de.sh register --all-projects-path /Projects + ./scripts/o3de.sh register --all-gems-path /Gems + ./scripts/o3de.sh register --all-templates-path /Templates + ./scripts/o3de.sh register --all-restricted-path /Restricted -Clone the Repository -^^^^^^^^^^^^^^^^^^^^ -To get started, clone the ``o3de-extras`` repository: +If you've registered a gem, which functions like a plugin or component within a project, and you wish to use it in your project, you need to enable it by using the ``o3de enable-gem`` command: .. code-block:: bash - git clone https://github.com/o3de/o3de-extras + ./scripts/o3de.sh enable-gem --gem-name --project-name -Setting up o3de-extras -^^^^^^^^^^^^^^^^^^^^^^ -The ``o3de-extras`` repository can be cloned to any location on your local machine. Once cloned, you need to switch to the ``stablization`` branch of the repository. Run the following command to check on what branch you're working at the moment: -.. code-block:: bash +Setting Up and Running a Simulation +------------------------------------ - git branch +Creating a New ROS 2 Project +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you are on the ``development`` branch, you will need to switch. Run this command to find the name of the latest stabilization branch: +1. **Register the ROS 2 Project Template**: -.. code-block:: bash + Navigate to your O3DE directory and register the ROS 2 Project Template from the ``o3de-extras`` repository: - git branch -a + .. code-block:: bash -Now you can ``git checkout`` to our desired branch, for example: + ./scripts/o3de.sh register --all-templates-path /Templates -.. code-block:: bash + This command registers all templates within the ``o3de-extras`` repository, including the ROS 2 Project Template. - git checkout stabilization/2409 +2. **Create a New Project**: + Create a new project using the ROS 2 Project Template: -Now, you need to inform O3DE about the location of the extra assets in this repository by registering them. From the O3DE repository folder, you can register some or all of the extra assets using the ``o3de register`` command. Since these are optional assets, you may choose to register only those that you need. For example, to register a specific gem, use the following command: + .. code-block:: bash -.. code-block:: bash + ./scripts/o3de.sh create-project --project-name --template-name Ros2ProjectTemplate --project-path - ./scripts/o3de.sh register --gem-path /Gems/ + Replace ```` with your desired project name and ```` with the directory where you want the project to be created. -If you want to register all the gems, you can do so since the repository follows the standard O3DE compound repository structure, with all gems located in the ``/Gems`` directory. To register all gems at once, use: +3. **Configure and build the Project**: -.. code-block:: bash + After creating the project, you need to cofigure and build it: - ./scripts/o3de.sh register --all-gems-path /Gems + Navigate to your project directory: -This process can be repeated for any other object types, if they exist: + .. code-block:: bash -.. code-block:: bash + cd - ./scripts/o3de.sh register --all-engines-path /Engines - ./scripts/o3de.sh register --all-projects-path /Projects - ./scripts/o3de.sh register --all-gems-path /Gems - ./scripts/o3de.sh register --all-templates-path /Templates - ./scripts/o3de.sh register --all-restricted-path /Restricted + .. code-block:: bash -If you've registered a gem, which functions like a plugin or component within a project, and you wish to use it in your project, you need to enable it by using the ``o3de enable-gem`` command: + cmake -B build/ -S . -G "Ninja Multi-Config" -.. code-block:: bash + .. code-block:: bash + + cmake --build --target Editor + + Ensure the build completes without errors. + +Setting Up the SLAM Navigation Example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ROS 2 Project Template includes several example projects. In this tutorial, you will use the SLAM navigation example to simulate a robot performing SLAM and navigation tasks. + +1. **Navigate to the Example Directory**: + + The SLAM navigation example is located in the following directory: + + .. code-block:: bash + + /Examples/slam_navigation + +2. **Run the Example**: + + Launch the example by opening the O3DE Editor: + + .. code-block:: bash + + /build/bin/profile/Editor + + Once in the Editor, open the SLAM navigation level by navigating to the ``Levels`` tab and selecting the SLAM navigation level. + + Press ``Ctrl+G`` to start the simulation. + +3. **Launching ROS 2 Nodes**: + + In a new terminal, source your ROS 2 environment and launch the ROS 2 nodes required for SLAM and navigation: + + .. code-block:: bash + + source /opt/ros/foxy/setup.bash + ros2 launch slam_navigation slam_navigation_launch.py - ./scripts/o3de.sh enable-gem --gem-name --project-name \ No newline at end of file + This command starts the ROS 2 nodes, enabling the robot in the simulation to perform SLAM and navigation.