Skip to content

Commit

Permalink
fix(map_launch): map_loader package not working in UTM coordinates (#293
Browse files Browse the repository at this point in the history
)

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
  • Loading branch information
taikitanaka3 authored Apr 25, 2022
1 parent b2c2528 commit 02e5e34
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion map_launch/launch/map.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
# 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 ament_index_python.packages import get_package_share_directory
import launch
from launch.actions import DeclareLaunchArgument
from launch.actions import GroupAction
Expand All @@ -23,9 +25,17 @@
from launch_ros.actions import Node
from launch_ros.actions import PushRosNamespace
from launch_ros.descriptions import ComposableNode
import yaml


def generate_launch_description():

lanelet2_map_origin_path = os.path.join(
get_package_share_directory("map_loader"), "config/lanelet2_map_loader.param.yaml"
)

with open(lanelet2_map_origin_path, "r") as f:
lanelet2_map_origin_param = yaml.safe_load(f)["/**"]["ros__parameters"]
map_hash_generator = Node(
package="map_loader",
executable="map_hash_generator",
Expand All @@ -47,7 +57,9 @@ def generate_launch_description():
{
"center_line_resolution": 5.0,
"lanelet2_map_path": LaunchConfiguration("lanelet2_map_path"),
}
"lanelet2_map_projector_type": "MGRS", # Options: MGRS, UTM
},
lanelet2_map_origin_param,
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)
Expand Down
4 changes: 4 additions & 0 deletions map_launch/launch/map.launch.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<launch>
<arg name="param_file" default="$(find-pkg-share map_loader)/config/lanelet2_map_loader.param.yaml"/>
<arg name="map_path" default="" />
<arg name="lanelet2_map_path" default="$(var map_path)/lanelet2_map.osm" />
<arg name="pointcloud_map_path" default="$(var map_path)/pointcloud_map.pcd" />
Expand All @@ -12,6 +13,9 @@
<node pkg="map_loader" exec="pointcloud_map_loader" name="pointcloud_map_loader">
<remap from="output/pointcloud_map" to="/map/pointcloud_map" />
<param name="pcd_paths_or_directory" value="[$(var pointcloud_map_path)]" />
<param name="lanelet2_map_projector_type" value="MGRS"/>
<!-- UTM or MGRS -->
<param from="$(var param_file)"/>
</node>

<include file="$(find-pkg-share map_tf_generator)/launch/map_tf_generator.launch.xml">
Expand Down

0 comments on commit 02e5e34

Please sign in to comment.