Skip to content

Commit

Permalink
Fix typos and add new launch file for large data use case (#187)
Browse files Browse the repository at this point in the history
* Fix typos and add new launch file for large data use case

Signed-off-by: Irene Bandera <[email protected]>

* Apply changes

Signed-off-by: Irene Bandera <[email protected]>

---------

Signed-off-by: Irene Bandera <[email protected]>
  • Loading branch information
irenebm authored Mar 4, 2024
1 parent 35a7637 commit fd9c0a8
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/rst/use_cases/large_data/large_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Large data communication with ROS 2 (a practical example)
=========================================================

This use case explain how to use `ROSbot XL` with `Orbbec Astra` camera to perform autonomous navigation and mapping while taking images of the environment.
This use case explains how to use `ROSbot XL` with `Orbbec Astra` camera to perform autonomous navigation and mapping while taking images of the environment.
This tutorial serves to demonstrate the **new auto-configuration of Fast DDS**, the default communications middleware in ROS 2, **for sending large data** between multiple systems in a distributed environment.

As we will see throughout this case study, enabling large data mode in Vulcanexus is as simple as setting ``FASTDDS_BUILTIN_TRANSPORTS=LARGE_DATA`` environment variable.
Expand Down Expand Up @@ -60,15 +60,15 @@ All its contents are explained below.
.. figure:: /rst/figures/use_cases/rosbotxl/astra-docker_repository.png
:align: center

`NAV 2 <https://navigation.ros.org/>`__ is the ROS 2 Stack that provides a modular architecture for autonomous navigation in robots.
`Nav2 <https://navigation.ros.org/>`__ is the ROS 2 Navigation Stack that provides a modular architecture for autonomous navigation in robots.
It includes packages for mapping, localization, path planning, and obstacle avoidance.

.. figure:: /rst/figures/use_cases/rosbotxl/nav2.png
:align: center

`MicroXRCEAgent <https://micro-xrce-dds.docs.eprosima.com/en/latest/agent.html>`_ acts as a server between the DDS Network and eProsima Micro XRCE-DDS Clients applications.
It is part of the `Micro XRCE-DDS <https://micro-xrce-dds.docs.eprosima.com/en/latest/index.html>`_ stack, which is the default middleware for ``micro-ROS``.
It allows the communication between the ROS 2 stack and the micro-ROS stack.
It allows the ROS 2 stack to communicate with the micro-ROS stack.

.. figure:: /rst/figures/use_cases/rosbotxl/microxrceagent.png
:align: center
Expand Down Expand Up @@ -137,7 +137,7 @@ First, it is necessary to setup the Vulcanexus environment and the ROS 2 workspa
source /opt/vulcanexus/humble/setup.bash
source $HOME/ROS2-ws/install/setup.bash
Then set the environment variable ``FASTDDS_BUILTIN_TRANSPORTS`` to ``LARGE_DATA`` in all the terminals.
Then set the environment variable ``FASTDDS_BUILTIN_TRANSPORTS`` to ``LARGE_DATA`` on all the terminals.
As mentioned before, this command changes the default configuration of the transport layer in Fast DDS to better support the large data packages that are going to be sent in this demo.

.. code-block:: bash
Expand Down Expand Up @@ -202,6 +202,11 @@ As mentioned before, this command changes the default configuration of the trans
ros2 launch astra_camera astra_mini.launch.py
.. note::

The ROS 2 launch files explained earlier are executed using a single ROS 2 launch file for ease of use.
You can locate this launch file `here <https://github.com/eProsima/vulcanexus/tree/iron/resources/py/rosbotxl_astra_navigation_mapping_launch.py>`__.

.. raw:: html

<video width=100% height=auto autoplay loop controls muted>
Expand Down
122 changes: 122 additions & 0 deletions resources/py/rosbotxl_astra_navigation_mapping_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from launch import LaunchDescription
from launch.actions import (
GroupAction,
IncludeLaunchDescription,
TimerAction,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution

from ament_index_python.packages import get_package_share_directory

def generate_launch_description():

# Specify the actions
bringup_cmd_group = GroupAction(
[
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
get_package_share_directory('rosbot_xl_bringup'),
'launch',
'bringup.launch.py',
])
),
launch_arguments={
'mecanum': 'True',
}.items(),
),

IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
get_package_share_directory('sllidar_ros2'),
'launch',
'sllidar_launch.py',
])
),
launch_arguments={
'serial_baudrate': '115200',
'serial_port': '/dev/ttyRPLIDAR',
}.items(),
),

TimerAction(
period=3.0,
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
get_package_share_directory('nav2_bringup'),
'launch',
'slam_launch.py',
])
),
launch_arguments={
'map': '/maps/map.yaml',
'use_sim_time': 'False',
'params_file': '/home/husarion/ros2_ws/config/nav2_params.yaml',
}.items(),
),
]
),

TimerAction(
period=3.5,
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
get_package_share_directory('nav2_bringup'),
'launch',
'navigation_launch.py',
])
),
launch_arguments={
'use_sim_time': 'False',
'params_file': '/home/husarion/ros2_ws/config/nav2_rpp_params.yaml',
}.items(),
),
]
),

TimerAction(
period=5.0,
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
get_package_share_directory('astra_camera'),
'launch',
'astra_mini.launch.py',
])
),
),
]
),
]
)

# Create the launch description and populate
ld = LaunchDescription()

# Add the actions to launch all of the nodes
ld.add_action(bringup_cmd_group)

return ld

0 comments on commit fd9c0a8

Please sign in to comment.