Nav apraksta

Michał Pełka b7b21d8e1f Merge branch 'main' into michalpelka-patch-1 1 gadu atpakaļ
.github 7ee0d100bf add CODEOWNERS file to RobotVacuumSample repo 2 gadi atpakaļ
Assets 7cb498732a Fix line endings for Linux (#31) 1 gadu atpakaļ
Config 7cb498732a Fix line endings for Linux (#31) 1 gadu atpakaļ
Docker 7cd215ba42 Set default tag for O3DE to critical fix for broken PyYaml dependencies (#27) 2 gadi atpakaļ
Gem 3264676f76 Update CMakeLists.txt for the default GEM to match current project template logic 2 gadi atpakaļ
Levels 56d5ca54a6 Adjusted robot prefab (#29) 1 gadu atpakaļ
LightingPresets 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
Platform bef2001509 Rename o3de-demo-project to RobotVacuumSample 2 gadi atpakaļ
ReflectionProbes 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
Registry 56d5ca54a6 Adjusted robot prefab (#29) 1 gadu atpakaļ
Resources 0e441926dd ROS2 launch code standard, added missing headers, cleanup 2 gadi atpakaļ
ShaderLib 1049ac8796 - Updates based on running latest o3de project creation script 2 gadi atpakaļ
Shaders 0e441926dd ROS2 launch code standard, added missing headers, cleanup 2 gadi atpakaļ
cmake a5454ce730 fix fail find engine if last engine incompatible (#22) 2 gadi atpakaļ
launch 0e441926dd ROS2 launch code standard, added missing headers, cleanup 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 5c871a12e9 Update EngineFinder and support older engines (#20) 2 gadi atpakaļ
CODE_OF_CONDUCT.md 30b75305f0 Initial commit 2 gadi atpakaļ
CONTRIBUTING.md 30b75305f0 Initial commit 2 gadi atpakaļ
LICENSE.txt 45c7abc3e2 Fixes for License files 2 gadi atpakaļ
LICENSE_APACHE2.TXT 30b75305f0 Initial commit 2 gadi atpakaļ
LICENSE_MIT.TXT 30b75305f0 Initial commit 2 gadi atpakaļ
README.md 78f4e1c7cd Update branch names in readme 1 gadu atpakaļ
SurfaceTypeMaterialLibrary.physmaterial 07e33a51f9 Adding Loft Level and local Assets 2 gadi atpakaļ
build.sh 0e441926dd ROS2 launch code standard, added missing headers, cleanup 2 gadi atpakaļ
dev_notes.md babbb8d626 diagonal inertia in rigid body notice 2 gadi atpakaļ
game.cfg 191cd03de5 Fixes and updates for RobotVacuumSample Docker 2 gadi atpakaļ
preview.png 9e5c7c7eb6 Initial project commit 2 gadi atpakaļ
project.json 191cd03de5 Fixes and updates for RobotVacuumSample Docker 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

O3DE Simulation - Robot Vacuum Sample

This sample project demonstrates a robotic vacuum simulation project navigating through the O3DE Loft scene using the ROS 2 Gem and the ROS 2 navigation stack.

Demo video

https://user-images.githubusercontent.com/82551958/229621938-da2244c7-69c1-4240-9f85-f883ccada128.mp4

Image

image

Requirements

This project will run on

  • Ubuntu 20.04 with ROS 2 Galactic
  • Ubuntu 22.04 with ROS 2 Humble

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:

Setup Instructions

The following steps will assume the following

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

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

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

2. Clone and register the ROS2 Gem locally

~$ cd $DEMO_BASE
~$ git clone https://github.com/o3de/o3de-extras.git -b main
~$ $DEMO_BASE/o3de/scripts/o3de.sh register -gp $DEMO_BASE/o3de-extras/Gems/ROS2

3. Clone and register the Loft Scene project locally

$ cd $DEMO_BASE
~$ git clone https://github.com/o3de/loft-arch-vis-sample.git -b main
~$ cd loft-arch-vis-sample
~/loft-arch-vis-sample$ git lfs install
~/loft-arch-vis-sample$ git lfs pull
~/loft-arch-vis-sample$ $DEMO_BASE/o3de/scripts/o3de.sh register -gp $DEMO_BASE/loft-arch-vis-sample/Gems/ArchVis

4. Clone and Register this project and build it

$ cd $DEMO_BASE
~$ git clone https://github.com/o3de/RobotVacuumSample.git
~$ cd RobotVacuumSample
~/RobotVacuumSample$ git lfs install
~/RobotVacuumSample$ $DEMO_BASE/o3de/scripts/o3de.sh register -pp .
~/RobotVacuumSample$ cmake -B build/linux -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON
~/RobotVacuumSample$ cmake --build build/linux --config profile --target RobotVacuumSample Editor AssetProcessor

5. Launch Editor

$ cd $DEMO_BASE
~$ cd RobotVacuumSample/build/linux/bin/profile
~/RobotVacuumSample/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. For ROS 2 Humble, replace galactic with humble.

source /opt/ros/galactic/setup.bash
sudo apt install -y ros-${ROS_DISTRO}-slam-toolbox ros-${ROS_DISTRO}-navigation2 ros-${ROS_DISTRO}-nav2-bringup ros-${ROS_DISTRO}-pointcloud-to-laserscan ros-${ROS_DISTRO}-ackermann-msgs ros-${ROS_DISTRO}-control-toolbox ros-${ROS_DISTRO}-gazebo-msgs

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

~/RobotVacuumSample/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.