Nav apraksta

Adam Dabrowski 9b5901f872 Turtlebot4 example for the importer (to be moved to a separate gem) 3 gadi atpakaļ
.github d500ea05b6 Add DCO config 2 gadi atpakaļ
Assets 9b5901f872 Turtlebot4 example for the importer (to be moved to a separate gem) 2 gadi atpakaļ
Config 9e5c7c7eb6 Initial project commit 2 gadi atpakaļ
Gem 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
Levels 7a3c9ee7a0 renamed robot vacuum 2 gadi atpakaļ
LightingPresets 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
Platform 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
ReflectionProbes 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
Registry f485d1c995 Added setreg patch file to update 'AssetStreamingImagePoolSize' to accommodate Loft scene 2 gadi atpakaļ
Resources 9e5c7c7eb6 Initial project commit 2 gadi atpakaļ
ShaderLib 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
Shaders 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
cmake 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
launch 84a5ac70ac Tweaked nav params and robot position 2 gadi atpakaļ
.gitattributes 30b75305f0 Initial commit 2 gadi atpakaļ
.gitignore 25ba27a1c9 Robot prefab update, navigation launchfiles 2 gadi atpakaļ
.lfsconfig 30b75305f0 Initial commit 2 gadi atpakaļ
CMakeLists.txt 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
CODE_OF_CONDUCT.md 30b75305f0 Initial commit 2 gadi atpakaļ
CONTRIBUTING.md 30b75305f0 Initial commit 2 gadi atpakaļ
LICENSE 03e9cca2e2 Initial commit 2 gadi atpakaļ
LICENSE.txt 30b75305f0 Initial commit 2 gadi atpakaļ
LICENSE_APACHE2.TXT 30b75305f0 Initial commit 2 gadi atpakaļ
LICENSE_MIT.TXT 30b75305f0 Initial commit 2 gadi atpakaļ
README.md d891daea93 o3de commit hash updated after GEMs camera API update (#9) 2 gadi atpakaļ
SurfaceTypeMaterialLibrary.physmaterial 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
autoexec.cfg 9e5c7c7eb6 Initial project commit 2 gadi atpakaļ
build.sh 7a7ff15b5e Updates to models for navigation. Handy build script 2 gadi atpakaļ
dev_notes.md babbb8d626 diagonal inertia in rigid body notice 2 gadi atpakaļ
game.cfg 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
preview.png 9e5c7c7eb6 Initial project commit 2 gadi atpakaļ
project.json 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
surface_tags.surfaceTagNameList 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
user.cfg 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ

README.md

RobotVacuumSample

This project demonstrates how ROS2 Gem for O3DE can be used with a scene (The Loft project) and ROS 2 navigation stack.

image

Requirements

This project will only run on Ubuntu 20.04 since the ROS 2 Gem is not yet developed for Windows.

Refer to the O3DE System Requirements documentation to make sure that the system/hardware requirements are met

This project has the following dependencies:

  • O3DE
    • Should work with develop branch and newest releases, but the project was tested with commit #381a6e0f.
  • ROS2 Gem
    • develop branch (the default) should work. The project was tested with version tag 0.3.
    • ROS 2 (Galactic) itself is also required, see Gem Requirements
  • Loft Scene Sample
    • Use scene_fixes branch

Setup Instructions

The following steps will assume the following

  • The instructions will be based off of a common base folder: $DEMO_BASE. For the steps below, we will use DEMO_BASE of ~/ for simplicty.
  • This current project has been fetched to $DEMO_BASE
  • You have ROS2 installed and sourced
    • for debian package Galactic installation, in your bash console, run source /opt/ros/galactic/setup.bash
    • you could also add this line to your .profile
    • check if ROS 2 is sourced in your current console with echo $ROS_DISTRO. You should see galactic.

1. Clone O3DE (or install) and register the engine

$ cd $DEMO_BASE
~$ git clone https://github.com/o3de/o3de.git
~$ cd o3de
~/o3de$ git lfs install
~/o3de$ git lfs pull
~/o3de$ scripts/o3de.sh register --this-engine

2. Clone and register the ROS2 Gem locally

$ cd $DEMO_BASE
~$ git clone https://github.com/RobotecAI/o3de-ros2-gem.git
~$ $DEMO_BASE/o3de/scripts/o3de.sh register --gem-path $DEMO_BASE/o3de-ros2-gem

3. Clone and register the Loft Scene project locally

$ cd $DEMO_BASE
~$ git clone https://github.com/aws-lumberyard/loft-arch-vis-sample.git
~$ cd loft-arch-vis-sample
~/loft-arch-vis-sample$ git checkout scene_fixes
~/loft-arch-vis-sample$ git lfs install
~/loft-arch-vis-sample$ git lfs pull
~$ $DEMO_BASE/o3de/scripts/o3de.sh register --gem-path $DEMO_BASE/loft-arch-vis-sample/Gems/ArchVis

4. Register this project and build it

$ cd $DEMO_BASE
~/$ o3de/scripts/o3de.sh register -pp $DEMO_BASE/o3de-demo-project
~/$ cd o3de-demo-project
~/o3de-demo-project$ 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
~/o3de-demo-project$ cmake --build build/linux --config profile --target ROS2-Gem-Demo Editor AssetProcessor

5. Launch Editor

$ cd $DEMO_BASE
~/$ cd o3de-demo-project/build/linux/bin/profile
~/o3de-demo-project/build/linux/bin/profile$ ./Editor

Running ROS2 navigation example

We can run ROS2 navigation stack with our simulation scene and robot. When we run the navigation stack, it will start SLAM and build the map of environment based on Lidar sensor data. You can set navigation goals for the robot using RViz2 (which is also started with the launch file).

  • It is assumed that you have your ROS2 environment sourced.
  • It is also assumed that you followed all the steps before build and launch the Editor.

1. Install dependencies for navigation

These packages are required to run ROS 2 navigation stack for our robot:

sudo apt install ros-galactic-slam-toolbox
sudo apt install ros-galactic-navigation2
sudo apt install ros-galactic-nav2-bringup
sudo apt install ros-galactic-pointcloud-to-laserscan

2. Run the simulation

  1. In O3DE Editor, select the Loft Level.
  2. Start simulation by clicking Play Game button or press CTRL+G

3. Run the navigation stack

The launch file is included in this repository

~/o3de-demo-project/launch$ ros2 launch navigation.launch.py

You should see output in the console as well as RViz2 window.

4. Set robot target goal

Use RViz GUI to set the goal by using the 2D Goal Pose tool (upper toolbar). You can drag it to indicate direction you would like your robot to face when reaching the goal.

Watch your robot go. You can set subsequent goals.

Troubleshooting

AssetProcessor resource problems

Sometimes when there were problems while the AssetProcessor was working (for example, disk space ran out), subsequent executions of the Editor fail to re-start the process for such Assets. This might be due to a limitation of the number of files that can be watched by a single user. You can fix this by increasing the value, for example:

sudo sysctl -w fs.inotify.max_user_watches=524288

To make this setting permanent, add it to /etc/systctl.conf file.

No ROS 2 traffic on topics

This could be caused by a firewall, disabled multicast or issues with docker.

Please refer to ROS 2 troubleshooting guide.

Memory / resource issues with the scene

If your machine is a bit less powerful, you can try a lightweight, simple Warehouse scene instead of the Loft scene.