Skip to content

Commit

Permalink
fix: remove tl fine detector
Browse files Browse the repository at this point in the history
Signed-off-by: badai-nguyen <[email protected]>
  • Loading branch information
badai-nguyen committed Jan 6, 2025
1 parent 9bf8816 commit d5cfb5e
Showing 1 changed file with 1 addition and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from launch.conditions import UnlessCondition
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import ComposableNodeContainer
from launch_ros.actions import LoadComposableNodes
from launch_ros.actions import PushRosNamespace
from launch_ros.descriptions import ComposableNode
from launch_ros.parameter_descriptions import ParameterFile
Expand Down Expand Up @@ -73,10 +72,6 @@ def create_parameter_dict(*args):
result[x] = LaunchConfiguration(x)
return result

fine_detector_model_param = ParameterFile(
param_file=LaunchConfiguration("fine_detector_param_path").perform(context),
allow_substs=True,
)
car_traffic_light_classifier_model_param = ParameterFile(
param_file=LaunchConfiguration("car_classifier_param_path").perform(context),
allow_substs=True,
Expand Down Expand Up @@ -166,58 +161,7 @@ def create_parameter_dict(*args):
output="both",
)

decompressor_loader = LoadComposableNodes(
composable_node_descriptions=[
ComposableNode(
package="autoware_image_transport_decompressor",
plugin="autoware::image_preprocessor::ImageTransportDecompressor",
name="traffic_light_image_decompressor",
namespace=namespace,
parameters=[{"encoding": "rgb8"}],
remappings=[
(
"~/input/compressed_image",
[camera_arguments["input/image"], "/compressed"],
),
("~/output/raw_image", camera_arguments["input/image"]),
],
extra_arguments=[
{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}
],
),
],
target_container=container,
condition=IfCondition(LaunchConfiguration("enable_image_decompressor")),
)

fine_detector_loader = LoadComposableNodes(
composable_node_descriptions=[
ComposableNode(
package="autoware_traffic_light_fine_detector",
plugin="autoware::traffic_light::TrafficLightFineDetectorNode",
name="traffic_light_fine_detector",
namespace=f"{namespace}/detection",
parameters=[fine_detector_model_param],
remappings=[
("~/input/image", camera_arguments["input/image"]),
("~/input/rois", "rough/rois"),
("~/expect/rois", "expect/rois"),
("~/output/rois", camera_arguments["output/rois"]),
],
extra_arguments=[
{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}
],
),
],
target_container=container,
condition=IfCondition(LaunchConfiguration("enable_fine_detection")),
)

return [
GroupAction([PushRosNamespace(namespace), container]),
# decompressor_loader,
# traffic_light_selector_loader,
]
return [GroupAction([PushRosNamespace(namespace), container])]

Check notice on line 164 in launch/tier4_perception_launch/launch/traffic_light_recognition/traffic_light_node_container.launch.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Large Method

create_traffic_light_node_container decreases from 136 to 101 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.


def generate_launch_description():
Expand All @@ -229,19 +173,12 @@ def add_launch_arg(name: str, default_value=None, description=None):
DeclareLaunchArgument(name, default_value=default_value, description=description)
)

fine_detector_share_dir = get_package_share_directory("autoware_traffic_light_fine_detector")
classifier_share_dir = get_package_share_directory("autoware_traffic_light_classifier")
add_launch_arg("all_camera_namespaces", "[camera6, camera7]")
add_launch_arg("enable_image_decompressor", "True")
add_launch_arg("enable_fine_detection", "True")
add_launch_arg("use_image_transport", "True")

# traffic_light_fine_detector
add_launch_arg(
"fine_detector_param_path",
os.path.join(fine_detector_share_dir, "config", "traffic_light_fine_detector.param.yaml"),
)

# traffic_light_classifier
add_launch_arg(
"car_classifier_param_path",
Expand Down

0 comments on commit d5cfb5e

Please sign in to comment.