Skip to content

Commit

Permalink
feat: remove concatenate params from aip launcher and load from indiv…
Browse files Browse the repository at this point in the history
…idual params

Signed-off-by: vividf <[email protected]>
  • Loading branch information
vividf committed Dec 3, 2024
1 parent 470e1e0 commit b2ca298
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
ros__parameters:
debug_mode: false
has_static_tf_only: false
rosbag_replay: false
rosbag_length: 20.0
rosbag_length: 10.0
maximum_queue_size: 5
timeout_sec: 0.2
is_motion_compensated: true
Expand Down
2 changes: 1 addition & 1 deletion aip_x1_launch/launch/lidar.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
</group>

<include file="$(find-pkg-share aip_x1_launch)/launch/pointcloud_preprocessor.launch.py">
<arg name="base_frame" value="base_link" />
<arg name="use_intra_process" value="true" />
<arg name="use_multithread" value="false" />
<arg name="container_name" value="$(var pointcloud_container_name)"/>
<arg name="concatenate_and_time_sync_node_param_path" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x1/concatenate_and_time_sync_node.param.yaml" />
</include>

</group>
Expand Down
13 changes: 1 addition & 12 deletions aip_x1_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
# 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 OpaqueFunction
Expand Down Expand Up @@ -64,19 +62,10 @@ def generate_launch_description():
def add_launch_arg(name: str, default_value=None):
launch_arguments.append(DeclareLaunchArgument(name, default_value=default_value))

aip_x1_launch_share_dir = get_package_share_directory("aip_x1_launch")

add_launch_arg("use_multithread", "False")
add_launch_arg("use_intra_process", "False")
add_launch_arg("pointcloud_container_name", "pointcloud_container")
add_launch_arg(
"concatenate_and_time_sync_node_param_path",
os.path.join(
aip_x1_launch_share_dir,
"config",
"concatenate_and_time_sync_node.param.yaml",
),
)
add_launch_arg("concatenate_and_time_sync_node_param_path")

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down
27 changes: 0 additions & 27 deletions aip_x2_launch/config/concatenate_and_time_sync_node.param.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion aip_x2_launch/launch/lidar.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@
</group>

<include file="$(find-pkg-share aip_x2_launch)/launch/pointcloud_preprocessor.launch.py">
<arg name="base_frame" value="base_link" />
<arg name="use_intra_process" value="true" />
<arg name="use_multithread" value="true" />
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="concatenate_and_time_sync_node_param_path" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_x2/concatenate_and_time_sync_node.param.yaml" />
</include>

</group>
Expand Down
14 changes: 1 addition & 13 deletions aip_x2_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
# 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 OpaqueFunction
Expand Down Expand Up @@ -65,20 +63,10 @@ def generate_launch_description():
def add_launch_arg(name: str, default_value=None):
launch_arguments.append(DeclareLaunchArgument(name, default_value=default_value))

aip_x2_launch_share_dir = get_package_share_directory("aip_x2_launch")

add_launch_arg("use_multithread", "True")
add_launch_arg("use_intra_process", "True")
add_launch_arg("pointcloud_container_name", "pointcloud_container")

add_launch_arg(
"concatenate_and_time_sync_node_param_path",
os.path.join(
aip_x2_launch_share_dir,
"config",
"concatenate_and_time_sync_node.param.yaml",
),
)
add_launch_arg("concatenate_and_time_sync_node_param_path")

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions aip_xx1_gen2_launch/config/lidar_gen2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,3 @@ launches:
scan_phase: 270.0
cloud_min_angle: 90
cloud_max_angle: 270

preprocessor:
input_topics:
- /sensing/lidar/top/pointcloud_before_sync
- /sensing/lidar/side_left/pointcloud_before_sync
- /sensing/lidar/side_right/pointcloud_before_sync
- /sensing/lidar/front_left/pointcloud_before_sync
- /sensing/lidar/front_right/pointcloud_before_sync
input_offset:
- 0.035
- 0.025
- 0.025
- 0.025
- 0.025
timeout_sec: 0.095
input_twist_topic_type: twist
publish_synchronized_pointcloud: true
29 changes: 10 additions & 19 deletions aip_xx1_gen2_launch/launch/lidar.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

from copy import deepcopy
import os
from typing import Any
from typing import List

from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
Expand All @@ -32,15 +31,6 @@
import yaml


def join_list_of_arguments(arguments: List[Any]) -> str:
"""Join a list of arguments into a string, used by Include Launch Description.
Example:
join_list_of_arguments([1,2,3]) -> "[1, 2, 3]"
"""
return f"[{', '.join([str(arg) for arg in arguments])}]"


def generate_launch_dictionary():
path_dictionary = {
"hesai_OT128": AnyLaunchDescriptionSource(
Expand Down Expand Up @@ -122,7 +112,7 @@ def load_yaml(yaml_file_path):
)
sub_launch_actions.append(sub_launch_action)

processor_dict = config["preprocessor"]
# processor_dict = config["preprocessor"]
sub_launch_actions.append(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand All @@ -133,18 +123,19 @@ def load_yaml(yaml_file_path):
)
),
launch_arguments=[
("base_frame", "base_link"),
("use_multithread", "true"),
("use_intra_process", "true"),
("use_pointcloud_container", LaunchConfiguration("use_pointcloud_container")),
("pointcloud_container_name", LaunchConfiguration("pointcloud_container_name")),
("input_topics", join_list_of_arguments(processor_dict["input_topics"])),
("input_offset", join_list_of_arguments(processor_dict["input_offset"])),
("timeout_sec", str(processor_dict["timeout_sec"])),
("input_twist_topic_type", str(processor_dict["input_twist_topic_type"])),
(
"publish_synchronized_pointcloud",
str(processor_dict["publish_synchronized_pointcloud"]),
"concatenate_and_time_sync_node_param_path",
os.path.join(
FindPackageShare("individual_params").find(),
"config",
LaunchConfiguration("vehicle_id").perform(None),
"aip_xx1_gen2",
"concatenate_and_time_sync_node.param.yaml",
),
),
],
)
Expand Down
14 changes: 1 addition & 13 deletions aip_xx1_gen2_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# 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 OpaqueFunction
Expand Down Expand Up @@ -65,21 +62,12 @@ def generate_launch_description():
def add_launch_arg(name: str, default_value=None):
launch_arguments.append(DeclareLaunchArgument(name, default_value=default_value))

aip_xx1_gen2_launch_share_dir = get_package_share_directory("aip_xx1_gen2_launch")

add_launch_arg("use_multithread", "False")
add_launch_arg("use_intra_process", "False")
add_launch_arg("pointcloud_container_name", "pointcloud_container")
add_launch_arg("individual_container_name", "concatenate_container")
add_launch_arg("concatenate_and_time_sync_node_param_path")

add_launch_arg(
"concatenate_and_time_sync_node_param_path",
os.path.join(
aip_xx1_gen2_launch_share_dir,
"config",
"concatenate_and_time_sync_node.param.yaml",
),
)

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down
23 changes: 0 additions & 23 deletions aip_xx1_launch/config/concatenate_and_time_sync_node.param.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion aip_xx1_launch/launch/lidar.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@
</group> -->

<include file="$(find-pkg-share aip_xx1_launch)/launch/pointcloud_preprocessor.launch.py">
<arg name="base_frame" value="base_link"/>
<arg name="use_intra_process" value="true"/>
<arg name="use_multithread" value="true"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="concatenate_and_time_sync_node_param_path" value="$(find-pkg-share individual_params)/config/$(var vehicle_id)/aip_xx1/concatenate_and_time_sync_node.param.yaml" />
</include>

</group>
Expand Down
13 changes: 1 addition & 12 deletions aip_xx1_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# 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 OpaqueFunction
Expand Down Expand Up @@ -65,19 +62,11 @@ def generate_launch_description():
def add_launch_arg(name: str, default_value=None):
launch_arguments.append(DeclareLaunchArgument(name, default_value=default_value))

aip_xx1_launch_share_dir = get_package_share_directory("aip_xx1_launch")

add_launch_arg("use_multithread", "False")
add_launch_arg("use_intra_process", "False")
add_launch_arg("pointcloud_container_name", "pointcloud_container")
add_launch_arg(
"concatenate_and_time_sync_node_param_path",
os.path.join(
aip_xx1_launch_share_dir,
"config",
"concatenate_and_time_sync_node.param.yaml",
),
)
add_launch_arg("concatenate_and_time_sync_node_param_path")

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down

0 comments on commit b2ca298

Please sign in to comment.