usdot-fhwa-stol / carma-utils

Utility libraries for hardware drivers in the CARMA Platform
2 stars 5 forks source link

Add human-readable lifecycle transition logs #235

Closed MishkaMN closed 1 month ago

MishkaMN commented 1 month ago

PR Details

Description

During debugging or testing, lifecycle logs don't print human-readable transition ids. Due to this, users of carma-platform don't have context of what stage the carma-platform is unless they are intimately familiar with the ids. For example, transition.id 1 below is hard to understand:

platform_ros2                     | [guidance_controller-43] 1726033822.220037748 | INFO | guidance.guidance_controller | wait_on_change_state_future:363 | Transition 1 successfully triggered.
platform_ros2                     | [carma_component_container_mt-11] 1726033822.220110111 | WARN | LifecyclePublisher | publish:104 | Trying to publish message on the topic '/localization/localization_status', but the publisher is not activated
platform_ros2                     | [carma_component_container_mt-11] 1726033822.320015148 | WARN | LifecyclePublisher | publish:104 | Trying to publish message on the topic '/localization/localization_status', but the publisher is not activated
platform_ros2                     | [lifecycle_component_wrapper_mt-7] 1726033822.360261833 | INFO | environment.lanelet2_map_visualization | CarmaLifecycleNode:54 | CarmaLifecycleNode node launched, waiting on state transition requests
platform_ros2                     | [lifecycle_component_wrapper_mt-7] 1726033822.361215544 | INFO | environment.lanelet2_map_visualization_container | on_load_node:349 | A lifecycle component has been loaded by the LifecycleComponentWrapper. Attempting to move it to the ACTIVE state.

I added human-readable format so that it is easier for the users to understand what is happening:

                | [guidance_controller-43] 1726035780.013904770 | INFO | guidance.guidance_controller | wait_on_change_state_future:365 | Transition TRANSITION_CONFIGURE (1) successfully triggered.
platform_ros2                     | [guidance_controller-43] 1726035780.014598171 | INFO | guidance.guidance_controller | transition_multiplex:293 | Calling node: /guidance/route_node
platform_ros2                     | [guidance_controller-43] 1726035780.014787115 | INFO | guidance.guidance_controller | wait_on_change_state_future:350 | Waiting for future
platform_ros2                     | [carma_component_container_mt-22] 1726035780.026386140 | INFO | guidance.route_node | handle_on_configure:58 | Route trying to configure
platform_ros2                     | [carma_component_container_mt-22] 1726035780.027733745 | INFO | guidance.route_node | handle_on_configure:70 | Loaded params: route::Config { 
platform_ros2                     | [carma_component_container_mt-22] max_crosstrack_error: 2
platform_ros2                     | [carma_component_container_mt-22] destination_downtrack_range: 10
platform_ros2                     | [carma_component_container_mt-22] route_spin_rate: 10
platform_ros2                     | [carma_component_container_mt-22] cte_max_count: 4
platform_ros2                     | [carma_component_container_mt-22] route_file_path: /opt/carma/routes/
platform_ros2                     | [carma_component_container_mt-22] }
platform_ros2                     | [carma_component_container_mt-22] 
ros1_bridge                       | Failed to connect to 127.0.0.1:47945
ros1_bridge                       | Failed to connect to 127.0.0.1:47945
platform_ros2                     | [carma_component_container_mt-18] 1726035780.033258273

Related GitHub Issue

NA.

Related Jira Key

CAR-6076

Motivation and Context

As people other than carma-platform developers increasingly use the tool such as cdasim developers, it needs to be more user-friendly.

How Has This Been Tested?

local VM integration tested

Types of changes

Checklist:

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud