Closed geopimik closed 4 months ago
Added the check if stoplines are on path, and the rest of the code is nested inside it https://github.com/AnishShr/autoware_mini_practice/blob/a7cbcac5b73433fcb7edba7ccd85c11105b9df85/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L139
removed additional checks for publishing tfl status. If there are no rois or classes, empty tfl status array is published. https://github.com/AnishShr/autoware_mini_practice/blob/a7cbcac5b73433fcb7edba7ccd85c11105b9df85/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L160-L188
Added timestamp from camera img msg from the camera callback https://github.com/AnishShr/autoware_mini_practice/blob/a7cbcac5b73433fcb7edba7ccd85c11105b9df85/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L184-L186
and 5. Removed unnecessary lines
git commit: https://github.com/AnishShr/autoware_mini_practice/commit/a7cbcac5b73433fcb7edba7ccd85c11105b9df85
Mostly OK, but I would still tweak it a bit.
You have everything under this callback nested below this if: https://github.com/AnishShr/autoware_mini_practice/blob/a7cbcac5b73433fcb7edba7ccd85c11105b9df85/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L139
stoplines_on_path
is None
only when there is no path (your local_path_callback
), so it is almost always true.
So if there is a local path, but there are no stoplines in it you would still try to get the transform and other things. You should only do it wen there are actual stoplines intersecting the local path.
If you correct the previous if (only done when there are actual stop lines present) then you need to bring out of the if the roi image and traffic light status publishing.
Modified the check for stoplines on local path https://github.com/AnishShr/autoware_mini_practice/blob/63c0bd83447cc5c7f9022c7e9c43a01918428d0a/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L150
Brought out the publishing of roi images and traffic_light_status from this check https://github.com/AnishShr/autoware_mini_practice/blob/63c0bd83447cc5c7f9022c7e9c43a01918428d0a/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L139-L197
git commit: https://github.com/AnishShr/autoware_mini_practice/commit/63c0bd83447cc5c7f9022c7e9c43a01918428d0a
ok
Comments:
calculate_roi_images
only if there are stoplines on the local path. So, I would add that check, and most of the code in thecamera_image_callback
could be nested under that.rois
/classes
.classes
should always be present when there arerois
, so there is no point in having extra check: https://github.com/AnishShr/autoware_mini_practice/blob/d925e1e517a6656f8355264a1323ff155cd0e166/practice_7/nodes/detection/tfl_camera/camera_traffic_light_detector.py#L171TrafficLightResultArray
does not have a timestamp - it should com from the image!