Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
|
#include <lci_strategic_plugin.hpp>
Classes | |
struct | VehicleState |
Struct representing a vehicle state for the purposes of planning. More... | |
Public Member Functions | |
LCIStrategicPlugin (const rclcpp::NodeOptions &) | |
Default constructor for RouteFollowingPlugin class. More... | |
void | plan_maneuvers_callback (std::shared_ptr< rmw_request_id_t > srv_header, carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp) |
Service callback for arbitrator maneuver planning. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Callback for dynamic parameter updates. More... | |
carma_ros2_utils::CallbackReturn | on_configure_plugin () |
Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states. This method should be used to load parameters and is required to be implemented. More... | |
carma_ros2_utils::CallbackReturn | on_activate_plugin () |
Method which is triggered when this plugin is moved from the INACTIVE to ACTIVE states. This method should be used to prepare for future callbacks for plugin's capabilites. More... | |
bool | get_availability () |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes. More... | |
std::string | get_version_id () |
Returns the version id of this plugin. More... | |
void | lookupFrontBumperTransform () |
Lookup transfrom from front bumper to base link. More... | |
void | mobilityOperationCb (carma_v2x_msgs::msg::MobilityOperation::UniquePtr msg) |
callback function for mobility operation More... | |
void | BSMCb (carma_v2x_msgs::msg::BSM::UniquePtr msg) |
BSM callback function. More... | |
void | parseStrategyParams (const std::string &strategy_params) |
parse strategy parameters More... | |
carma_v2x_msgs::msg::MobilityOperation | generateMobilityOperation () |
Generates Mobility Operation messages. More... | |
TurnDirection | getTurnDirectionAtIntersection (std::vector< lanelet::ConstLanelet > lanelets_list) |
Determine the turn direction at intersection. More... | |
void | publishMobilityOperation () |
Publish mobility operation at a fixed rate. More... | |
void | publishTrajectorySmoothingInfo () |
Publish trajectory smoothing info at a fixed rate. More... | |
Public Member Functions inherited from carma_guidance_plugins::StrategicPlugin | |
StrategicPlugin (const rclcpp::NodeOptions &) | |
StrategicPlugin constructor. More... | |
virtual | ~StrategicPlugin ()=default |
Virtual destructor for safe deletion. More... | |
virtual void | plan_maneuvers_callback (std::shared_ptr< rmw_request_id_t > srv_header, carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp)=0 |
Extending class provided callback which should return a planned trajectory based on the provided trajectory planning request. More... | |
std::string | get_capability () override |
Get the capability string representing this plugins capabilities Method must be overriden by extending classes. Expectation is that abstract plugin type parent classes will provide a default implementation. More... | |
uint8_t | get_type () override final |
Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum. Extending classes for the specific type should override this method. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_deactivate (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_cleanup (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_shutdown (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_error (const rclcpp_lifecycle::State &, const std::string &exception_string) override final |
Public Member Functions inherited from carma_guidance_plugins::PluginBaseNode | |
PluginBaseNode (const rclcpp::NodeOptions &) | |
PluginBaseNode constructor. More... | |
virtual | ~PluginBaseNode ()=default |
Virtual destructor for safe deletion. More... | |
virtual std::shared_ptr< carma_wm::WMListener > | get_world_model_listener () final |
Method to return the default world model listener provided as a convience by this base class If this method or get_world_model() are not called then the world model remains uninitialized and will not create unnecessary subscriptions. More... | |
virtual carma_wm::WorldModelConstPtr | get_world_model () final |
Method to return the default world model provided as a convience by this base class If this method or get_world_model_listener() are not called then the world model remains uninitialized and will not create unnecessary subscriptions. More... | |
virtual bool | get_activation_status () final |
Returns the activation status of this plugin. The plugins API callbacks will only be triggered when this method returns true. More... | |
virtual uint8_t | get_type () |
Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum. Extending classes for the specific type should override this method. More... | |
std::string | get_plugin_name_and_ns () const |
Return the name of this plugin with namespace. NOTE: If only the name of the plugin is required, use get_plugin_name() More... | |
std::string | get_plugin_name () const |
Return the name of this plugin. More... | |
virtual bool | get_availability ()=0 |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes. More... | |
virtual std::string | get_capability ()=0 |
Get the capability string representing this plugins capabilities Method must be overriden by extending classes. Expectation is that abstract plugin type parent classes will provide a default implementation. More... | |
virtual std::string | get_version_id ()=0 |
Returns the version id of this plugin. More... | |
virtual carma_ros2_utils::CallbackReturn | on_configure_plugin ()=0 |
Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states. This method should be used to load parameters and is required to be implemented. More... | |
virtual carma_ros2_utils::CallbackReturn | on_activate_plugin () |
Method which is triggered when this plugin is moved from the INACTIVE to ACTIVE states. This method should be used to prepare for future callbacks for plugin's capabilites. More... | |
virtual carma_ros2_utils::CallbackReturn | on_deactivate_plugin () |
Method which is triggered when this plugin is moved from the ACTIVE to INACTIVE states. This method should be used to disable any functionality which should cease execution when plugin is inactive. More... | |
virtual carma_ros2_utils::CallbackReturn | on_cleanup_plugin () |
Method which is triggered when this plugin is moved from the INACTIVE to UNCONFIGURED states. This method should be used to fully reset the plugin such that a future call to on_configure_plugin would leave the plugin in a fresh state as though just launched. More... | |
virtual carma_ros2_utils::CallbackReturn | on_shutdown_plugin () |
Method which is triggered when this plugin is moved from any state to FINALIZED This method should be used to generate any shutdown logs or final cleanup. More... | |
virtual carma_ros2_utils::CallbackReturn | on_error_plugin (const std::string &exception_string) |
Method which is triggered when an unhandled exception occurs in this plugin This method should be used to cleanup such that the plugin could be moved to UNCONFIGURED state if possible. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_deactivate (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_cleanup (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_shutdown (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_error (const rclcpp_lifecycle::State &, const std::string &exception_string) override |
FRIEND_TEST (carma_guidance_plugins_test, connections_test) | |
Private Member Functions | |
bool | isStateAllowedGreen (const lanelet::CarmaTrafficSignalState &state) const |
Method to check if the state is an allowed green movement state. Currently Permissive and Protected green are supported. More... | |
boost::posix_time::time_duration | getMovementAllowedDuration (lanelet::CarmaTrafficSignalPtr traffic_light) |
Returns the duration for the allowed movements. More... | |
void | planWhenUNAVAILABLE (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, const lanelet::CarmaTrafficSignalPtr &traffic_light, const lanelet::ConstLanelet &entry_lanelet, const lanelet::ConstLanelet &exit_lanelet, const lanelet::ConstLanelet ¤t_lanelet) |
Method for performing maneuver planning when the current plugin state is TransitState::UNAVAILABLE Therefor no maneuvers are planned but the system checks for the precense of traffic lights ahead of it. More... | |
void | planWhenAPPROACHING (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, const lanelet::CarmaTrafficSignalPtr &traffic_light, const lanelet::ConstLanelet &entry_lanelet, const lanelet::ConstLanelet &exit_lanelet, const lanelet::ConstLanelet ¤t_lanelet) |
Method for performing maneuver planning when the current plugin state is TransitState::APPROACHING Therefore the planned maneuvers deal with approaching a traffic light. More... | |
void | planWhenWAITING (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, const lanelet::CarmaTrafficSignalPtr &traffic_light, const lanelet::ConstLanelet &entry_lanelet, const lanelet::ConstLanelet &exit_lanelet, const lanelet::ConstLanelet ¤t_lanelet) |
Method for performing maneuver planning when the current plugin state is TransitState::WAITING Therefor the planned maneuvers deal with waiting at a red light. More... | |
void | planWhenDEPARTING (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, double intersection_end_downtrack, double intersection_speed_limit) |
Method for performing maneuver planning when the current plugin state is TransitState::DEPARTING Therefor the planned maneuvers deal with the transit of the intersection once the stop bar has been crossed. More... | |
boost::optional< bool > | canArriveAtGreenWithCertainty (const rclcpp::Time &light_arrival_time_by_algo, const lanelet::CarmaTrafficSignalPtr &traffic_light, bool check_late, bool check_early) const |
Return true if the car can arrive at given arrival time within green light time buffer. More... | |
carma_planning_msgs::msg::Maneuver | composeTrajectorySmoothingManeuverMessage (double start_dist, double end_dist, const std::vector< lanelet::ConstLanelet > &crossed_lanelets, double start_speed, double target_speed, rclcpp::Time start_time, rclcpp::Time end_time, const TrajectoryParams &tsp) const |
Compose a trajectory smoothing maneuver msg (sent as transit maneuver message) More... | |
carma_planning_msgs::msg::Maneuver | composeStopAndWaitManeuverMessage (double current_dist, double end_dist, double start_speed, const lanelet::Id &starting_lane_id, const lanelet::Id &ending_lane_id, rclcpp::Time start_time, rclcpp::Time end_time, double stopping_accel) const |
Compose a stop and wait maneuver message based on input params. More... | |
carma_planning_msgs::msg::Maneuver | composeIntersectionTransitMessage (double start_dist, double end_dist, double start_speed, double target_speed, rclcpp::Time start_time, rclcpp::Time end_time, const lanelet::Id &starting_lane_id, const lanelet::Id &ending_lane_id) const |
Compose a intersection transit maneuver message based on input params. More... | |
void | handleStopping (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, const lanelet::CarmaTrafficSignalPtr &traffic_light, const lanelet::ConstLanelet &entry_lanelet, const lanelet::ConstLanelet &exit_lanelet, const lanelet::ConstLanelet ¤t_lanelet, double traffic_light_down_track, bool is_emergency=false) |
This function returns stopping maneuver if the vehicle is able to stop at red and in safe stopping distance. Given the initial speed, ending speed (which is 0), and remaining_downtrack, this function checks if calculated remaining_time falls on RED. More... | |
void | handleGreenSignalScenario (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, double current_state_speed, const lanelet::CarmaTrafficSignalPtr &traffic_light, const lanelet::ConstLanelet &entry_lanelet, const lanelet::ConstLanelet &exit_lanelet, double traffic_light_down_track, const TrajectoryParams &ts_params, bool is_certainty_check_optional) |
This function returns valid maneuvers if the vehicle is able to utilize trajectory smoothing parameters to go through the intersection with certainty It utilizes canMakeWithCertainty function to determine if it is able to make it. Corresponds to TSCase 1-7. More... | |
void | handleCruisingUntilStop (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, double current_state_speed, const lanelet::CarmaTrafficSignalPtr &traffic_light, double traffic_light_down_track, const TrajectoryParams &ts_params) |
This function returns valid maneuvers if the vehicle is able to utilize trajectory smoothing parameters to go through the intersection with certainty It utilizes canMakeWithCertainty function to determine if it is able to make it. Corresponds to TSCase 1-7. More... | |
void | handleFailureCase (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp, const VehicleState ¤t_state, double current_state_speed, double speed_limit, double remaining_time, lanelet::Id exit_lanelet_id, const lanelet::CarmaTrafficSignalPtr &traffic_light, double traffic_light_down_track, const TrajectoryParams &ts_params) |
When the vehicle is not able to successfully run the algorithm or not able to stop, this function modifies departure speed as close as possible to the original using max comfortable accelerations with given distance. More... | |
TrajectoryParams | handleFailureCaseHelper (const lanelet::CarmaTrafficSignalPtr &traffic_light, double current_time, double starting_speed, double departure_speed, double speed_limit, double remaining_downtrack, double traffic_light_downtrack) |
Helper function to handleFailureCase that modifies ts_params to desired new parameters. See handleFailureCase. More... | |
bool | supportedLightState (lanelet::CarmaTrafficSignalState state) const |
Helper method to evaluate if the given traffic light state is supported by this plugin. More... | |
bool | validLightState (const boost::optional< std::pair< boost::posix_time::ptime, lanelet::CarmaTrafficSignalState > > &optional_state, const rclcpp::Time &source_time) const |
Helper method that checks both if the input optional light state is set and if the state it contains is supported via supportedLightState. More... | |
VehicleState | extractInitialState (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req) const |
Helper method to extract the initial vehicle state from the planning request method based on if the prior_plan was set or not. More... | |
std::vector< lanelet::ConstLanelet > | getLaneletsBetweenWithException (double start_downtrack, double end_downtrack, bool shortest_path_only=false, bool bounds_inclusive=true) const |
Helper method which calls carma_wm::WorldModel::getLaneletsBetween(start_downtrack, end_downtrack, shortest_path_only,
bounds_inclusive) and throws and exception if the returned list of lanelets is empty. See the referenced method for additional details on parameters. More... | |
std::tuple< rclcpp::Time, bool, bool > | get_final_entry_time_and_conditions (const VehicleState ¤t_state, const rclcpp::Time &earliest_entry_time, lanelet::CarmaTrafficSignalPtr traffic_light) |
Get the final entry time from either vehicle's own internal ET calculation (TSMO UC2) or from carma-street (TSMO UC3) This function also applies necessary green_buffer to adjust the ET. More... | |
std::optional< rclcpp::Time > | get_nearest_green_entry_time (const rclcpp::Time ¤t_time, const rclcpp::Time &earliest_entry_time, const lanelet::CarmaTrafficSignalPtr &signal, double minimum_required_green_time=0.0) const |
Provides the scheduled entry time for the vehicle in the future. This scheduled time is the earliest possible entry time that is during green phase and after timestamps both that is kinematically possible and required times for vehicle in front to pass through first Returns std::nullopt if no valid green entry time found. More... | |
rclcpp::Time | get_eet_or_tbd (const rclcpp::Time &earliest_entry_time, const lanelet::CarmaTrafficSignalPtr &signal) const |
Returns the later of earliest_entry_time or the end of the available signal states in the traffic_signal. More... | |
rclcpp::Duration | get_earliest_entry_time (double remaining_distance, double free_flow_speed, double current_speed, double departure_speed, double max_accel, double max_decel) const |
Gets the earliest entry time into the intersection that is kinematically possible for the vehicle. Designed to get it for motion that has maximum one acceleration, deceleration, or cruise segments until destination. More... | |
double | get_trajectory_smoothing_activation_distance (double time_remaining_at_free_flow, double full_cycle_duration, double current_speed, double speed_limit, double departure_speed, double max_accel, double max_decel) const |
Gets maximum distance (nearest downtrack) the trajectory smoothing algorithm makes difference than simple lane following within half of one full fixed cycle time boundary compared to free flow arrival time. More... | |
double | get_distance_to_accel_or_decel_twice (double free_flow_speed, double current_speed, double departure_speed, double max_accel, double max_decel) const |
Get required distance to accel then decel, or vise versa - each at least once - to reach departure_speed with given speed and acceleration parameters. More... | |
double | get_inflection_speed_value (double x, double x1, double x2, double free_flow_speed, double current_speed, double departure_speed, double max_accel, double max_decel) const |
Get the speed between the acceleration and deceleration pieces. More... | |
double | get_distance_to_accel_or_decel_once (double current_speed, double departure_speed, double max_accel, double max_decel) const |
Get required distance to accel or decel to reach departure_speed with given speed and acceleration parameters. More... | |
double | estimate_distance_to_stop (double v, double a) const |
Helper method to use basic kinematics to compute an estimated stopping distance from from the inputs. More... | |
double | estimate_time_to_stop (double d, double v) const |
Helper method to use basic kinematics to compute an estimated stopping time from from the inputs. More... | |
double | findSpeedLimit (const lanelet::ConstLanelet &llt) const |
Given a Lanelet, find it's associated Speed Limit. More... | |
double | calc_estimated_entry_time_left (double entry_dist, double current_speed, double departure_speed) const |
calculate the time vehicle will enter to intersection with optimal deceleration More... | |
BoundaryDistances | get_delta_x (double v0, double v1, double v_max, double v_min, double a_max, double a_min) |
Get boundary distances used to compare against current state in order to create trajectory smoothing parameters. More... | |
std::vector< TrajectoryParams > | get_boundary_traj_params (double t, double v0, double v1, double v_max, double v_min, double a_max, double a_min, double x0, double x_end, double dx, BoundaryDistances boundary_distances) |
Get all possible trajectory smoothing parameters for each segments. Later this will be used to generate a single trajectory. More... | |
void | print_params (TrajectoryParams params) |
Helper method to print TrajectoryParams. More... | |
void | print_boundary_distances (BoundaryDistances delta_xs) |
Helper method to print TrajectoryParams. More... | |
TrajectoryParams | ts_case1 (double t, double et, double v0, double v1, double v_max, double a_max, double a_min, double x0, double x_end, double dx) |
Trajectory Smoothing Algorithm 8 cases. TSMO UC2, UC3 algorithm equations. More... | |
TrajectoryParams | ts_case2 (double t, double et, double v0, double v1, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | ts_case3 (double t, double et, double v0, double v1, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | ts_case4 (double t, double et, double v0, double v1, double v_min, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | ts_case5 (double t, double et, double v0, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | ts_case6 (double t, double et, double v0, double v_min, double a_min, double x0, double x_end, double dx, double dx3, TrajectoryParams traj6) |
TrajectoryParams | ts_case7 (double t, double et, double v0, double v_min, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | ts_case8 (double dx, double dx5, TrajectoryParams traj8) |
TrajectoryParams | boundary_accel_or_decel_incomplete_upper (double t, double v0, double v1, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_accel_nocruise_notmaxspeed_decel (double t, double v0, double v1, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_accel_cruise_maxspeed_decel (double t, double v0, double v1, double v_max, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_accel_nocruise_maxspeed_decel (double t, double v0, double v1, double v_max, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_accel_or_decel_complete_upper (double t, double v0, double v1, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_nocruise_notminspeed_accel (double t, double v0, double v1, double v_min, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_nocruise_minspeed_accel_incomplete (double t, double v0, double v_min, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_nocruise_minspeed_accel_complete (double t, double v0, double v1, double v_max, double v_min, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_cruise_minspeed_accel (double t, double v0, double v1, double v_min, double a_max, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_cruise_minspeed (double t, double v0, double v_min, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_incomplete_lower (double t, double v0, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | boundary_decel_cruise_minspeed_decel (double t, double v0, double v_min, double a_min, double x0, double x_end, double dx) |
TrajectoryParams | get_ts_case (double t, double et, double v0, double v1, double v_max, double v_min, double a_max, double a_min, double x0, double x_end, double dx, BoundaryDistances boundary_distances, std::vector< TrajectoryParams > params) |
FRIEND_TEST (LCIStrategicTestFixture, getDiscoveryMsg) | |
FRIEND_TEST (LCIStrategicTestFixture, supportedLightState) | |
FRIEND_TEST (LCIStrategicTestFixture, estimate_distance_to_stop) | |
FRIEND_TEST (LCIStrategicTestFixture, estimate_time_to_stop) | |
FRIEND_TEST (LCIStrategicTestFixture, extractInitialState) | |
FRIEND_TEST (LCIStrategicTestFixture, DISABLED_extractInitialState) | |
FRIEND_TEST (LCIStrategicTestFixture, validLightState) | |
FRIEND_TEST (LCIStrategicTestFixture, getLaneletsBetweenWithException) | |
FRIEND_TEST (LCIStrategicTestFixture, composeStopAndWaitManeuverMessage) | |
FRIEND_TEST (LCIStrategicTestFixture, composeIntersectionTransitMessage) | |
FRIEND_TEST (LCIStrategicTestFixture, composeTrajectorySmoothingManeuverMessage) | |
FRIEND_TEST (LCIStrategicTestFixture, handleFailureCaseHelper) | |
FRIEND_TEST (LCIStrategicTestFixture, planWhenETInTBD) | |
FRIEND_TEST (LCIStrategicTestFixture, calc_estimated_entry_time_left) | |
FRIEND_TEST (LCIStrategicTestFixture, get_distance_to_accel_or_decel_twice) | |
FRIEND_TEST (LCIStrategicTestFixture, get_distance_to_accel_or_decel_once) | |
FRIEND_TEST (LCIStrategicTestFixture, get_nearest_green_entry_time) | |
FRIEND_TEST (LCIStrategicTestFixture, get_eet_or_tbd) | |
FRIEND_TEST (LCIStrategicTestFixture, get_earliest_entry_time) | |
FRIEND_TEST (LCIStrategicTestFixture, handleFailureCase) | |
FRIEND_TEST (LCIStrategicTestFixture, handleStopping) | |
FRIEND_TEST (LCIStrategicTestFixture, planManeuverCb) | |
FRIEND_TEST (LCIStrategicTestFixture, DISABLED_planManeuverCb) | |
FRIEND_TEST (LCIStrategicPluginTest, parseStrategyParamstest) | |
FRIEND_TEST (LCIStrategicPluginTest, moboperationcbtest) | |
FRIEND_TEST (LCIStrategicTestFixture, findSpeedLimit) | |
FRIEND_TEST (LCIStrategicTestFixture, DISABLED_planWhenETInTBD) | |
Private Attributes | |
unsigned long long | street_msg_timestamp_ = 0 |
unsigned long long | scheduled_enter_time_ = 0 |
std::string | previous_strategy_params_ = "" |
std::string | upcoming_id_ = "" |
std::string | bsm_id_ = "default_bsm_id" |
uint8_t | bsm_msg_count_ = 0 |
uint16_t | bsm_sec_mark_ = 0 |
double | max_comfort_accel_ = 2.0 |
double | max_comfort_decel_ = -2.0 |
double | max_comfort_decel_norm_ = -1 * max_comfort_decel_ |
double | emergency_decel_norm_ = -2 * max_comfort_decel_ |
boost::optional< rclcpp::Time > | nearest_green_entry_time_cached_ |
TSCase | last_case_num_ = TSCase::UNAVAILABLE |
Useful metrics for LCI Plugin. More... | |
double | distance_remaining_to_tf_ = 0.0 |
double | earliest_entry_time_ = 0.0 |
double | scheduled_entry_time_ = 0.0 |
TurnDirection | intersection_turn_direction_ = TurnDirection::Straight |
bool | approaching_light_controlled_intersection_ = false |
LCIStrategicPluginConfig | config_ |
Config containing configurable algorithm parameters. More... | |
LCIStrategicStateTransitionTable | transition_table_ |
State Machine Transition table. More... | |
boost::optional< double > | intersection_speed_ |
Cache variables for storing the current intersection state between state machine transitions. More... | |
boost::optional< double > | intersection_end_downtrack_ |
std::string | light_controlled_intersection_strategy_ = "Carma/signalized_intersection" |
tf2_ros::Buffer | tf2_buffer_ |
std::unique_ptr< tf2_ros::TransformListener > | tf2_listener_ |
tf2::Stamped< tf2::Transform > | frontbumper_transform_ |
double | length_to_front_bumper_ = 3.0 |
double | epsilon_ = 0.001 |
double | accel_epsilon_ = 0.0001 |
carma_wm::WorldModelConstPtr | wm_ |
World Model pointer. More... | |
rclcpp::TimerBase::SharedPtr | mob_op_pub_timer_ |
rclcpp::TimerBase::SharedPtr | ts_info_pub_timer_ |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityOperation > | mob_operation_sub_ |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::BSM > | bsm_sub_ |
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityOperation > | mobility_operation_pub_ |
carma_ros2_utils::PubPtr< std_msgs::msg::Int8 > | case_pub_ |
carma_ros2_utils::PubPtr< std_msgs::msg::Float64 > | tf_distance_pub_ |
carma_ros2_utils::PubPtr< std_msgs::msg::Float64 > | earliest_et_pub_ |
carma_ros2_utils::PubPtr< std_msgs::msg::Float64 > | et_pub_ |
Definition at line 112 of file lci_strategic_plugin.hpp.
|
explicit |
Default constructor for RouteFollowingPlugin class.
Definition at line 42 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::LCIStrategicPluginConfig::algo_minimum_speed, config_, lci_strategic_plugin::LCIStrategicPluginConfig::deceleration_fraction, lci_strategic_plugin::LCIStrategicPluginConfig::desired_distance_to_stop_buffer, emergency_decel_norm_, lci_strategic_plugin::LCIStrategicPluginConfig::enable_carma_streets_connection, lci_strategic_plugin::LCIStrategicPluginConfig::green_light_time_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::intersection_transit_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::lane_following_plugin_name, max_comfort_accel_, max_comfort_decel_, max_comfort_decel_norm_, lci_strategic_plugin::LCIStrategicPluginConfig::min_approach_distance, lci_strategic_plugin::LCIStrategicPluginConfig::min_maneuver_planning_period, lci_strategic_plugin::LCIStrategicPluginConfig::mobility_rate, lci_strategic_plugin::LCIStrategicPluginConfig::stop_and_wait_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::stopping_location_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::strategic_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::trajectory_smoothing_activation_distance, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit_multiplier, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit_multiplier, and lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_id.
|
private |
Definition at line 1059 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1087 of file lci_strategic_plugin_algo.cpp.
References accel_epsilon_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, and carma_cooperative_perception::to_string().
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1027 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1138 of file lci_strategic_plugin_algo.cpp.
References epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, and carma_cooperative_perception::to_string().
Referenced by get_boundary_traj_params().
|
private |
Definition at line 984 of file lci_strategic_plugin_algo.cpp.
References epsilon_, and lci_strategic_plugin::TrajectoryParams::t0_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1299 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1271 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1353 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1326 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::t0_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1232 of file lci_strategic_plugin_algo.cpp.
References epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, and carma_cooperative_perception::to_string().
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1202 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
|
private |
Definition at line 1173 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_boundary_traj_params().
void lci_strategic_plugin::LCIStrategicPlugin::BSMCb | ( | carma_v2x_msgs::msg::BSM::UniquePtr | msg | ) |
BSM callback function.
Definition at line 1174 of file lci_strategic_plugin.cpp.
References bsm_id_, bsm_msg_count_, and bsm_sec_mark_.
Referenced by on_configure_plugin().
|
private |
calculate the time vehicle will enter to intersection with optimal deceleration
entry_dist | distance to stop line |
current_speed | current speed of vehicle |
departure_speed | speed to get into the intersection |
Definition at line 452 of file lci_strategic_plugin_algo.cpp.
|
private |
Return true if the car can arrive at given arrival time within green light time buffer.
light_arrival_time_by_algo | ROS time at green where vehicle arrives |
traffic_light | Traffic signal to check time against |
check_late | check late arrival, default true |
check_early | check early arrival, default true |
NOTE: internally uses config_.green_light_time_buffer NOTE: boost::none optional if any of the light state was invalid
Definition at line 298 of file lci_strategic_plugin.cpp.
References config_, lci_strategic_plugin::LCIStrategicPluginConfig::green_light_time_buffer, isStateAllowedGreen(), carma_cooperative_perception::to_string(), and validLightState().
Referenced by handleGreenSignalScenario(), and planWhenWAITING().
|
private |
Compose a intersection transit maneuver message based on input params.
start_dist | Start downtrack distance of the current maneuver |
end_dist | End downtrack distance of the current maneuver |
start_speed | Start speed of the current maneuver |
target_speed | Target speed pf the current maneuver, usually it is the lanelet speed limit |
start_time | The starting time of the maneuver |
end_time | The ending time of the maneuver |
starting_lane_id | The starting lanelet id of this maneuver |
ending_lane_id | The ending lanelet id of this maneuver |
Definition at line 1509 of file lci_strategic_plugin.cpp.
References config_, lci_strategic_plugin::LCIStrategicPluginConfig::intersection_transit_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().
Referenced by handleFailureCase(), handleGreenSignalScenario(), and planWhenDEPARTING().
|
private |
Compose a stop and wait maneuver message based on input params.
current_dist | Start downtrack distance of the current maneuver |
end_dist | End downtrack distance of the current maneuver |
start_speed | Start speed of the current maneuver |
starting_lane_id | The starting lanelet id of this maneuver |
ending_lane_id | The ending lanelet id of this maneuver |
start_time | The starting time of the maneuver |
end_time | The ending time of the maneuver |
stopping_accel | Acceleration used for calculating the stopping distance |
Definition at line 1476 of file lci_strategic_plugin.cpp.
References config_, lci_strategic_plugin::LCIStrategicPluginConfig::stop_and_wait_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::stopping_location_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().
Referenced by handleCruisingUntilStop(), handleStopping(), and planWhenWAITING().
|
private |
Compose a trajectory smoothing maneuver msg (sent as transit maneuver message)
start_dist | Start downtrack distance of the current maneuver |
end_dist | End downtrack distance of the current maneuver |
start_speed | Start speed of the current maneuver |
target_speed | Target speed pf the current maneuver, usually it is the lanelet speed limit |
start_time | The starting time of the maneuver |
end_time | The ending time of the maneuver |
tsp | Trajectory Smoothing parameters needed to modify speed profile |
Definition at line 1425 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::case_num, config_, lci_strategic_plugin::TrajectoryParams::is_algorithm_successful, lci_strategic_plugin::LCIStrategicPluginConfig::lane_following_plugin_name, light_controlled_intersection_strategy_, lci_strategic_plugin::LCIStrategicPluginConfig::strategic_plugin_name, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by handleCruisingUntilStop(), handleFailureCase(), and handleGreenSignalScenario().
|
private |
Helper method to use basic kinematics to compute an estimated stopping distance from from the inputs.
v | The initial velocity in m/s |
a | The deceleration in m/s^2 |
Definition at line 24 of file lci_strategic_plugin_algo.cpp.
Referenced by planWhenUNAVAILABLE().
|
private |
Helper method to use basic kinematics to compute an estimated stopping time from from the inputs.
d | The distance to travel in meters |
v | The initial velocity in m/s |
Definition at line 29 of file lci_strategic_plugin_algo.cpp.
|
private |
Helper method to extract the initial vehicle state from the planning request method based on if the prior_plan was set or not.
req | The maneuver planning request to extract the vehicle state from |
Definition at line 236 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, GET_MANEUVER_PROPERTY, getLaneletsBetweenWithException(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::lane_id, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::speed, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, and carma_cooperative_perception::to_string().
Referenced by plan_maneuvers_callback().
|
private |
Given a Lanelet, find it's associated Speed Limit.
llt | Constant Lanelet object |
std::invalid_argument | if the speed limit could not be retrieved |
Definition at line 264 of file lci_strategic_plugin.cpp.
References wm_.
Referenced by planWhenAPPROACHING(), and planWhenUNAVAILABLE().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
carma_v2x_msgs::msg::MobilityOperation lci_strategic_plugin::LCIStrategicPlugin::generateMobilityOperation | ( | ) |
Generates Mobility Operation messages.
Definition at line 1201 of file lci_strategic_plugin.cpp.
References bsm_id_, bsm_msg_count_, bsm_sec_mark_, config_, intersection_turn_direction_, lci_strategic_plugin::Left, light_controlled_intersection_strategy_, lci_strategic_plugin::LCIStrategicPluginConfig::min_gap, lci_strategic_plugin::LCIStrategicPluginConfig::reaction_time, lci_strategic_plugin::Right, carma_cooperative_perception::to_string(), upcoming_id_, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit_multiplier, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit_multiplier, and lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_id.
Referenced by publishMobilityOperation().
|
virtual |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 1545 of file lci_strategic_plugin.cpp.
|
private |
Get all possible trajectory smoothing parameters for each segments. Later this will be used to generate a single trajectory.
t | current time in seconds |
v0 | starting_speed |
v1 | departure_speed |
v_max | speed_limit |
v_min | minimum speed |
a_max | max_comfort_acceleration limit |
a_min | max_comfort_deceleration limit |
x0 | current_downtrack |
x_end | traffic_light_down_track |
dx | distance_remaining_to_traffic_light |
boundary_distances | boundary_distances to compare against current state |
Definition at line 514 of file lci_strategic_plugin_algo.cpp.
References boundary_accel_cruise_maxspeed_decel(), boundary_accel_nocruise_maxspeed_decel(), boundary_accel_nocruise_notmaxspeed_decel(), boundary_accel_or_decel_complete_upper(), boundary_accel_or_decel_incomplete_upper(), boundary_decel_cruise_minspeed(), boundary_decel_cruise_minspeed_accel(), boundary_decel_cruise_minspeed_decel(), boundary_decel_incomplete_lower(), boundary_decel_nocruise_minspeed_accel_complete(), boundary_decel_nocruise_minspeed_accel_incomplete(), boundary_decel_nocruise_notminspeed_accel(), lci_strategic_plugin::BoundaryDistances::dx1, lci_strategic_plugin::BoundaryDistances::dx2, lci_strategic_plugin::BoundaryDistances::dx3, lci_strategic_plugin::BoundaryDistances::dx4, and lci_strategic_plugin::BoundaryDistances::dx5.
Referenced by planWhenAPPROACHING().
|
private |
Get boundary distances used to compare against current state in order to create trajectory smoothing parameters.
v0 | starting_speed |
v1 | departure_speed |
v_max | speed_limit |
v_min | minimum speed |
a_max | max_comfort_acceleration limit |
a_min | max_comfort_deceleration limit |
Definition at line 462 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::BoundaryDistances::dx1, lci_strategic_plugin::BoundaryDistances::dx2, lci_strategic_plugin::BoundaryDistances::dx3, lci_strategic_plugin::BoundaryDistances::dx4, and lci_strategic_plugin::BoundaryDistances::dx5.
Referenced by planWhenAPPROACHING().
|
private |
Get required distance to accel or decel to reach departure_speed with given speed and acceleration parameters.
current_speed | Current speed in m/s |
departure_speed | Speed to enter into the intersection in m/s |
max_accel | Acceleration rate during acceleration segment in m/s^2 |
max_decel | Deceleration rate during acceleration segment in m/s^2 |
Definition at line 40 of file lci_strategic_plugin_algo.cpp.
References epsilon_.
Referenced by get_earliest_entry_time().
|
private |
Get required distance to accel then decel, or vise versa - each at least once - to reach departure_speed with given speed and acceleration parameters.
free_flow_speed | Free flow speed in m/s (usually the speed limit) |
current_speed | Current speed in m/s |
departure_speed | Speed to enter into the intersection in m/s |
max_accel | Acceleration rate during acceleration segment in m/s^2 |
max_decel | Deceleration rate during acceleration segment in m/s^2 |
Definition at line 34 of file lci_strategic_plugin_algo.cpp.
Referenced by get_earliest_entry_time().
|
private |
Gets the earliest entry time into the intersection that is kinematically possible for the vehicle. Designed to get it for motion that has maximum one acceleration, deceleration, or cruise segments until destination.
remaining_distance | Distance to the intersection in meters |
free_flow_speed | Free flow speed along the route until the intersection (usually speed_limit) in m/s |
current_speed | Current speed in m/s |
departure_speed | Speed into the intersection in m/s. A.k.a target speed at the intersection |
max_accel | The acceleration in m/s^2 of the acceleration segment |
max_decel | The deceleration in m/s^2 of the deceleration segment |
Definition at line 191 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::LCIStrategicPluginConfig::algo_minimum_speed, config_, epsilon_, get_distance_to_accel_or_decel_once(), get_distance_to_accel_or_decel_twice(), get_inflection_speed_value(), and process_traj_logs::x.
Referenced by planWhenAPPROACHING().
|
private |
Returns the later of earliest_entry_time or the end of the available signal states in the traffic_signal.
earliest_entry_time | Earliest ROS entry time into the intersection kinematically possible |
signal | CARMATrafficSignal that is responsible for the intersection along route |
Definition at line 52 of file lci_strategic_plugin_algo.cpp.
References EPSILON, and carma_cooperative_perception::to_string().
Referenced by get_final_entry_time_and_conditions().
|
private |
Get the final entry time from either vehicle's own internal ET calculation (TSMO UC2) or from carma-street (TSMO UC3) This function also applies necessary green_buffer to adjust the ET.
current_state | Current state of the vehicle |
earliest_entry_time | Earliest entry time calculated by the vehicle |
traffic_light | traffic signal the vehicle is using |
Definition at line 264 of file lci_strategic_plugin_algo.cpp.
References config_, lci_strategic_plugin::LCIStrategicPluginConfig::enable_carma_streets_connection, EPSILON, get_eet_or_tbd(), get_nearest_green_entry_time(), getMovementAllowedDuration(), lci_strategic_plugin::LCIStrategicPluginConfig::green_light_time_buffer, process_bag::i, isStateAllowedGreen(), nearest_green_entry_time_cached_, scheduled_enter_time_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, carma_cooperative_perception::to_string(), and validLightState().
Referenced by planWhenAPPROACHING().
|
private |
Get the speed between the acceleration and deceleration pieces.
x | Distance remaining in meters |
x1 | Required distance to accel then decel, or vise versa-each at least once-to reach departure_speed with given speed and acceleration parameters |
x2 | required distance to accel or decel to reach departure_speed with given speed and acceleration parameters |
free_flow_speed | Free flow speed in m/s (usually the speed limit) |
current_speed | Current speed in m/s |
departure_speed | Speed to enter into the intersection in m/s |
max_accel | Acceleration rate during acceleration segment in m/s^2 |
max_decel | Deceleration rate during acceleration segment in m/s^2 NOTE: note that this returns departure speed if x < x2 since vehicle's trajectory corresponding to its EET would contain only one acceleration or deceleration piece |
Definition at line 428 of file lci_strategic_plugin_algo.cpp.
References process_traj_logs::x.
Referenced by get_earliest_entry_time().
|
private |
Provides the scheduled entry time for the vehicle in the future. This scheduled time is the earliest possible entry time that is during green phase and after timestamps both that is kinematically possible and required times for vehicle in front to pass through first Returns std::nullopt if no valid green entry time found.
current_time | Current state's ROS time |
earliest_entry_time | Earliest ROS entry time into the intersection kinematically possible |
signal | CARMATrafficSignal that is responsible for the intersection along route |
minimum_required_green_time | Minimum seconds required by other vehicles in front to pass through the intersection first |
Definition at line 66 of file lci_strategic_plugin_algo.cpp.
References isStateAllowedGreen(), and carma_cooperative_perception::to_string().
Referenced by get_final_entry_time_and_conditions().
|
private |
Gets maximum distance (nearest downtrack) the trajectory smoothing algorithm makes difference than simple lane following within half of one full fixed cycle time boundary compared to free flow arrival time.
time_remaining_at_free_flow | Free flow arrival at the intersection |
full_cycle_duration | One fixed cycle of the signal |
current_speed | Current speed in m/s |
speed_limit | Speed limit speed in m/s |
departure_speed | Speed into the intersection in m/s. A.k.a target speed at the intersection |
max_accel | The acceleration in m/s^2 of the acceleration segment |
max_decel | The deceleration in m/s^2 of the deceleration segment |
Definition at line 157 of file lci_strategic_plugin_algo.cpp.
References epsilon_.
|
private |
Definition at line 589 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::CASE_1, lci_strategic_plugin::CASE_2, lci_strategic_plugin::CASE_3, lci_strategic_plugin::CASE_4, lci_strategic_plugin::CASE_5, lci_strategic_plugin::CASE_6, lci_strategic_plugin::CASE_7, lci_strategic_plugin::CASE_8, lci_strategic_plugin::TrajectoryParams::case_num, lci_strategic_plugin::BoundaryDistances::dx1, lci_strategic_plugin::BoundaryDistances::dx2, lci_strategic_plugin::BoundaryDistances::dx3, lci_strategic_plugin::BoundaryDistances::dx4, lci_strategic_plugin::BoundaryDistances::dx5, lci_strategic_plugin::TrajectoryParams::is_algorithm_successful, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), ts_case1(), ts_case2(), ts_case3(), ts_case4(), ts_case5(), ts_case6(), ts_case7(), and ts_case8().
Referenced by planWhenAPPROACHING().
|
virtual |
Returns the version id of this plugin.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 1550 of file lci_strategic_plugin.cpp.
|
private |
Helper method which calls carma_wm::WorldModel::getLaneletsBetween(start_downtrack, end_downtrack, shortest_path_only, bounds_inclusive) and throws and exception if the returned list of lanelets is empty. See the referenced method for additional details on parameters.
Definition at line 346 of file lci_strategic_plugin.cpp.
References carma_cooperative_perception::to_string(), and wm_.
Referenced by extractInitialState(), handleCruisingUntilStop(), handleFailureCase(), handleGreenSignalScenario(), handleStopping(), and planWhenDEPARTING().
|
private |
Returns the duration for the allowed movements.
traffic_light | The traffic light object to get the green duration for |
Definition at line 253 of file lci_strategic_plugin_algo.cpp.
Referenced by get_final_entry_time_and_conditions().
TurnDirection lci_strategic_plugin::LCIStrategicPlugin::getTurnDirectionAtIntersection | ( | std::vector< lanelet::ConstLanelet > | lanelets_list | ) |
Determine the turn direction at intersection.
lanelets_list | List of lanelets crossed around the intersection area |
Definition at line 1226 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::Left, lci_strategic_plugin::Right, and lci_strategic_plugin::Straight.
Referenced by planWhenAPPROACHING().
|
private |
This function returns valid maneuvers if the vehicle is able to utilize trajectory smoothing parameters to go through the intersection with certainty It utilizes canMakeWithCertainty function to determine if it is able to make it. Corresponds to TSCase 1-7.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | Current state of the vehicle | |
current_state_speed | The current speed to use when planning | |
traffic_light | CarmaTrafficSignalPtr of the relevant signal | |
traffic_light_down_track | Downtrack to the given traffic_light | |
ts_params | trajectory smoothing params |
Definition at line 438 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::CASE_8, lci_strategic_plugin::TrajectoryParams::case_num, composeStopAndWaitManeuverMessage(), composeTrajectorySmoothingManeuverMessage(), config_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, getLaneletsBetweenWithException(), lci_strategic_plugin::TrajectoryParams::is_algorithm_successful, lci_strategic_plugin::LCIStrategicPluginConfig::min_maneuver_planning_period, and lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp.
Referenced by planWhenAPPROACHING().
|
private |
When the vehicle is not able to successfully run the algorithm or not able to stop, this function modifies departure speed as close as possible to the original using max comfortable accelerations with given distance.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | Current state of the vehicle | |
current_state_speed | The current speed to use when planning | |
speed_limit | Speed limit to cap the speed | |
remaining_time | Remaining time until scheduled entry | |
exit_lanelet_id | Id of the exit lanelet | |
traffic_light | CarmaTrafficSignalPtr of the relevant signal | |
traffic_light_down_track | Downtrack to the given traffic_light | |
ts_params | trajectory smoothing params |
Definition at line 399 of file lci_strategic_plugin.cpp.
References composeIntersectionTransitMessage(), composeTrajectorySmoothingManeuverMessage(), lci_strategic_plugin::DEGRADED_TSCASE, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, getLaneletsBetweenWithException(), handleFailureCaseHelper(), intersection_end_downtrack_, intersection_speed_, last_case_num_, and lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp.
Referenced by planWhenAPPROACHING().
|
private |
Helper function to handleFailureCase that modifies ts_params to desired new parameters. See handleFailureCase.
starting_speed | starting speed |
departure_speed | departure_speed originally planned |
speed_limit | speed_limit |
remaining_downtrack | remaining_downtrack until the intersection |
traffic_light_downtrack | traffic_light_downtrack when vehicle is scheduled to enter |
Definition at line 526 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::CASE_1, lci_strategic_plugin::TrajectoryParams::case_num, EPSILON, epsilon_, lci_strategic_plugin::TrajectoryParams::is_algorithm_successful, isStateAllowedGreen(), max_comfort_accel_, max_comfort_decel_, lci_strategic_plugin::TrajectoryParams::modified_departure_speed, lci_strategic_plugin::TrajectoryParams::modified_remaining_time, print_params(), lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, validLightState(), lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by handleFailureCase().
|
private |
This function returns valid maneuvers if the vehicle is able to utilize trajectory smoothing parameters to go through the intersection with certainty It utilizes canMakeWithCertainty function to determine if it is able to make it. Corresponds to TSCase 1-7.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | Current state of the vehicle | |
current_state_speed | The current speed to use when planning | |
traffic_light | CarmaTrafficSignalPtr of the relevant signal | |
entry_lanelet | Entry lanelet in to the intersection along route | |
exit_lanelet | Exit lanelet in to the intersection along route | |
traffic_light_down_track | Downtrack to the given traffic_light | |
ts_params | trajectory smoothing params |
Definition at line 481 of file lci_strategic_plugin.cpp.
References canArriveAtGreenWithCertainty(), lci_strategic_plugin::CASE_8, lci_strategic_plugin::TrajectoryParams::case_num, composeIntersectionTransitMessage(), composeTrajectorySmoothingManeuverMessage(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, getLaneletsBetweenWithException(), intersection_end_downtrack_, intersection_speed_, lci_strategic_plugin::TrajectoryParams::is_algorithm_successful, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), and lci_strategic_plugin::TrajectoryParams::v3_.
Referenced by planWhenAPPROACHING().
|
private |
This function returns stopping maneuver if the vehicle is able to stop at red and in safe stopping distance. Given the initial speed, ending speed (which is 0), and remaining_downtrack, this function checks if calculated remaining_time falls on RED.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | Current state of the vehicle | |
traffic_light | CarmaTrafficSignalPtr of the relevant signal | |
entry_lanelet | Entry lanelet in to the intersection along route | |
exit_lanelet | Exit lanelet in to the intersection along route | |
current_lanelet | Current lanelet | |
traffic_light_down_track | Downtrack to the given traffic_light | |
is_emergency | if enabled, double the deceleration rate of max_comfort_accel is used |
Definition at line 364 of file lci_strategic_plugin.cpp.
References composeStopAndWaitManeuverMessage(), config_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, emergency_decel_norm_, lci_strategic_plugin::EMERGENCY_STOPPING, getLaneletsBetweenWithException(), last_case_num_, max_comfort_decel_norm_, lci_strategic_plugin::LCIStrategicPluginConfig::min_maneuver_planning_period, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::speed, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, and lci_strategic_plugin::STOPPING.
Referenced by planWhenAPPROACHING().
|
private |
Method to check if the state is an allowed green movement state. Currently Permissive and Protected green are supported.
state | The traffic signal state to check for |
Definition at line 341 of file lci_strategic_plugin.cpp.
Referenced by canArriveAtGreenWithCertainty(), get_final_entry_time_and_conditions(), get_nearest_green_entry_time(), handleFailureCaseHelper(), and planWhenWAITING().
void lci_strategic_plugin::LCIStrategicPlugin::lookupFrontBumperTransform | ( | ) |
Lookup transfrom from front bumper to base link.
Definition at line 219 of file lci_strategic_plugin.cpp.
References length_to_front_bumper_, tf2_buffer_, and tf2_listener_.
Referenced by on_configure_plugin().
void lci_strategic_plugin::LCIStrategicPlugin::mobilityOperationCb | ( | carma_v2x_msgs::msg::MobilityOperation::UniquePtr | msg | ) |
callback function for mobility operation
msg | input mobility operation msg |
Definition at line 1155 of file lci_strategic_plugin.cpp.
References approaching_light_controlled_intersection_, config_, light_controlled_intersection_strategy_, parseStrategyParams(), previous_strategy_params_, street_msg_timestamp_, and lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_id.
Referenced by on_configure_plugin().
|
virtual |
Method which is triggered when this plugin is moved from the INACTIVE to ACTIVE states. This method should be used to prepare for future callbacks for plugin's capabilites.
Reimplemented from carma_guidance_plugins::PluginBaseNode.
Definition at line 178 of file lci_strategic_plugin.cpp.
References config_, mob_op_pub_timer_, lci_strategic_plugin::LCIStrategicPluginConfig::mobility_rate, publishMobilityOperation(), publishTrajectorySmoothingInfo(), and ts_info_pub_timer_.
|
virtual |
Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states. This method should be used to load parameters and is required to be implemented.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 73 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::LCIStrategicPluginConfig::algo_minimum_speed, bsm_sub_, BSMCb(), case_pub_, config_, lci_strategic_plugin::LCIStrategicPluginConfig::deceleration_fraction, lci_strategic_plugin::LCIStrategicPluginConfig::desired_distance_to_stop_buffer, earliest_et_pub_, emergency_decel_norm_, lci_strategic_plugin::LCIStrategicPluginConfig::enable_carma_streets_connection, et_pub_, carma_guidance_plugins::PluginBaseNode::get_world_model(), lci_strategic_plugin::LCIStrategicPluginConfig::green_light_time_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::intersection_transit_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::lane_following_plugin_name, lookupFrontBumperTransform(), max_comfort_accel_, max_comfort_decel_, max_comfort_decel_norm_, lci_strategic_plugin::LCIStrategicPluginConfig::min_approach_distance, lci_strategic_plugin::LCIStrategicPluginConfig::min_maneuver_planning_period, mob_operation_sub_, mobility_operation_pub_, lci_strategic_plugin::LCIStrategicPluginConfig::mobility_rate, mobilityOperationCb(), parameter_update_callback(), lci_strategic_plugin::LCIStrategicPluginConfig::stop_and_wait_plugin_name, lci_strategic_plugin::LCIStrategicPluginConfig::stopping_location_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::strategic_plugin_name, tf_distance_pub_, lci_strategic_plugin::LCIStrategicPluginConfig::trajectory_smoothing_activation_distance, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit_multiplier, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit_multiplier, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_id, and wm_.
rcl_interfaces::msg::SetParametersResult lci_strategic_plugin::LCIStrategicPlugin::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Callback for dynamic parameter updates.
Definition at line 135 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::LCIStrategicPluginConfig::algo_minimum_speed, config_, lci_strategic_plugin::LCIStrategicPluginConfig::deceleration_fraction, lci_strategic_plugin::LCIStrategicPluginConfig::desired_distance_to_stop_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::green_light_time_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::min_approach_distance, lci_strategic_plugin::LCIStrategicPluginConfig::min_maneuver_planning_period, lci_strategic_plugin::LCIStrategicPluginConfig::mobility_rate, lci_strategic_plugin::LCIStrategicPluginConfig::stopping_location_buffer, lci_strategic_plugin::LCIStrategicPluginConfig::trajectory_smoothing_activation_distance, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit_multiplier, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit, and lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit_multiplier.
Referenced by on_configure_plugin().
void lci_strategic_plugin::LCIStrategicPlugin::parseStrategyParams | ( | const std::string & | strategy_params | ) |
parse strategy parameters
strategy_params | input string of strategy params from mob op msg |
Definition at line 1182 of file lci_strategic_plugin.cpp.
References nearest_green_entry_time_cached_, scheduled_enter_time_, and process_traj_logs::split.
Referenced by mobilityOperationCb().
|
virtual |
Service callback for arbitrator maneuver planning.
req | Plan maneuver request |
resp | Plan maneuver response with a list of maneuver plan |
Implements carma_guidance_plugins::StrategicPlugin.
Definition at line 1266 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::APPROACHING, approaching_light_controlled_intersection_, config_, lci_strategic_plugin::DEPARTING, lci_strategic_plugin::LCIStrategicPluginConfig::enable_carma_streets_connection, extractInitialState(), lci_strategic_plugin::LCIStrategicStateTransitionTable::getState(), intersection_end_downtrack_, intersection_speed_, planWhenAPPROACHING(), planWhenDEPARTING(), planWhenUNAVAILABLE(), planWhenWAITING(), scheduled_enter_time_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, transition_table_, lci_strategic_plugin::UNAVAILABLE, upcoming_id_, lci_strategic_plugin::WAITING, and wm_.
|
private |
Method for performing maneuver planning when the current plugin state is TransitState::APPROACHING Therefore the planned maneuvers deal with approaching a traffic light.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | The current state of the vehicle at the start of planning | |
traffic_light | The single traffic light along the vehicle's route in the intersection that is relevant and in front of the vehicle | |
entry_lanelet | The entry lanelet into the intersection | |
exit_lanelet | The exit lanelet into the intersection | |
current_lanelet | The current lanelet the vehicle's state is on |
if | given entry_lanelet doesn't have stop_line or speed profile case number was failed to be calculated NOTE: if there is empty traffic_light, it signals that the vehicle has crossed the bar, or if invalid light state is given |
Definition at line 817 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::LCIStrategicPluginConfig::algo_minimum_speed, lci_strategic_plugin::CASE_8, lci_strategic_plugin::TrajectoryParams::case_num, config_, lci_strategic_plugin::CROSSED_STOP_BAR, lci_strategic_plugin::LCIStrategicPluginConfig::deceleration_fraction, lci_strategic_plugin::LCIStrategicPluginConfig::desired_distance_to_stop_buffer, distance_remaining_to_tf_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, earliest_entry_time_, emergency_decel_norm_, lci_strategic_plugin::EMERGENCY_STOPPING, epsilon_, findSpeedLimit(), get_boundary_traj_params(), get_delta_x(), get_earliest_entry_time(), get_final_entry_time_and_conditions(), get_ts_case(), getTurnDirectionAtIntersection(), handleCruisingUntilStop(), handleFailureCase(), handleGreenSignalScenario(), handleStopping(), intersection_end_downtrack_, intersection_speed_, intersection_turn_direction_, lci_strategic_plugin::TrajectoryParams::is_algorithm_successful, last_case_num_, max_comfort_accel_, max_comfort_decel_, max_comfort_decel_norm_, print_boundary_distances(), print_params(), scheduled_entry_time_, lci_strategic_plugin::LCIStrategicStateTransitionTable::signal(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::speed, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, lci_strategic_plugin::STOPPED, lci_strategic_plugin::STOPPING, lci_strategic_plugin::LCIStrategicPluginConfig::stopping_location_buffer, carma_cooperative_perception::to_string(), transition_table_, lci_strategic_plugin::UNAVAILABLE, validLightState(), and wm_.
Referenced by plan_maneuvers_callback().
|
private |
Method for performing maneuver planning when the current plugin state is TransitState::DEPARTING Therefor the planned maneuvers deal with the transit of the intersection once the stop bar has been crossed.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | The current state of the vehicle at the start of planning | |
intersection_end_downtrack | The ending downtrack in meters of the current intersection | |
intersection_speed_limit | The speed limit of the current intersection |
Definition at line 1126 of file lci_strategic_plugin.cpp.
References composeIntersectionTransitMessage(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, getLaneletsBetweenWithException(), lci_strategic_plugin::INTERSECTION_EXIT, last_case_num_, lci_strategic_plugin::LCIStrategicStateTransitionTable::signal(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::speed, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, transition_table_, and lci_strategic_plugin::UNAVAILABLE.
Referenced by plan_maneuvers_callback().
|
private |
Method for performing maneuver planning when the current plugin state is TransitState::UNAVAILABLE Therefor no maneuvers are planned but the system checks for the precense of traffic lights ahead of it.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | The current state of the vehicle at the start of planning | |
traffic_light | The single traffic light along the vehicle's route in the intersection that is relevant and in front of the vehicle | |
entry_lanelet | The entry lanelet into the intersection | |
exit_lanelet | The exit lanelet into the intersection | |
current_lanelet | The current lanelet the vehicle's state is on |
if | given entry_lanelet doesn't have stop_line NOTE: returns empty if the given traffic light is empty |
Definition at line 747 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::LCIStrategicPluginConfig::algo_minimum_speed, config_, distance_remaining_to_tf_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, estimate_distance_to_stop(), findSpeedLimit(), lci_strategic_plugin::IN_STOPPING_RANGE, intersection_end_downtrack_, intersection_speed_, last_case_num_, lci_strategic_plugin::LCIStrategicPluginConfig::min_approach_distance, lci_strategic_plugin::LCIStrategicStateTransitionTable::signal(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::speed, lci_strategic_plugin::LCIStrategicPluginConfig::trajectory_smoothing_activation_distance, transition_table_, lci_strategic_plugin::UNAVAILABLE, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_accel_limit_multiplier, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit_multiplier, and wm_.
Referenced by plan_maneuvers_callback().
|
private |
Method for performing maneuver planning when the current plugin state is TransitState::WAITING Therefor the planned maneuvers deal with waiting at a red light.
req | Plan maneuver request | |
[out] | resp | Plan maneuver response with a list of maneuver plan |
current_state | The current state of the vehicle at the start of planning | |
traffic_light | The single traffic light along the vehicle's route in the intersection that is relevant and in front of the vehicle | |
entry_lanelet | The entry lanelet into the intersection | |
exit_lanelet | The exit lanelet into the intersection | |
current_lanelet | The current lanelet the vehicle's state is on NOTE: returns empty if the given traffic light is empty |
Definition at line 1060 of file lci_strategic_plugin.cpp.
References canArriveAtGreenWithCertainty(), composeStopAndWaitManeuverMessage(), config_, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::downtrack, lci_strategic_plugin::LCIStrategicPluginConfig::enable_carma_streets_connection, isStateAllowedGreen(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::lane_id, last_case_num_, lci_strategic_plugin::LCIStrategicPluginConfig::min_maneuver_planning_period, lci_strategic_plugin::RED_TO_GREEN_LIGHT, lci_strategic_plugin::LCIStrategicStateTransitionTable::signal(), lci_strategic_plugin::LCIStrategicPlugin::VehicleState::speed, lci_strategic_plugin::LCIStrategicPlugin::VehicleState::stamp, lci_strategic_plugin::STOPPING, carma_cooperative_perception::to_string(), transition_table_, validLightState(), lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit, lci_strategic_plugin::LCIStrategicPluginConfig::vehicle_decel_limit_multiplier, and wm_.
Referenced by plan_maneuvers_callback().
|
private |
Helper method to print TrajectoryParams.
Definition at line 504 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::BoundaryDistances::dx1, lci_strategic_plugin::BoundaryDistances::dx2, lci_strategic_plugin::BoundaryDistances::dx3, lci_strategic_plugin::BoundaryDistances::dx4, and lci_strategic_plugin::BoundaryDistances::dx5.
Referenced by planWhenAPPROACHING().
|
private |
Helper method to print TrajectoryParams.
Definition at line 479 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by handleFailureCaseHelper(), and planWhenAPPROACHING().
void lci_strategic_plugin::LCIStrategicPlugin::publishMobilityOperation | ( | ) |
Publish mobility operation at a fixed rate.
Definition at line 1255 of file lci_strategic_plugin.cpp.
References approaching_light_controlled_intersection_, generateMobilityOperation(), and mobility_operation_pub_.
Referenced by on_activate_plugin().
void lci_strategic_plugin::LCIStrategicPlugin::publishTrajectorySmoothingInfo | ( | ) |
Publish trajectory smoothing info at a fixed rate.
Definition at line 160 of file lci_strategic_plugin.cpp.
References case_pub_, distance_remaining_to_tf_, earliest_entry_time_, earliest_et_pub_, et_pub_, last_case_num_, scheduled_entry_time_, and tf_distance_pub_.
Referenced by on_activate_plugin().
|
private |
Helper method to evaluate if the given traffic light state is supported by this plugin.
state | The state to evaluate |
Definition at line 191 of file lci_strategic_plugin.cpp.
References lci_strategic_plugin::UNAVAILABLE.
Referenced by validLightState().
|
private |
Trajectory Smoothing Algorithm 8 cases. TSMO UC2, UC3 algorithm equations.
Definition at line 666 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, accel_epsilon_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 715 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, accel_epsilon_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 769 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, accel_epsilon_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 813 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, accel_epsilon_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 863 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 895 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 937 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::a1_, lci_strategic_plugin::TrajectoryParams::a2_, lci_strategic_plugin::TrajectoryParams::a3_, epsilon_, lci_strategic_plugin::TrajectoryParams::t0_, lci_strategic_plugin::TrajectoryParams::t1_, lci_strategic_plugin::TrajectoryParams::t2_, lci_strategic_plugin::TrajectoryParams::t3_, carma_cooperative_perception::to_string(), lci_strategic_plugin::TrajectoryParams::v0_, lci_strategic_plugin::TrajectoryParams::v1_, lci_strategic_plugin::TrajectoryParams::v2_, lci_strategic_plugin::TrajectoryParams::v3_, lci_strategic_plugin::TrajectoryParams::x0_, lci_strategic_plugin::TrajectoryParams::x1_, lci_strategic_plugin::TrajectoryParams::x2_, and lci_strategic_plugin::TrajectoryParams::x3_.
Referenced by get_ts_case().
|
private |
Definition at line 972 of file lci_strategic_plugin_algo.cpp.
References lci_strategic_plugin::TrajectoryParams::is_algorithm_successful.
Referenced by get_ts_case().
|
private |
Helper method that checks both if the input optional light state is set and if the state it contains is supported via supportedLightState.
optional_state | An optional light state and its min_end_time pair. If this is unset the method will return false |
source_time | The time used to optain the optional light state. This is used for logging only |
Definition at line 277 of file lci_strategic_plugin.cpp.
References supportedLightState(), and carma_cooperative_perception::to_string().
Referenced by canArriveAtGreenWithCertainty(), get_final_entry_time_and_conditions(), handleFailureCaseHelper(), planWhenAPPROACHING(), and planWhenWAITING().
|
private |
Definition at line 253 of file lci_strategic_plugin.hpp.
Referenced by boundary_accel_nocruise_maxspeed_decel(), ts_case1(), ts_case2(), ts_case3(), and ts_case4().
|
private |
Definition at line 233 of file lci_strategic_plugin.hpp.
Referenced by mobilityOperationCb(), plan_maneuvers_callback(), and publishMobilityOperation().
|
private |
Definition at line 208 of file lci_strategic_plugin.hpp.
Referenced by BSMCb(), and generateMobilityOperation().
|
private |
Definition at line 209 of file lci_strategic_plugin.hpp.
Referenced by BSMCb(), and generateMobilityOperation().
|
private |
Definition at line 210 of file lci_strategic_plugin.hpp.
Referenced by BSMCb(), and generateMobilityOperation().
|
private |
Definition at line 264 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin().
|
private |
Definition at line 268 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin(), and publishTrajectorySmoothingInfo().
|
private |
Config containing configurable algorithm parameters.
Definition at line 236 of file lci_strategic_plugin.hpp.
Referenced by LCIStrategicPlugin(), canArriveAtGreenWithCertainty(), composeIntersectionTransitMessage(), composeStopAndWaitManeuverMessage(), composeTrajectorySmoothingManeuverMessage(), generateMobilityOperation(), get_earliest_entry_time(), get_final_entry_time_and_conditions(), handleCruisingUntilStop(), handleStopping(), mobilityOperationCb(), on_activate_plugin(), on_configure_plugin(), parameter_update_callback(), plan_maneuvers_callback(), planWhenAPPROACHING(), planWhenUNAVAILABLE(), and planWhenWAITING().
|
private |
Definition at line 228 of file lci_strategic_plugin.hpp.
Referenced by planWhenAPPROACHING(), planWhenUNAVAILABLE(), and publishTrajectorySmoothingInfo().
|
private |
Definition at line 229 of file lci_strategic_plugin.hpp.
Referenced by planWhenAPPROACHING(), and publishTrajectorySmoothingInfo().
|
private |
Definition at line 270 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin(), and publishTrajectorySmoothingInfo().
|
private |
Definition at line 216 of file lci_strategic_plugin.hpp.
Referenced by LCIStrategicPlugin(), handleStopping(), on_configure_plugin(), and planWhenAPPROACHING().
|
private |
Definition at line 252 of file lci_strategic_plugin.hpp.
Referenced by boundary_accel_nocruise_maxspeed_decel(), boundary_accel_or_decel_complete_upper(), boundary_accel_or_decel_incomplete_upper(), boundary_decel_nocruise_minspeed_accel_complete(), get_distance_to_accel_or_decel_once(), get_earliest_entry_time(), get_trajectory_smoothing_activation_distance(), handleFailureCaseHelper(), planWhenAPPROACHING(), ts_case1(), ts_case2(), ts_case3(), ts_case4(), ts_case6(), and ts_case7().
|
private |
Definition at line 271 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin(), and publishTrajectorySmoothingInfo().
|
private |
Definition at line 249 of file lci_strategic_plugin.hpp.
|
private |
Definition at line 243 of file lci_strategic_plugin.hpp.
Referenced by handleFailureCase(), handleGreenSignalScenario(), plan_maneuvers_callback(), planWhenAPPROACHING(), and planWhenUNAVAILABLE().
|
private |
Cache variables for storing the current intersection state between state machine transitions.
Definition at line 242 of file lci_strategic_plugin.hpp.
Referenced by handleFailureCase(), handleGreenSignalScenario(), plan_maneuvers_callback(), planWhenAPPROACHING(), and planWhenUNAVAILABLE().
|
private |
Definition at line 232 of file lci_strategic_plugin.hpp.
Referenced by generateMobilityOperation(), and planWhenAPPROACHING().
|
private |
Useful metrics for LCI Plugin.
last_case_num_ | Current speed profile case generated |
distance_remaining_to_tf_ | distance_remaining_to_traffic signal meters |
earliest_entry_time_ | earliest_entry_time in sec |
scheduled_entry_time_ | scheduled_entry_time in sec |
Definition at line 227 of file lci_strategic_plugin.hpp.
Referenced by handleFailureCase(), handleStopping(), planWhenAPPROACHING(), planWhenDEPARTING(), planWhenUNAVAILABLE(), planWhenWAITING(), and publishTrajectorySmoothingInfo().
|
private |
Definition at line 250 of file lci_strategic_plugin.hpp.
Referenced by lookupFrontBumperTransform().
|
private |
Definition at line 244 of file lci_strategic_plugin.hpp.
Referenced by composeTrajectorySmoothingManeuverMessage(), generateMobilityOperation(), and mobilityOperationCb().
|
private |
Definition at line 213 of file lci_strategic_plugin.hpp.
Referenced by LCIStrategicPlugin(), handleFailureCaseHelper(), on_configure_plugin(), and planWhenAPPROACHING().
|
private |
Definition at line 214 of file lci_strategic_plugin.hpp.
Referenced by LCIStrategicPlugin(), handleFailureCaseHelper(), on_configure_plugin(), and planWhenAPPROACHING().
|
private |
Definition at line 215 of file lci_strategic_plugin.hpp.
Referenced by LCIStrategicPlugin(), handleStopping(), on_configure_plugin(), and planWhenAPPROACHING().
|
private |
Definition at line 259 of file lci_strategic_plugin.hpp.
Referenced by on_activate_plugin().
|
private |
Definition at line 263 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin().
|
private |
Definition at line 267 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin(), and publishMobilityOperation().
|
private |
Definition at line 218 of file lci_strategic_plugin.hpp.
Referenced by get_final_entry_time_and_conditions(), and parseStrategyParams().
|
private |
Definition at line 204 of file lci_strategic_plugin.hpp.
Referenced by mobilityOperationCb().
|
private |
Definition at line 203 of file lci_strategic_plugin.hpp.
Referenced by get_final_entry_time_and_conditions(), parseStrategyParams(), and plan_maneuvers_callback().
|
private |
Definition at line 230 of file lci_strategic_plugin.hpp.
Referenced by planWhenAPPROACHING(), and publishTrajectorySmoothingInfo().
|
private |
Definition at line 201 of file lci_strategic_plugin.hpp.
Referenced by mobilityOperationCb().
|
private |
Definition at line 247 of file lci_strategic_plugin.hpp.
Referenced by lookupFrontBumperTransform().
|
private |
Definition at line 248 of file lci_strategic_plugin.hpp.
Referenced by lookupFrontBumperTransform().
|
private |
Definition at line 269 of file lci_strategic_plugin.hpp.
Referenced by on_configure_plugin(), and publishTrajectorySmoothingInfo().
|
private |
State Machine Transition table.
Definition at line 239 of file lci_strategic_plugin.hpp.
Referenced by plan_maneuvers_callback(), planWhenAPPROACHING(), planWhenDEPARTING(), planWhenUNAVAILABLE(), and planWhenWAITING().
|
private |
Definition at line 260 of file lci_strategic_plugin.hpp.
Referenced by on_activate_plugin().
|
private |
Definition at line 205 of file lci_strategic_plugin.hpp.
Referenced by generateMobilityOperation(), and plan_maneuvers_callback().
|
private |
World Model pointer.
Definition at line 256 of file lci_strategic_plugin.hpp.
Referenced by findSpeedLimit(), getLaneletsBetweenWithException(), on_configure_plugin(), plan_maneuvers_callback(), planWhenAPPROACHING(), planWhenUNAVAILABLE(), and planWhenWAITING().