Skip to content

Clean up traffic_light_reg_elem #190

@JStephenHuang

Description

@JStephenHuang
  • Remove any the mock function that handles the detection class id for traffic light reg elem and implement class_id to TrafficLightState method under traffic light reg elem class. (See for traffic sign implementation)

  • Also clean up the hd_map, remove any irrelevant comments or unused functions.

For example:

  • Remove this:
    // Mock function to get traffic light state (to change or remove)
    TrafficLightState HDMapRouter::get_traffic_light_state(
    const vision_msgs::msg::Detection3D::SharedPtr traffic_light_msg_ptr) {
    if (traffic_light_msg_ptr->results.empty()) {
    return TrafficLightState::Unknown;
    }
    TrafficLightState traffic_light_state = TrafficLightState::Unknown;
    float base_score = 0;
    for (const auto& result : traffic_light_msg_ptr->results) {
    if (result.hypothesis.score > base_score) {
    if (result.hypothesis.class_id == "GREEN") {
    traffic_light_state = TrafficLightState::Green;
    } else if (result.hypothesis.class_id == "YELLOW") {
    traffic_light_state = TrafficLightState::Yellow;
    } else if (result.hypothesis.class_id == "RED") {
    traffic_light_state = TrafficLightState::Red;
    }
    base_score = result.hypothesis.score;
    }
    }
    return TrafficLightState::Green;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions