Quellcode durchsuchen

Stabilization -> development (#323)

* Adjust intro page (#310)

Signed-off-by: Michał Pełka <[email protected]>

* Templates instructions updated (#304)

Signed-off-by: Adam Dabrowski <[email protected]>

* make folder match the level name (#308)

* level name and containing folder must match to allow loading level by
  name

Signed-off-by: Mateusz Żak <[email protected]>

---------

Signed-off-by: Michał Pełka <[email protected]>
Signed-off-by: Adam Dabrowski <[email protected]>
Signed-off-by: Mateusz Żak <[email protected]>
Co-authored-by: Michał Pełka <[email protected]>
Co-authored-by: Mateusz Żak <[email protected]>
Adam Dąbrowski vor 2 Jahren
Ursprung
Commit
609cb88561

+ 2 - 0
.gitattributes

@@ -127,3 +127,5 @@ Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/.wip/Brass/brass_bake.
 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/.wip/stone/stone_bake.spp filter=lfs diff=lfs merge=lfs -text
 Gems/WarehouseAssets/docs/images/*.png filter= diff= merge= -text
 Gems/ROS2/docs/**/*.png -filter -diff -merge
+Templates/Ros2ProjectTemplate/Screenshots/*.png filter= diff= merge= -text
+Templates/Ros2FleetRobotTemplate/Screenshots/*.png filter= diff= merge= -text

+ 10 - 10
Gems/ROS2/Code/Source/RobotImporter/Pages/IntroPage.cpp

@@ -16,16 +16,16 @@ namespace ROS2
     {
         setTitle(QObject::tr("Introduction"));
 
-        m_label = new QLabel(QObject::tr("This wizard allows you to build a robot prefab out of URDF description file."
-                                         " Before processing, please, make sure that all necessary assets that are"
-                                         " used by URDF file are processed by Asset Processor."
-                                         " Open 3D Engine can only use files in its internal"
-                                         " <a href=\"https://www.o3de.org/docs/user-guide/assets/asset-types/\">format</a>."
-                                         " The tool (Asset Processor) allows processing source assets (e.g, meshes, textures)"
-                                         " to its supported internal format. To learn more about asset processors click"
-                                         " <a href=\"https://www.o3de.org/docs/user-guide/assets/asset-processor/\">here</a>."
-                                         " URDF Importer will find correct meshes in product assets during import."
-                                         " A level must be opened before using URDF Importer."));
+        m_label = new QLabel(
+            QObject::tr("This wizard allows you to build a robot prefab using a URDF description file."
+                        " Before processing, please make sure that all of the robot's description packages have been built and sourced."
+                        " Details can be found <a "
+                        "href=\"https://www.o3de.org/docs/user-guide/interactivity/robotics/importing-robot/"
+                        "#loading-the-robot-definition-file-with-robot-importer\">here</a>."
+                        " The Open 3D Engine can only use files in its internal <a "
+                        "href=\"https://www.o3de.org/docs/user-guide/assets/asset-types/\">format</a>."
+                        "During the import process, the assets will be imported and processed."
+                        "A level must be opened before using the URDF Importer."));
         m_label->setTextFormat(Qt::RichText);
         m_label->setOpenExternalLinks(true);
         m_label->setWordWrap(true);

+ 18 - 111
Templates/Ros2FleetRobotTemplate/README.md

@@ -1,112 +1,27 @@
-# ROS2 and O3DE - Fleet Robot Template (Warehouse)
+# ROS2 Fleet Template
 
-### Summary 
-A project template that allows building a multi-robot ROS2-enabled simulation. The template contains a level with a large warehouse scene called `Warehouse.prefab`. 
+Welcome to Robotic Simulation Fleet template for ROS 2 projects!
+This project is a template designed to help you quickly start simulating robots in Open 3D Engine (O3DE) with Robot Operating System (ROS) 2.
 
-### Demo video
-https://user-images.githubusercontent.com/82551958/229633488-21d6bfa4-3326-43df-8655-2d1b551af9ae.mp4
+This template focuses on use-cases with multiple robots in environments such as warehouses and fulfillment centers.
+The warehouse assets used in the template are modular and well-suited for reconfiguration to match a custom warehouse.
+If your simulation does not match this and you would like to start with a simple and versatile template, consider using a more generic template:
+- [ROS 2 Project Template](https://github.com/o3de/o3de-extras/tree/development/Templates/Ros2ProjectTemplate).
 
+![Template picture](Screenshots/fleet_template.png)
 
-## Requirements
+## Set up a new project with the template
 
-Due to ROS2 dependency, this project was prepared and tested on Linux operating system. It is recomended to use Ubuntu [22.04](https://www.releases.ubuntu.com/22.04/), however any distribution meeting following requirements may be used.
-
-Refer to the [O3DE System Requirements](https://www.o3de.org/docs/welcome-guide/requirements/) documentation to make sure that the system/hardware requirements are met. 
-This project has the following dependencies:
-
-- [O3DE](https://github.com/o3de/o3de)
-- [ROS2 Humble](https://docs.ros.org/en/humble/index.html)
-- [ROS2 Gem](https://github.com/o3de/o3de-extras/tree/development/Gems/ROS2)
-- [Proteus robot](https://github.com/o3de/o3de-extras/tree/development/Gems/ProteusRobot)
-- [WarehouseAssets](https://github.com/o3de/o3de-extras/tree/development/Gems/WarehouseAssets)
-
-Please make sure that `clang` was installed and configured. For details refer to [this section](https://www.o3de.org/docs/welcome-guide/requirements/#linux) of O3DE documentation.
-
-## Setup Instructions
-
-The following steps will assume the following:
-
-- You have ROS2 Humble [installed](https://docs.ros.org/en/humble/Installation.html) and environment is [sourced](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files).
-- The O3DE gems, projects and templates will be placed in the O3DE home folder: `${HOME}/O3DE`.
-- You have the O3DE engine [downloaded and built](https://www.o3de.org/docs/welcome-guide/setup/setup-from-github) and it is located in `/home/${USER}/O3DE/Engines/Development`.
-
-In this tutorial, CLI tools will be used. It is also possible to use O3DE GUI to set up a project from template. See the [O3DE Project manager documentation](https://www.o3de.org/docs/user-guide/project-config/project-manager/) for more details. In such cases it is required to source your ROS2 distribution before launching O3DE manager:
-
-```shell
-source /opt/ros/humble/setup.bash
-./build/linux/bin/profile/o3de
-```
-
-### 1. Install ROS2 packages
-
-```shell
-sudo apt install ros-${ROS_DISTRO}-ackermann-msgs ros-${ROS_DISTRO}-gazebo-msgs ros-${ROS_DISTRO}-control-toolbox
-```
-
-### 2. Download the template and asset gems
-
-For convenienience, we'll define a shell variables with O3DE folders:
-
-```shell
-export O3DE_HOME=${HOME}/O3DE
-```
-
-Clone the `o3de-extras` repository containing the template and asset gems
-
-```shell
-mkdir -p ${O3DE_HOME}/Projects
-cd ${O3DE_HOME}/Projects
-git clone https://github.com/o3de/o3de-extras.git 
-cd o3de-extras 
-git lfs install && git lfs pull
-```
-
-
-Register gems and project template.
-
-```shell
-${O3DE_HOME}/scripts/o3de.sh register --gem-path ${O3DE_HOME}/Projects/o3de-extras/Gems/ROS2
-${O3DE_HOME}/scripts/o3de.sh register --gem-path ${O3DE_HOME}/Projects/o3de-extras/Gems/WarehouseAssets
-${O3DE_HOME}/scripts/o3de.sh register --gem-path ${O3DE_HOME}/Projects/o3de-extras/Gems/ProteusRobot
-${O3DE_HOME}/scripts/o3de.sh register --template-path ${O3DE_HOME}/Projects/o3de-extras/Templates/Ros2FleetRobotTemplate
-```
-
-### 3. Create a ROS2 project from the template
-
-Assign a name for the new project. In this example, it is assumed that it will be: `Ros2FleetRobotTest`, and it will be located in `${O3DE_HOME}/Projects/Ros2FleetRobotTest` folder. 
-
-```shell
-export PROJECT_NAME=Ros2FleetRobotTest
-export PROJECT_PATH=${O3DE_HOME}/Projects/${PROJECT_NAME}
-${O3DE_HOME}/scripts/o3de.sh create-project --project-path $PROJECT_PATH --template-name Ros2FleetRobotTemplate
-```
-
-### 4. Build the project
-
-Next, let us build the project with necessary elements of the O3DE engine and ROS2 Gem.
-
-```shell
-cd $PROJECT_PATH
-source /opt/ros/humble/setup.bash
-cmake -B build/linux -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON
-cmake --build build/linux --config profile --target $PROJECT_NAME.GameLauncher Editor
-```
-
-### 5. Launch Editor
-
-Finally, the O3DE with preloaded gems can be run:
-
-```shell
-$PROJECT_PATH/build/linux/bin/profile/Editor
-```
+Please follow the instructions in [ROS 2 Gem documentation](https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/project-configuration/)
+to install all required dependencies and create your project with a template (make sure to use chose this template during the process).
 
 ## Spawning robots
 
-The level contains spawn points configured to spawn Proteus robots.
-To spawn all spawn points call the following services in ROS2:
+The level contains spawn points configured to easily add more Proteus robots through ROS 2 calls.
+This is done with the [Spawner Component](https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/concepts-and-components-overview/#spawner).
+There are 4 spawn points already added in the level. You can use them all with the following service calls:
 
 ```shell
-source /opt/ros/humble/setup.bash
 ros2 service call /spawn_entity gazebo_msgs/srv/SpawnEntity '{name: 'proteus', xml: 'spawnPoint1'}'& \
 ros2 service call /spawn_entity gazebo_msgs/srv/SpawnEntity '{name: 'proteus', xml: 'spawnPoint2'}'& \
 ros2 service call /spawn_entity gazebo_msgs/srv/SpawnEntity '{name: 'proteus', xml: 'spawnPoint3'}'& \
@@ -115,11 +30,10 @@ ros2 service call /spawn_entity gazebo_msgs/srv/SpawnEntity '{name: 'proteus', x
 
 ## Topics and frames
 
-Every spawned robot has its namespace.
-The first spawned robot publishes and subscribes to topics:
+Every spawned robot will have its own namespace for all topics. For the first robot, these will be:
 
-- `/proteus_1/cmd_vel` - the requested velocity
-- `/proteus_1/pc` - the LiDAR pointcloud
+- `/proteus_1/cmd_vel`: The topic to [control the robot](https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/concepts-and-components-overview/#robot-control).
+- `/proteus_1/pc` - The topic of simulated LIDAR point cloud.
 
 The first spawned robot also provides the following transformations:
 
@@ -127,11 +41,4 @@ The first spawned robot also provides the following transformations:
 - `/proteus_1/base_link`
 - `/proteus_1/lidar`
 
-### Example
-
-To drive the second spawned robot use the following tool with topic name `/proteus_2/cmd_vel`:
-
-```shell
-source /opt/ros/humble/setup.bash
-ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap /cmd_vel:=/proteus_2/cmd_vel
-```
+To understand more about transformations, see ROS 2 navigation [documentation](https://navigation.ros.org/setup_guides/transformation/setup_transforms.html).

BIN
Templates/Ros2FleetRobotTemplate/Screenshots/fleet_template.png


+ 0 - 0
Templates/Ros2FleetRobotTemplate/Template/Levels/WarehouseScene/Warehouse.prefab → Templates/Ros2FleetRobotTemplate/Template/Levels/Warehouse/Warehouse.prefab


+ 1 - 1
Templates/Ros2FleetRobotTemplate/Template/autoexec.cfg

@@ -1 +1 @@
-LoadLevel levels/warehousescene/warehouse.spawnable
+LoadLevel levels/warehouse/warehouse.spawnable

+ 2 - 2
Templates/Ros2FleetRobotTemplate/template.json

@@ -100,7 +100,7 @@
             "isTemplated": true
         },
         {
-            "file": "Levels/WarehouseScene/Warehouse.prefab",
+            "file": "Levels/Warehouse/Warehouse.prefab",
             "isTemplated": false
         },
         {
@@ -302,7 +302,7 @@
             "dir": "Levels"
         },
         {
-            "dir": "Levels/WarehouseScene"
+            "dir": "Levels/Warehouse"
         },
         {
             "dir": "Levels/playground"

+ 14 - 112
Templates/Ros2ProjectTemplate/README.md

@@ -1,120 +1,22 @@
-# ROS2 Project Template
+# Robotic Simulation Project Template for ROS 2
 
-This template allows to create a ROS2 project with sample content. 
+Welcome to Robotic Simulation template for ROS 2 projects! 
+This project is a template designed to help you quickly start simulating robots in Open 3D Engine (O3DE) with Robot Operating System (ROS) 2.
 
-The example ROS2 navigation stack launchfile is bundled with the template.
+An example ROS2 navigation stack launch file is bundled with the template.
 
-## Requirements
+This template focuses on ease of use and versatility.
+If you have a use-case more similar to fleets of robots in a fulfillment center, there is another template that might fit you better:
+- [ROS 2 Fleet Template](https://github.com/o3de/o3de-extras/tree/development/Templates/Ros2FleetRobotTemplate).
 
-Due to ROS2 dependency, this project was prepared and tested on Linux operating system. It is recomended to use Ubuntu [20.04](https://releases.ubuntu.com/focal) or [22.10](https://releases.ubuntu.com/kinetic), however any distribution meeting following requirements may be used.
+![Template picture](Screenshots/template_in_use.png)
 
-Refer to the [O3DE System Requirements](https://www.o3de.org/docs/welcome-guide/requirements/) documentation to make sure that the system/hardware requirements are met. 
-This project has the following dependencies:
+## Set up a new project with the template
 
-- [O3DE](https://github.com/o3de/o3de)
-- [ROS2](https://www.ros.org/) (galactic or humble)
-- [ROS2 Gem](https://github.com/o3de/o3de-extras/tree/development/Gems/ROS2)
-- [RosRobotSample Assets](https://github.com/o3de/o3de-extras/tree/development/Gems/RosRobotSample)
-- [WarehouseSample Assets](https://github.com/o3de/o3de-extras/tree/development/Gems/WarehouseSample)
+Please follow the instructions in [ROS 2 Gem documentation](https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/project-configuration/)
+to install all required dependencies and create your project with a template (make sure to use chose this template during the process).
 
-Please make sure that `clang` was installed and configured. For details refer to [this section](https://www.o3de.org/docs/welcome-guide/requirements/#linux) of O3DE documentation.
+## ROS integration example
 
-To run the navigation example, two ROS2 packages are also required:
-- [navigation2](https://github.com/ros-planning/navigation2)
-- [slam_toolbox](https://github.com/SteveMacenski/slam_toolbox)
-
-## Setup Instructions
-
-The following steps will assume the following:
-
-- You have ROS2 humble [installed](https://docs.ros.org/en/humble/Installation.html) and environment is [sourced](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files).
-- The O3DE gems, projects and templates will be placed in the O3DE home folder: `/home/${USER}/O3DE`.
-- You have the O3DE engine [downloaded and built](https://www.o3de.org/docs/welcome-guide/setup/setup-from-github) and it is located in `/home/${USER}/O3DE/Engines/Development`.
-
-In this tutorial, CLI tools will be used. It is also possible to use O3DE gui to set up a project from template. See the [O3DE Project manager documentation](https://www.o3de.org/docs/user-guide/project-config/project-manager/) for more details. In such case it is required to source your ROS2 distro before launching O3DE manager:
-
-```shell
-source /opt/ros/humble/setup.bash
-./build/linux/bin/profile/o3de
-```
-
-### 1. Install ROS2 packages
-
-```shell
-sudo apt install ros-${ROS_DISTRO}-ackermann-msgs ros-${ROS_DISTRO}-gazebo-msgs ros-${ROS_DISTRO}-control-toolbox
-```
-
-### 2. Download the template and asset gems
-
-For convenienience, we'll define a shell variables with o3de folders:
-
-```shell
-export O3DE_HOME=/home/${USER}/O3DE
-export O3DE_ENGINE=${O3DE_HOME}/Engines/Development
-```
-
-Clone the `o3de-extras` repository containing the template and asset gems
-
-```shell
-mkdir -p ${O3DE_HOME}/Projects
-cd ${O3DE_HOME}/Projects
-git clone [email protected]:o3de/o3de-extras.git
-```
-
-Copy gems to the O3DE home.
-
-```shell
-mkdir -p ${O3DE_HOME}/Gems
-cp o3de-extras/Gems/ROS2 ${O3DE_HOME}/Gems
-cp o3de-extras/Gems/WarehouseSample ${O3DE_HOME}/Gems
-cp o3de-extras/Gems/RosRobotSample ${O3DE_HOME}/Gems
-```
-
-Register these gems.
-
-```shell
-${O3DE_ENGINE}/scripts/o3de.sh register --gem-path ${O3DE_HOME}/Gems/ROS2
-${O3DE_ENGINE}/scripts/o3de.sh register --gem-path ${O3DE_HOME}/Gems/WarehouseSample
-${O3DE_ENGINE}/scripts/o3de.sh register --gem-path ${O3DE_HOME}/Gems/RosRobotSample
-```
-
-### 3. Create a ROS2 project from the template
-
-Assign a name for the new project. In this example, it is assumed that it will be: `WarehouseTest`, and it will be located in `$DEMO_BASE/WarehouseTest` folder. 
-
-```shell
-export PROJECT_NAME=WarehouseTest
-export PROJECT_PATH=${O3DE_HOME}/Projects/${PROJECT_NAME}
-${O3DE_ENGINE}/scripts/o3de.sh create-project --project-path $PROJECT_PATH --template-path ${O3DE_HOME}/Projects/o3de-extras/Templates/Ros2ProjectTemplate/ -f 
-```
-
-Enable gems.
-
-```shell
-${O3DE_ENGINE}/scripts/o3de.sh enable-gem --gem-name ROS2 --project-path $PROJECT_PATH
-${O3DE_ENGINE}/scripts/o3de.sh enable-gem --gem-name WarehouseSample --project-path $PROJECT_PATH
-${O3DE_ENGINE}/scripts/o3de.sh enable-gem --gem-name RosRobotSample --project-path $PROJECT_PATH
-```
-
-### 4. Build the project
-
-Next, let us the build project with the necessary elements of the O3DE engine and ROS2 Gem.
-
-```shell
-cd $PROJECT_PATH
-source /opt/ros/humble/setup.bash
-cmake -B build/linux -G "Ninja Multi-Config" -DLY_UNITY_BUILD=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLY_PARALLEL_LINK_JOBS=16 -DLY_STRIP_DEBUG_SYMBOLS=OFF
-cmake --build build/linux --config profile --target $PROJECT_NAME.GameLauncher Editor
-```
-
-### 5. Launch Editor
-
-Finally, previously built O3DE with preloaded ROS2 Gem can be run:
-
-```shell
-$PROJECT_PATH/build/linux/bin/profile/Editor
-```
-
-## Running ROS example
-
-Refer to `$PROJECT_PATH/Examples/slam_navigation/README.md` for instructions.
+You can try out an example of ROS integration with the navigation stack.
+Follow the [instructions](https://github.com/o3de/o3de-extras/tree/development/Templates/Ros2ProjectTemplate/Template/Examples/slam_navigation/README.md) to navigate your robot with ROS 2!

BIN
Templates/Ros2ProjectTemplate/Screenshots/template_in_use.png


+ 23 - 16
Templates/Ros2ProjectTemplate/Template/Examples/slam_navigation/README.md

@@ -1,31 +1,38 @@
-# ROS2 Project navigation example
+# ROS 2 Project example
 
-To run the navigation example with your project:
+With this example you will learn how to run ROS 2 navigation with a project created with this template.
 
-1. Make sure you have all `Ros2ProjectTemplate` requirements installed (see template README.md)
+These instructions assume that you have created and built your project following the [Template README](https://github.com/o3de/o3de-extras/tree/development/Templates/Ros2ProjectTemplate/README.md).
 
-1. Make sure your project is based on `Ros2ProjectTemplate`
+[ROS 2 navigation stack](https://navigation.ros.org/) is a set of packages which can deliver robot navigation almost out of the box following configuration for your specific robot.
+In other cases, it can serve as a great basis to build your custom robot navigation.
+
+## How to run the example
+
+### Install navigation packages
+
+To run the navigation example with your project, you need to install ROS 2 navigation stack packages.
 
-1. Install ROS2 packages:
 ```shell
-sudo apt install ros-${ROS_DISTRO}-slam-toolbox ros-${ROS_DISTRO}-navigation2 ros-${ROS_DISTRO}-nav2-bringup ros-${ROS_DISTRO}-pointcloud-to-laserscan ros-${ROS_DISTRO}-teleop-twist-keyboard
+sudo apt install ros-${ROS_DISTRO}-slam-toolbox ros-${ROS_DISTRO}-navigation2 ros-${ROS_DISTRO}-nav2-bringup ros-${ROS_DISTRO}-pointcloud-to-laserscan
 ```
 
-1. Run your project in O3DE editor
-
-1. Open `DemoLevel`
+### Start the simulation 
 
+1. Run your project in O3DE editor and open the only level.
 1. Start the simulation by clicking the `Play Game` button or pressing `CTRL+G`
 
-1. Source ROS2 (humble version is assumed):
-```shell
-. /opt/ros/humble/setup.bash
-```
+### Launch the navigation stack
+
+Open a bash console terminal (always make sure your [ROS 2 is sourced](https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/project-configuration/#ros-2-ecosystem)!) and run:
 
-1. Start navigation stack:
 ```shell
-cd examples/slam_navigation/launch
+cd #{O3DE_EXTRAS_HOME}/Templates/Ros2ProjectTemplate/Template/Examples/slam_navigation/launch
 ros2 launch navigation.launch.py
 ```
+You should see RViz2, a ROS 2 visualisation tool.
+
+### Set the goal 
 
-1. Set robot target goal. Use RViz2 GUI to set the goal by using the `2D Goal Pose` tool (upper toolbar).
+In RViz2, set robot target goal by using the `2D Goal Pose` tool (upper toolbar). 
+The robot in your simulation should be on its way to the goal! You will also notice it is building a map.