Skip to content

Commit 5ac8fe0

Browse files
committed
Allow switching between move_base and move_base_flex
1 parent f58aef9 commit 5ac8fe0

File tree

5 files changed

+40
-64
lines changed

5 files changed

+40
-64
lines changed

thorp_simulation/launch/thorp_gazebo.launch

+6-15
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<arg name="debug" default="false"/>
1414
<arg name="paused" default="true"/>
1515

16+
<arg name="move_base_flex" default="true"/>
17+
1618
<!-- Name of the map to use (without path nor extension) and initial position -->
1719
<arg name="map_name" default="playground"/>
1820
<arg name="initial_pose_x" default="0.0"/>
@@ -41,21 +43,10 @@
4143
Make a new nodelet bumper2range and PR to Yujin -->
4244
<include file="$(find turtlebot_bringup)/launch/includes/kobuki/bumper2pc.launch.xml"/>
4345

44-
<!-- ************** Additional sensors ************* -->
45-
<include file="$(find thorp_bringup)/launch/includes/virt_sensor.launch.xml"/>
46-
47-
<!-- **************** Move base flex *************** -->
48-
<include file="$(find thorp_bringup)/launch/includes/move_base_flex.launch.xml">
49-
</include>
50-
51-
<!-- ****** Geometric and semantic map servers ***** -->
52-
<node name="map_server" pkg="map_server" type="map_server" args="$(find thorp_bringup)/resources/maps/$(arg map_name).yaml">
53-
<param name="frame_id" value="/map"/>
54-
</node>
55-
56-
<!-- ******************** Amcl ********************* -->
57-
<include file="$(find thorp_bringup)/launch/includes/amcl.launch.xml">
58-
<arg name="scan_topic" value="scan"/>
46+
<!-- ***************** Navigation ****************** -->
47+
<include file="$(find thorp_bringup)/launch/includes/navigation.launch.xml">
48+
<arg name="move_base_flex" value="$(arg move_base_flex)"/>
49+
<arg name="map_name" value="$(arg map_name)"/>
5950
<arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
6051
<arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
6152
<arg name="initial_pose_a" value="$(arg initial_pose_a)"/>

thorp_simulation/launch/thorp_stage.launch

+11-21
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
-->
1010

1111
<launch>
12+
<arg name="move_base_flex" default="true"/>
13+
1214
<!-- Name of the map to use (without path nor extension) and initial position -->
1315
<arg name="map_name" default="maze"/>
1416
<arg name="initial_pose_x" value="2.0"/>
@@ -40,9 +42,6 @@
4042
<remap from="base_scan" to="scan"/>
4143
</node>
4244

43-
<!-- ************** Additional sensors ************* -->
44-
<include file="$(find thorp_bringup)/launch/includes/virt_sensor.launch.xml"/>
45-
4645
<!-- ***************** Robot Model ***************** -->
4746
<include file="$(find thorp_bringup)/launch/includes/model.launch.xml"/>
4847

@@ -52,29 +51,20 @@
5251
<param name="yaml_cfg_file" value="$(find thorp_bringup)/param/vel_multiplexer.yaml"/>
5352
</node>
5453

55-
<!-- **************** Move base flex *************** -->
56-
<include file="$(find thorp_bringup)/launch/includes/move_base_flex.launch.xml">
54+
<!-- ***************** Navigation ****************** -->
55+
<include file="$(find thorp_bringup)/launch/includes/navigation.launch.xml">
56+
<arg name="move_base_flex" value="$(arg move_base_flex)"/>
57+
<arg name="map_name" value="$(arg map_name)"/>
58+
<arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
59+
<arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
60+
<arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
5761
</include>
5862

5963
<!-- we cannot simulate sonars on stage_ros, so disable sonar layer -->
6064
<param name="move_base/global_costmap/range_sensor_layer/enabled" value="false"/>
6165
<param name="move_base/local_costmap/range_sensor_layer/enabled" value="false"/>
62-
63-
<!-- ****** Geometric and semantic map servers ***** -->
64-
<node name="map_server" pkg="map_server" type="map_server" args="$(find thorp_bringup)/resources/maps/$(arg map_name).yaml">
65-
<param name="frame_id" value="/map"/>
66-
</node>
67-
68-
<!-- ******************** Amcl ********************* -->
69-
<include file="$(find thorp_bringup)/launch/includes/amcl.launch.xml">
70-
<arg name="scan_topic" value="scan"/>
71-
<arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
72-
<arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
73-
<arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
74-
</include>
75-
76-
<!-- ***** Watchdog to keep the pose on reboot ***** -->
77-
<node name="save_amcl_pose" pkg="thorp_toolkit" type="save_pose_node"/>
66+
<param name="move_base_flex/global_costmap/range_sensor_layer/enabled" value="false"/>
67+
<param name="move_base_flex/local_costmap/range_sensor_layer/enabled" value="false"/>
7868

7969
<!-- **************** Visualization **************** -->
8070
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find thorp_bringup)/rviz/view_nav.rviz"/>

thorp_simulation/launch/thorp_stdr.launch

+23-28
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,28 @@
1313
<arg name="laser_topic" default="robot0/laser_0"/> default laser topic in stdr for 1 robot
1414
<arg name="odom_topic" default="robot0/odom"/> -->
1515

16+
<arg name="move_base_flex" default="true"/>
17+
1618
<!-- Frames: I subvert stdr frames system to into our old good map -> odom -> base, but here odom
1719
is named map_static and base robot0. To make this work, I must prevent stdr_server to publish
1820
map -> map_static, as amcl already does:
1921
Comment https://github.com/stdr-simulator-ros-pkg/stdr_simulator/blob/indigo-devel/stdr_server/src/map_server.cpp#L93 -->
20-
<arg name="odom_frame_id" default="map_static"/>
21-
<arg name="base_frame_id" default="robot0"/>
22+
<arg name="odom_frame_id" default="map_static"/>
23+
<arg name="base_frame_id" default="robot0"/>
2224
<arg name="global_frame_id" default="map"/>
25+
2326
<!-- Name of the map to use (without path nor extension) and initial position -->
24-
<arg name="map_file" default="$(env TURTLEBOT_STDR_MAP_FILE)"/>
25-
<arg name="initial_pose_x" default="2.0"/>
26-
<arg name="initial_pose_y" default="2.0"/>
27-
<arg name="initial_pose_a" default="0.0"/>
27+
<arg name="map_file" default="$(env TURTLEBOT_STDR_MAP_FILE)"/>
28+
<arg name="initial_pose_x" default="2.0"/>
29+
<arg name="initial_pose_y" default="2.0"/>
30+
<arg name="initial_pose_a" default="0.0"/>
31+
2832
<arg name="min_obstacle_height" default="0.0"/>
2933
<arg name="max_obstacle_height" default="5.0"/>
3034

3135
<!-- ******************** STDR ******************** -->
36+
<param name="robot0/odometry_rate" value="50.0"/>
37+
3238
<include file="$(find stdr_robot)/launch/robot_manager.launch"/>
3339

3440
<!--
@@ -84,13 +90,13 @@ TODO: I can recover this if I can rename the robot and once I start using a thor
8490
<param name="yaml_cfg_file" value="$(find thorp_bringup)/param/vel_multiplexer.yaml"/>
8591
</node>
8692

87-
<!-- ******************** Maps ********************* -->
88-
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)">
89-
<param name="frame_id" value="$(arg global_frame_id)"/>
90-
</node>
91-
92-
<!-- **************** Move base flex *************** -->
93-
<include file="$(find thorp_bringup)/launch/includes/move_base_flex.launch.xml">
93+
<!-- ***************** Navigation ****************** -->
94+
<include file="$(find thorp_bringup)/launch/includes/navigation.launch.xml">
95+
<arg name="move_base_flex" value="$(arg move_base_flex)"/>
96+
<arg name="map_file" value="$(arg map_file)"/>
97+
<arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
98+
<arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
99+
<arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
94100
<arg name="odom_frame_id" value="$(arg odom_frame_id)"/>
95101
<arg name="base_frame_id" value="$(arg base_frame_id)"/>
96102
<arg name="global_frame_id" value="$(arg global_frame_id)"/>
@@ -101,21 +107,10 @@ TODO: I can recover this if I can rename the robot and once I start using a thor
101107
<param name="move_base/local_costmap/obstacle_layer/scan/max_obstacle_height" value="$(arg max_obstacle_height)"/>
102108
<param name="move_base/global_costmap/obstacle_layer/scan/min_obstacle_height" value="$(arg min_obstacle_height)"/>
103109
<param name="move_base/global_costmap/obstacle_layer/scan/max_obstacle_height" value="$(arg max_obstacle_height)"/>
104-
105-
<!-- ******************** Amcl ********************* -->
106-
<include file="$(find thorp_bringup)/launch/includes/amcl.launch.xml">
107-
<!-- <arg name="scan_topic" value="$(arg laser_topic)"/> -->
108-
<arg name="use_map_topic" value="true"/>
109-
<arg name="odom_frame_id" value="$(arg odom_frame_id)"/>
110-
<arg name="base_frame_id" value="$(arg base_frame_id)"/>
111-
<arg name="global_frame_id" value="$(arg global_frame_id)"/>
112-
<arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
113-
<arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
114-
<arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
115-
</include>
116-
117-
<!-- ***** Watchdog to keep the pose on reboot ***** -->
118-
<node name="save_amcl_pose" pkg="thorp_toolkit" type="save_pose_node"/>
110+
<param name="move_base_flex/local_costmap/obstacle_layer/scan/min_obstacle_height" value="$(arg min_obstacle_height)"/>
111+
<param name="move_base_flex/local_costmap/obstacle_layer/scan/max_obstacle_height" value="$(arg max_obstacle_height)"/>
112+
<param name="move_base_flex/global_costmap/obstacle_layer/scan/min_obstacle_height" value="$(arg min_obstacle_height)"/>
113+
<param name="move_base_flex/global_costmap/obstacle_layer/scan/max_obstacle_height" value="$(arg max_obstacle_height)"/>
119114

120115
<!-- **************** Visualization **************** -->
121116
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find thorp_bringup)/rviz/view_nav.rviz"/>

0 commit comments

Comments
 (0)