diff --git a/README.md b/README.md index 0369d8d..82f695e 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,57 @@ Ionic demo world and resources Usage: ``` -cd Ionic +git clone https://github.com/gazebosim/ionic_demo +cd ionic_demo/ionic_demo/worlds gz sim -v 4 ionic.sdf ``` - In Harmonic: ``` sudo apt install ros-rolling-ros-gz ``` + +# Running the navigation demo + +![](media/ionic-nav-demo-faster-smaller.gif) + +This demo requires at least [ROS 2 Jazzy](https://docs.ros.org/en/jazzy/index.html). + +Create a new colcon workspace, install dependencies and build the packages, + +``` +mkdir -p ~/ionic_ws/src +cd ~/ionic_w/src +git clone https://github.com/gazebosim/ionic_demo + +source /opt/ros/jazzy/setup.bash +rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y + +cd ~/ionic_ws/ +colcon build +``` + +Launch the demo, + +``` +source ~/ionic_ws/install/setup.bash +ros2 launch ionic_demo ionic_navigation_demo_launch.py headless:=0 +``` + +On rviz, initialize the position at the origin towards the right of the map, using the `2D Pose Estimate button`. + +![](media/rviz-estimate.png) + +Navigation commands can now be sent via the `Nav2 Goal` button. + +![](media/rviz-navigate.png) + +# Troubleshooting + +* If there are communication/middleware related issues while running the demos, we recommend trying again [using a different RMW implementation](https://docs.ros.org/en/jazzy/How-To-Guides/Working-with-multiple-RMW-implementations.html#specifying-rmw-implementations), for example `rmw_cyclonedds_cpp`. + + +# TODOs + +* package descriptions +* fleet adapter diff --git a/ionic_demo/CMakeLists.txt b/ionic_demo/CMakeLists.txt new file mode 100644 index 0000000..bced042 --- /dev/null +++ b/ionic_demo/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.8) +project(ionic_demo) + +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) + +install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY maps DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY worlds DESTINATION share/${PROJECT_NAME}) + +ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.dsv.in") + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # comment the line when a copyright and license is added to all source files + set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # comment the line when this package is in a git repo and when + # a copyright and license is added to all source files + set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/ionic_demo/hooks/ionic_demo.dsv.in b/ionic_demo/hooks/ionic_demo.dsv.in new file mode 100644 index 0000000..e200b7a --- /dev/null +++ b/ionic_demo/hooks/ionic_demo.dsv.in @@ -0,0 +1 @@ +prepend-non-duplicate;GZ_SIM_RESOURCE_PATH;share/@PROJECT_NAME@/worlds/ diff --git a/ionic_demo/launch/ionic_navigation_demo_launch.py b/ionic_demo/launch/ionic_navigation_demo_launch.py new file mode 100644 index 0000000..16e1a0c --- /dev/null +++ b/ionic_demo/launch/ionic_navigation_demo_launch.py @@ -0,0 +1,36 @@ +from launch_ros.substitutions import FindPackageShare + +from launch import LaunchDescription +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import PathJoinSubstitution, TextSubstitution + + +def generate_launch_description(): + + return LaunchDescription([ + IncludeLaunchDescription( + PythonLaunchDescriptionSource([ + PathJoinSubstitution([ + FindPackageShare('nav2_bringup'), + 'launch', + 'tb4_simulation_launch.py' + ]) + ]), + launch_arguments={ + 'map': PathJoinSubstitution([ + FindPackageShare('ionic_demo'), + 'maps', + 'ionic_demo.yaml' + ]), + 'world': PathJoinSubstitution([ + FindPackageShare('ionic_demo'), + 'worlds', + 'ionic.sdf' + ]), + 'x_pose': '0.0', + 'y_pose': '0.0', + 'z_pose': '0.0' + }.items() + ) + ]) diff --git a/ionic_demo/maps/ionic_demo.pgm b/ionic_demo/maps/ionic_demo.pgm new file mode 100644 index 0000000..6836e9a Binary files /dev/null and b/ionic_demo/maps/ionic_demo.pgm differ diff --git a/ionic_demo/maps/ionic_demo.yaml b/ionic_demo/maps/ionic_demo.yaml new file mode 100644 index 0000000..361383c --- /dev/null +++ b/ionic_demo/maps/ionic_demo.yaml @@ -0,0 +1,7 @@ +image: ionic_demo.pgm +mode: trinary +resolution: 0.05 +origin: [-5.57, -3.69, 0] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.25 diff --git a/ionic_demo/package.xml b/ionic_demo/package.xml new file mode 100644 index 0000000..139bdc0 --- /dev/null +++ b/ionic_demo/package.xml @@ -0,0 +1,20 @@ + + + + ionic_demo + 0.0.0 + TODO: Package description + tullyfoote + Apache License 2.0 + + ament_cmake + + nav2_bringup + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/Ionic/interior/meshes/Ionic.glb b/ionic_demo/worlds/interior/meshes/Ionic.glb similarity index 100% rename from Ionic/interior/meshes/Ionic.glb rename to ionic_demo/worlds/interior/meshes/Ionic.glb diff --git a/Ionic/interior/model.config b/ionic_demo/worlds/interior/model.config similarity index 100% rename from Ionic/interior/model.config rename to ionic_demo/worlds/interior/model.config diff --git a/Ionic/interior/model.sdf b/ionic_demo/worlds/interior/model.sdf similarity index 100% rename from Ionic/interior/model.sdf rename to ionic_demo/worlds/interior/model.sdf diff --git a/Ionic/ionic.sdf b/ionic_demo/worlds/ionic.sdf similarity index 100% rename from Ionic/ionic.sdf rename to ionic_demo/worlds/ionic.sdf diff --git a/media/ionic-nav-demo-faster-smaller.gif b/media/ionic-nav-demo-faster-smaller.gif new file mode 100644 index 0000000..b4ece91 Binary files /dev/null and b/media/ionic-nav-demo-faster-smaller.gif differ diff --git a/media/rviz-estimate.png b/media/rviz-estimate.png new file mode 100644 index 0000000..c8bca2d Binary files /dev/null and b/media/rviz-estimate.png differ diff --git a/media/rviz-navigate.png b/media/rviz-navigate.png new file mode 100644 index 0000000..f344452 Binary files /dev/null and b/media/rviz-navigate.png differ