Skip to content

Commit

Permalink
added python launch and yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpennings committed Jul 31, 2022
1 parent 7734950 commit 76214d1
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ install(TARGETS laserscan_multi_merger laserscan_virtualizer
)

## Mark other files for installation (e.g. launch and bag files, etc.)
install(DIRECTORY launch/
install(DIRECTORY launch/ config/
DESTINATION share/${PROJECT_NAME}/launch
)

Expand Down
13 changes: 13 additions & 0 deletions config/ira_laserscan_merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
laserscan_multi_merger:
ros__parameters:
destination_frame: "base_link"
cloud_destination_topic: "/merged_cloud"
scan_destination_topic: "/scan_multi"
laserscan_topics: "/scansx /scandx"
angle_min: 0.0
angle_max: 270.0
angle_increment: 0.00437
scan_time: 0.0
range_min: 0.1
range_max: 2.0

42 changes: 42 additions & 0 deletions launch/merge_multi.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
import os
from ament_index_python.packages import get_package_share_directory


def generate_launch_description():
declared_arguments = []
declared_env_vars = []
declared_parameters = []

params_file = LaunchConfiguration("params_file")

declared_arguments.append(
DeclareLaunchArgument(
"params_file",
default_value=os.path.join(
get_package_share_directory("ira_laser_tools"),
"config",
"ira_laserscan_merge.yaml",
),
description="Path to param config in yaml format",
),
)

laser_merge = Node(
package="ira_laser_tools",
executable="laserscan_multi_merger",
name="laserscan_multi_merger",
parameters=[params_file],
output="both",
# respawn=True,
# respawn_delay=2,
)

nodes = [laser_merge]

return LaunchDescription(
declared_parameters + declared_arguments + declared_env_vars + nodes
)
2 changes: 1 addition & 1 deletion src/laserscan_multi_merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class LaserscanMerger : public rclcpp::Node

LaserscanMerger::LaserscanMerger() : Node("laserscan_multi_merger")
{
this->declare_parameter<std::string>("destination_frame", "cart_frame");
this->declare_parameter<std::string>("destination_frame", "base_link");
this->declare_parameter<std::string>("cloud_destination_topic", "/merged_cloud");
this->declare_parameter<std::string>("scan_destination_topic", "/scan_multi");
this->declare_parameter<std::string>("laserscan_topics", "");
Expand Down

0 comments on commit 76214d1

Please sign in to comment.