Skip to content

Commit 7a3f905

Browse files
Renamed routes for the depot warehouse to match naming convention.
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
1 parent c9d1bcc commit 7a3f905

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed
File renamed without changes.

‎nav2_bringup/launch/tb4_simulation_launch.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def generate_launch_description() -> LaunchDescription:
106106

107107
declare_graph_file_cmd = DeclareLaunchArgument(
108108
'graph',
109-
default_value=os.path.join(bringup_dir, 'graphs', 'turtlebot4_graph.geojson'),
109+
default_value=os.path.join(bringup_dir, 'graphs', f'turtlebot4_graph_{MAP_TYPE}.geojson'),
110110
)
111111

112112
declare_use_sim_time_cmd = DeclareLaunchArgument(

‎nav2_simple_commander/launch/route_example_launch.py‎

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,30 @@
2626
from launch.substitutions import Command, LaunchConfiguration, PythonExpression
2727
from launch_ros.actions import Node
2828

29+
# Define local map types
30+
MAP_POSES_DICT = {
31+
'depot': {
32+
'x': -8.00, 'y': 0.00, 'z': 0.01,
33+
'R': 0.00, 'P': 0.00, 'Y': 0.00
34+
},
35+
'warehouse': {
36+
'x': 2.12, 'y': -21.3, 'z': 0.01,
37+
'R': 0.00, 'P': 0.00, 'Y': 1.57
38+
}
39+
}
40+
MAP_TYPE = 'depot' # Change this to 'warehouse' for warehouse map
41+
2942

3043
def generate_launch_description() -> LaunchDescription:
3144
nav2_bringup_dir = get_package_share_directory('nav2_bringup')
3245
sim_dir = get_package_share_directory('nav2_minimal_tb4_sim')
3346
desc_dir = get_package_share_directory('nav2_minimal_tb4_description')
3447

3548
robot_sdf = os.path.join(desc_dir, 'urdf', 'standard', 'turtlebot4.urdf.xacro')
36-
world = os.path.join(sim_dir, 'worlds', 'depot.sdf')
37-
map_yaml_file = os.path.join(nav2_bringup_dir, 'maps', 'depot.yaml')
38-
graph_filepath = os.path.join(nav2_bringup_dir, 'graphs', 'turtlebot4_graph.geojson')
49+
world = os.path.join(sim_dir, 'worlds', f'{MAP_TYPE}.sdf')
50+
map_yaml_file = os.path.join(nav2_bringup_dir, 'maps', f'{MAP_TYPE}.yaml')
51+
graph_filepath = os.path.join(
52+
nav2_bringup_dir, 'graphs', f'turtlebot4_graph_{MAP_TYPE}.geojson')
3953

4054
# Launch configuration variables
4155
headless = LaunchConfiguration('headless')
@@ -79,12 +93,13 @@ def generate_launch_description() -> LaunchDescription:
7993
os.path.join(sim_dir, 'launch', 'spawn_tb4.launch.py')),
8094
launch_arguments={'use_sim_time': 'True',
8195
'robot_sdf': robot_sdf,
82-
'x_pose': '-8.0',
83-
'y_pose': '0.0',
84-
'z_pose': '0.0',
85-
'roll': '0.0',
86-
'pitch': '0.0',
87-
'yaw': '0.0'}.items())
96+
'x_pose': str(MAP_POSES_DICT[MAP_TYPE]['x']),
97+
'y_pose': str(MAP_POSES_DICT[MAP_TYPE]['y']),
98+
'z_pose': str(MAP_POSES_DICT[MAP_TYPE]['z']),
99+
'roll': str(MAP_POSES_DICT[MAP_TYPE]['R']),
100+
'pitch': str(MAP_POSES_DICT[MAP_TYPE]['P']),
101+
'yaw': str(MAP_POSES_DICT[MAP_TYPE]['Y']),
102+
}.items())
88103

89104
start_robot_state_publisher_cmd = Node(
90105
package='robot_state_publisher',

0 commit comments

Comments
 (0)