fix: move MKMini default spawn point
This commit is contained in:
@@ -300,6 +300,8 @@ def launch_gazebo(context):
|
|||||||
world = LaunchConfiguration('world').perform(context)
|
world = LaunchConfiguration('world').perform(context)
|
||||||
render_mode = LaunchConfiguration('render_mode').perform(context).strip().lower()
|
render_mode = LaunchConfiguration('render_mode').perform(context).strip().lower()
|
||||||
platform = LaunchConfiguration('platform').perform(context).strip().lower()
|
platform = LaunchConfiguration('platform').perform(context).strip().lower()
|
||||||
|
spawn_x = LaunchConfiguration('x_pose').perform(context)
|
||||||
|
spawn_y = LaunchConfiguration('y_pose').perform(context)
|
||||||
extra_model_path = ''
|
extra_model_path = ''
|
||||||
|
|
||||||
if render_mode not in {'flat', 'full'}:
|
if render_mode not in {'flat', 'full'}:
|
||||||
@@ -348,6 +350,10 @@ def launch_gazebo(context):
|
|||||||
entity_name = 'mkmini_gazebo'
|
entity_name = 'mkmini_gazebo'
|
||||||
model_directory = os.path.join(simulator_dir, 'models')
|
model_directory = os.path.join(simulator_dir, 'models')
|
||||||
model_path = os.path.join(model_directory, 'mkmini_gazebo', 'model.sdf')
|
model_path = os.path.join(model_directory, 'mkmini_gazebo', 'model.sdf')
|
||||||
|
# Keep the default spawn point proportional to the expanded MKMini map.
|
||||||
|
if spawn_x == '-2.0' and spawn_y == '-0.5':
|
||||||
|
spawn_x = str(-2.0 * MKMINI_WORLD_SPACING_SCALE)
|
||||||
|
spawn_y = str(-0.5 * MKMINI_WORLD_SPACING_SCALE)
|
||||||
static_transforms = []
|
static_transforms = []
|
||||||
else:
|
else:
|
||||||
raise RuntimeError('platform must be turtlebot3 or mkmini')
|
raise RuntimeError('platform must be turtlebot3 or mkmini')
|
||||||
@@ -371,8 +377,8 @@ def launch_gazebo(context):
|
|||||||
arguments=[
|
arguments=[
|
||||||
'-entity', entity_name,
|
'-entity', entity_name,
|
||||||
'-file', model_path,
|
'-file', model_path,
|
||||||
'-x', LaunchConfiguration('x_pose').perform(context),
|
'-x', spawn_x,
|
||||||
'-y', LaunchConfiguration('y_pose').perform(context),
|
'-y', spawn_y,
|
||||||
'-z', '0.01',
|
'-z', '0.01',
|
||||||
],
|
],
|
||||||
output='screen',
|
output='screen',
|
||||||
|
|||||||
Reference in New Issue
Block a user