feat: persist 3d slam database in workspace
This commit is contained in:
@@ -16,11 +16,13 @@ from nav2_common.launch import RewrittenYaml
|
|||||||
ARGUMENTS = [
|
ARGUMENTS = [
|
||||||
DeclareLaunchArgument('sim_mode', default_value='true'),
|
DeclareLaunchArgument('sim_mode', default_value='true'),
|
||||||
DeclareLaunchArgument('robot', default_value='fr09', choices=['mkmini', 'fr09', 'f1tenth']),
|
DeclareLaunchArgument('robot', default_value='fr09', choices=['mkmini', 'fr09', 'f1tenth']),
|
||||||
|
DeclareLaunchArgument('database_path', default_value='~/.ros/rtabmap.db'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def launch_setup(context, *args, **kwargs):
|
def launch_setup(context, *args, **kwargs):
|
||||||
sim_mode = LaunchConfiguration('sim_mode').perform(context).lower()
|
sim_mode = LaunchConfiguration('sim_mode').perform(context).lower()
|
||||||
robot = LaunchConfiguration('robot').perform(context)
|
robot = LaunchConfiguration('robot').perform(context)
|
||||||
|
database_path = LaunchConfiguration('database_path')
|
||||||
|
|
||||||
remappings=[
|
remappings=[
|
||||||
('/tf', 'tf'),
|
('/tf', 'tf'),
|
||||||
@@ -59,7 +61,7 @@ def launch_setup(context, *args, **kwargs):
|
|||||||
executable='rtabmap',
|
executable='rtabmap',
|
||||||
name='rtabmap',
|
name='rtabmap',
|
||||||
output='screen',
|
output='screen',
|
||||||
parameters=[rtabmap_params_file],
|
parameters=[rtabmap_params_file, {'database_path': database_path}],
|
||||||
remappings=remappings,
|
remappings=remappings,
|
||||||
arguments=['-d']
|
arguments=['-d']
|
||||||
),
|
),
|
||||||
@@ -71,4 +73,3 @@ def generate_launch_description():
|
|||||||
ld = LaunchDescription(ARGUMENTS)
|
ld = LaunchDescription(ARGUMENTS)
|
||||||
ld.add_action(OpaqueFunction(function=launch_setup))
|
ld.add_action(OpaqueFunction(function=launch_setup))
|
||||||
return ld
|
return ld
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user