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.
platoon_strategic_ihp.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019-2021 LEIDOS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17/*
18 * Developed by the UCLA Mobility Lab, 10/20/2021.
19 *
20 * Creator: Xu Han
21 * Author: Xu Han, Xin Xia, Jiaqi Ma
22 */
23
24#pragma once
25
26#include <gtest/gtest_prod.h>
27#include <vector>
28#include <math.h>
29#include <carma_planning_msgs/msg/trajectory_plan.hpp>
30#include <carma_planning_msgs/msg/trajectory_plan_point.hpp>
31#include <carma_planning_msgs/msg/plugin.hpp>
32#include <boost/shared_ptr.hpp>
33#include <boost/uuid/uuid_generators.hpp>
34#include <boost/uuid/uuid_io.hpp>
35#include <boost/format.hpp>
36#include <geometry_msgs/msg/pose_stamped.hpp>
37#include <geometry_msgs/msg/twist_stamped.hpp>
38#include <carma_planning_msgs/srv/plan_maneuvers.hpp>
39#include <geometry_msgs/msg/pose_stamped.hpp>
40#include <carma_v2x_msgs/msg/mobility_operation.hpp>
41#include <carma_v2x_msgs/msg/mobility_request.hpp>
42#include <carma_v2x_msgs/msg/mobility_response.hpp>
43#include <carma_planning_msgs/msg/platooning_info.hpp>
44#include <carma_v2x_msgs/msg/plan_type.hpp>
46#include <lanelet2_core/geometry/Lanelet.h>
47#include <lanelet2_core/geometry/BoundingBox.h>
48#include <lanelet2_extension/traffic_rules/CarmaUSTrafficRules.h>
49#include <lanelet2_extension/regulatory_elements/DigitalMinimumGap.h>
50#include "platoon_config_ihp.h"
51#include "platoon_manager_ihp.h"
52#include <tf2_ros/transform_listener.h>
53#include <tf2/LinearMath/Transform.h>
54#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
55#include <lanelet2_extension/projection/local_frame_projector.h>
56#include <std_msgs/msg/string.hpp>
57#include <rclcpp/time.hpp>
58
60{
61 using MobilityResponseCB = std::function<void(const carma_v2x_msgs::msg::MobilityResponse&)>;
62 using MobilityRequestCB = std::function<void(const carma_v2x_msgs::msg::MobilityRequest&)>;
63 using MobilityOperationCB = std::function<void(const carma_v2x_msgs::msg::MobilityOperation&)>;
64 using PlatooningInfoCB = std::function<void(const carma_planning_msgs::msg::PlatooningInfo&)>;
65
70 {
71 public:
72
80 MobilityRequestCB mobility_request_publisher, MobilityOperationCB mobility_operation_publisher,
81 PlatooningInfoCB platooning_info_publisher,
82 std::shared_ptr<carma_ros2_utils::timers::TimerFactory> timer_factory);
83
89 void mob_op_cb(const carma_v2x_msgs::msg::MobilityOperation::UniquePtr msg);
90
96 void mob_req_cb(const carma_v2x_msgs::msg::MobilityRequest::UniquePtr msg);
97
103 void mob_resp_cb(const carma_v2x_msgs::msg::MobilityResponse::UniquePtr msg);
104
112 MobilityRequestResponse handle_mob_req(const carma_v2x_msgs::msg::MobilityRequest& msg);
113
122 bool plan_maneuver_cb(carma_planning_msgs::srv::PlanManeuvers::Request &req, carma_planning_msgs::srv::PlanManeuvers::Response &resp);
123
132 int findLaneletIndexFromPath(int target_id, lanelet::routing::LaneletPath& path);
133
139 double findLaneWidth();
140
153 carma_planning_msgs::msg::Maneuver composeManeuverMessage(double current_dist, double end_dist, double current_speed, double target_speed, int lane_id, rclcpp::Time& current_time);
154
168 carma_planning_msgs::msg::Maneuver composeLaneChangeManeuverMessage(double current_dist, double end_dist, double current_speed, double target_speed, int starting_lane_id, int ending_lane_id, rclcpp::Time& current_time);
169
178 void updateCurrentStatus(carma_planning_msgs::msg::Maneuver maneuver, double& speed, double& current_progress, int& lane_id);
179
185 void pose_cb(const geometry_msgs::msg::PoseStamped::UniquePtr msg);
186
211 carma_planning_msgs::msg::PlatooningInfo composePlatoonInfoMsg();
212
217 void twist_cb(const geometry_msgs::msg::TwistStamped::UniquePtr msg);
218
223 void cmd_cb(const geometry_msgs::msg::TwistStamped::UniquePtr msg);
224
229 void georeference_cb(const std_msgs::msg::String::UniquePtr msg);
230
234 bool onSpin();
235
239 void run_leader();
240
244 void run_leader_waiting();
245
250
254 void run_follower();
255
256 // ECEF position of the host vehicle
257 carma_v2x_msgs::msg::LocationECEF pose_ecef_point_;
258
259 // -------------- UCLA: add two states for frontal join ------------------
263 void run_leader_aborting();
264
269
270 // -------------- UCLA: add two states for cut-in join ------------------
275
279 void run_prepare_to_join();
280
284 void setHostECEF(carma_v2x_msgs::msg::LocationECEF pose_ecef_point);
285
290
294 void setPMState(PlatoonState desiredState);
295
299 void updatePlatoonList(std::vector<PlatoonMember> platoon_list);
300
304 void setConfig(const PlatoonPluginConfig& config);
305
306 private:
307
312
313
314 // pointer to the actual wm object
316
317 // local copy of configuration file
319
320 // local copy of pose
321 // Current vehicle pose in map
322 geometry_msgs::msg::PoseStamped pose_msg_;
323
324 //Internal Variables used in unit tests
325 // Current vehicle command speed, m/s
326 double cmd_speed_ = 0;
327 // Current vehicle measured speed, m/s
328 double current_speed_ = 0;
329 // Current vehicle downtrack distance in route, m
331 // Current vehicle crosstrack distance in route, m
333 // start time of leaderwaiting state, s
335 // start time of candidate follower state, s
337
338 // Host Mobility ID
339 std::string HostMobilityId = "hostid";
340
341
351 bool isVehicleRightInFront(double downtrack, double crosstrack);
352
360 double findSpeedLimit(const lanelet::ConstLanelet& llt);
361
369 MobilityRequestResponse mob_req_cb_leader(const carma_v2x_msgs::msg::MobilityRequest& msg);
370
378 MobilityRequestResponse mob_req_cb_leaderwaiting(const carma_v2x_msgs::msg::MobilityRequest& msg);
379
387 MobilityRequestResponse mob_req_cb_follower(const carma_v2x_msgs::msg::MobilityRequest& msg);
388
396 MobilityRequestResponse mob_req_cb_candidatefollower(const carma_v2x_msgs::msg::MobilityRequest& msg);
397
405 MobilityRequestResponse mob_req_cb_standby(const carma_v2x_msgs::msg::MobilityRequest& msg);
406
412 void mob_resp_cb_leader(const carma_v2x_msgs::msg::MobilityResponse& msg);
413
419 void mob_resp_cb_leaderwaiting(const carma_v2x_msgs::msg::MobilityResponse& msg);
420
426 void mob_resp_cb_follower(const carma_v2x_msgs::msg::MobilityResponse& msg);
427
433 void mob_resp_cb_candidatefollower(const carma_v2x_msgs::msg::MobilityResponse& msg);
434
440 void mob_resp_cb_standby(const carma_v2x_msgs::msg::MobilityResponse& msg);
441
447 void mob_op_cb_leader(const carma_v2x_msgs::msg::MobilityOperation& msg);
448
454 void mob_op_cb_leaderwaiting(const carma_v2x_msgs::msg::MobilityOperation& msg);
455
461 void mob_op_cb_follower(const carma_v2x_msgs::msg::MobilityOperation& msg);
462
468 void mob_op_cb_candidatefollower(const carma_v2x_msgs::msg::MobilityOperation& msg);
469
475 void mob_op_cb_standby(const carma_v2x_msgs::msg::MobilityOperation& msg);
476
484 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeader(const std::string& type);
485
491 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationFollower();
492
498 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeaderWaiting();
499
505 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationCandidateFollower();
506
514 carma_v2x_msgs::msg::LocationECEF pose_to_ecef(geometry_msgs::msg::PoseStamped pose_msg);
515
523 lanelet::BasicPoint2d ecef_to_map_point(carma_v2x_msgs::msg::LocationECEF ecef_point);
524
525 // -------------- UCLA implemented functions -----------------------
526
527 // ----- 0. Extract data -------
528
539 bool isVehicleRightBehind(double downtrack, double crosstrack);
540
551 bool isJoiningVehicleNearPlatoon(double joining_downtrack, double joining_crosstrack);
552
563 bool isVehicleNearTargetPlatoon(double rearVehicleDtd, double frontVehicleDtd, double frontVehicleCtd);
564
577 int find_target_lanelet_id(double start_downtrack, double end_downtrack);
578
579 // ----- 1. compose message ---------
580
586 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationSTATUS();
587
593 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationINFO();
594
600 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeaderAborting();
601
607 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationCandidateLeader();
608
617 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeadWithOperation(const std::string& type);
618
627 carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationPrepareToJoin();
628
629 // --------- 2. Mobility operation callback -----------
630
637 void mob_op_cb_STATUS(const carma_v2x_msgs::msg::MobilityOperation& msg);
638
646 double mob_op_find_platoon_length_from_INFO_params(std::string strategyParams);
647
655 carma_v2x_msgs::msg::LocationECEF mob_op_find_ecef_from_INFO_params(std::string strategyParams);
656
664 carma_v2x_msgs::msg::LocationECEF mob_op_find_ecef_from_STATUS_params(std::string strategyParams);
665
671 void mob_op_cb_leaderaborting(const carma_v2x_msgs::msg::MobilityOperation& msg);
672
678 void mob_op_cb_candidateleader(const carma_v2x_msgs::msg::MobilityOperation& msg);
679
685 void mob_op_cb_leadwithoperation(const carma_v2x_msgs::msg::MobilityOperation& msg);
686
692 void mob_op_cb_preparetojoin(const carma_v2x_msgs::msg::MobilityOperation& msg);
693
694 //------- 3. Mobility request callback -----------
695
703 MobilityRequestResponse mob_req_cb_leaderaborting(const carma_v2x_msgs::msg::MobilityRequest& msg);
704
712 MobilityRequestResponse mob_req_cb_candidateleader(const carma_v2x_msgs::msg::MobilityRequest& msg);
713
721 MobilityRequestResponse mob_req_cb_leadwithoperation(const carma_v2x_msgs::msg::MobilityRequest& msg);
722
730 MobilityRequestResponse mob_req_cb_preparetojoin(const carma_v2x_msgs::msg::MobilityRequest& msg);
731
732 // ------ 4. Mobility response callback ------
738 void mob_resp_cb_leaderaborting(const carma_v2x_msgs::msg::MobilityResponse& msg);
739
745 void mob_resp_cb_candidateleader(const carma_v2x_msgs::msg::MobilityResponse& msg);
746
752 void mob_resp_cb_leadwithoperation(const carma_v2x_msgs::msg::MobilityResponse& msg);
753
759 void mob_resp_cb_preparetojoin(const carma_v2x_msgs::msg::MobilityResponse& msg);
760
761
770 bool is_lanechange_possible(lanelet::Id start_lanelet_id, lanelet::Id target_lanelet_id);
771
772 // Pointer for map projector
773 std::string georeference_{""};
774 std::shared_ptr<lanelet::projection::LocalFrameProjector> map_projector_;
775
776 // flag to check if map is loaded
777 bool map_loaded_ = false;
778
779 // Plugin discovery message
780 carma_planning_msgs::msg::Plugin plugin_discovery_msg_;
781
782 // Number of calls to the run_leader_aborting() method
784
785 // Number of calls to run_candidate_follower() method after MobReq message sent
787
791 double vehicleLength_ = 5.0;
792 unsigned long infoMessageInterval_ = 200; // ms
793 unsigned long prevHeartBeatTime_ = 0.0;
794 int statusMessageInterval_ = 100; // ms
795 unsigned long NEGOTIATION_TIMEOUT = 15000; // ms
796 unsigned long LANE_CHANGE_TIMEOUT = 300000; // ms (5 min)
799 double waitingStateTimeout = 25.0; // s
800 double desiredJoinGap = 30.0; // m
801 double desiredJoinTimeGap = 4.0; // s
802
803 lanelet::BasicPoint2d target_cutin_pose_;
804
805 // Speed below which platooning will not be attempted; non-zero value allows for sensor noise
806 const double STOPPED_SPEED = 0.5; // m/s
807
808 // UCLA: add member variable for state prepare to join (default -2, front join -1, mid/rear join other integer)
810
811 // Is there a sufficient gap open in the platoon for a cut-in join?
812 bool safeToLaneChange_ = false;
813
814 // Interface for getting current time
815 std::shared_ptr<carma_ros2_utils::timers::TimerFactory> timer_factory_;
816
817 // Platoon Manager Object
819
820 // Strategy types
821 const std::string PLATOONING_STRATEGY = "Carma/Platooning";
822 const std::string OPERATION_INFO_TYPE = "INFO";
823 const std::string OPERATION_STATUS_TYPE = "STATUS";
824
825 // UCLA: edit INFO params to store platoon front info (front join needs 10 info params)
834 const std::string OPERATION_INFO_PARAMS = "INFO|LENGTH:%.2f,SPEED:%.2f,SIZE:%d,ECEFX:%.2f,ECEFY:%.2f,ECEFZ:%.2f";
835
843 const std::string OPERATION_STATUS_PARAMS = "STATUS|CMDSPEED:%1%,SPEED:%2%,ECEFX:%3%,ECEFY:%4%,ECEFZ:%5%";
844
845 // JOIN Strategy Params
859 const std::string JOIN_PARAMS = "SIZE:%1%,SPEED:%2%,ECEFX:%3%,ECEFY:%4%,ECEFZ:%5%,JOINIDX:%6%";
860
861 // Unit Test Accessors
862 FRIEND_TEST(PlatoonStrategicIHPPlugin, platoon_info_pub_front);
864 };
865}
Class containing the logic for platoon manager. It is responsible for keeping track of the platoon me...
Class containing the logic for Strategic IHP Plugin. This class is responsible for all the negotiatio...
void mob_op_cb_leaderaborting(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in leaderaborting state.
carma_v2x_msgs::msg::LocationECEF pose_to_ecef(geometry_msgs::msg::PoseStamped pose_msg)
Function to convert pose from map frame to ecef location.
bool isJoiningVehicleNearPlatoon(double joining_downtrack, double joining_crosstrack)
The method for platoon leader to determine if the joining vehicle is closeby. (Note: Used when host v...
void mob_resp_cb_leadwithoperation(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in leadwithoperation state (cut-in join)
PlatoonStrategicIHPPlugin(carma_wm::WorldModelConstPtr wm, PlatoonPluginConfig config, MobilityResponseCB mobility_response_publisher, MobilityRequestCB mobility_request_publisher, MobilityOperationCB mobility_operation_publisher, PlatooningInfoCB platooning_info_publisher, std::shared_ptr< carma_ros2_utils::timers::TimerFactory > timer_factory)
Constructor.
MobilityRequestResponse mob_req_cb_preparetojoin(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in preparetojoin state (cut-in join)
MobilityRequestResponse mob_req_cb_leadwithoperation(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in leadwithoperation state (cut-in join)
void georeference_cb(const std_msgs::msg::String::UniquePtr msg)
Callback for the georeference.
bool isVehicleRightInFront(double downtrack, double crosstrack)
Function to determine if a target vehicle is in the front of host vehicle note: This is only applicab...
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeaderAborting()
Function to compose mobility operation in LeaderAborting state.
void mob_op_cb_candidateleader(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in candidateleader state.
MobilityRequestResponse mob_req_cb_follower(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in follower state.
std::shared_ptr< carma_ros2_utils::timers::TimerFactory > timer_factory_
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeadWithOperation(const std::string &type)
Function to compose mobility operation in LeadWithOperation (cut-in join)
void setPMState(PlatoonState desiredState)
UCLA Setter: function to set pm_.platoon_state.
carma_v2x_msgs::msg::LocationECEF mob_op_find_ecef_from_STATUS_params(std::string strategyParams)
Function to process mobility operation for STATUS params.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationFollower()
Function to compose mobility operation in follower state.
FRIEND_TEST(PlatoonStrategicIHPPlugin, is_lanechange_possible)
FRIEND_TEST(PlatoonStrategicIHPPlugin, platoon_info_pub_front)
double mob_op_find_platoon_length_from_INFO_params(std::string strategyParams)
Function to process mobility operation INFO params to find platoon length in m.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationPrepareToJoin()
Function to compose mobility operation in PrepareToJoin (cut-in join)
MobilityRequestResponse handle_mob_req(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to the process and respond to the mobility request.
MobilityRequestResponse mob_req_cb_leader(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in leader state.
void mob_req_cb(const carma_v2x_msgs::msg::MobilityRequest::UniquePtr msg)
Callback function for Mobility Request Message.
void mob_op_cb_leaderwaiting(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in leader waiting state.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationCandidateLeader()
Function to compose mobility operation in CandidateLeader.
void updateCurrentStatus(carma_planning_msgs::msg::Maneuver maneuver, double &speed, double &current_progress, int &lane_id)
Update maneuver status based on prior plan.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationCandidateFollower()
Function to compose mobility operation in candidate follower state.
void mob_op_cb_leadwithoperation(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in LeadWithOperation state (cut-in join)
carma_planning_msgs::msg::Maneuver composeManeuverMessage(double current_dist, double end_dist, double current_speed, double target_speed, int lane_id, rclcpp::Time &current_time)
Find lanelet index from path.
std::shared_ptr< lanelet::projection::LocalFrameProjector > map_projector_
carma_planning_msgs::msg::Plugin plugin_discovery_msg_
void mob_resp_cb_candidateleader(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in candidateleader state.
MobilityRequestResponse mob_req_cb_candidatefollower(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in candidate follower state.
double findSpeedLimit(const lanelet::ConstLanelet &llt)
Function to find speed limit of a lanelet.
void mob_op_cb_candidatefollower(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in candidate follower state.
MobilityRequestResponse mob_req_cb_leaderwaiting(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in leader waiting state.
void run_candidate_follower()
Run Candidate Follower State.
void mob_resp_cb_leader(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in leader state.
void mob_resp_cb_follower(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in follower state.
int find_target_lanelet_id(double start_downtrack, double end_downtrack)
Function to find the starting and ending lanelet ID for lane change in a two-lane scenario (used for ...
carma_planning_msgs::msg::Maneuver composeLaneChangeManeuverMessage(double current_dist, double end_dist, double current_speed, double target_speed, int starting_lane_id, int ending_lane_id, rclcpp::Time &current_time)
Find start(current) and target(end) lanelet index from path to generate lane change maneuver message.
void setConfig(const PlatoonPluginConfig &config)
Set the current config.
MobilityRequestResponse mob_req_cb_standby(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in standby state.
lanelet::BasicPoint2d ecef_to_map_point(carma_v2x_msgs::msg::LocationECEF ecef_point)
Function to convert ecef location to a 2d point in map frame.
bool is_lanechange_possible(lanelet::Id start_lanelet_id, lanelet::Id target_lanelet_id)
Function to check if lanechange is possible.
void run_prepare_to_join()
UCLA Run prepare to join State.
void mob_resp_cb_preparetojoin(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in preparetojoin state.
MobilityRequestResponse mob_req_cb_candidateleader(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in candidateleader state.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeaderWaiting()
Function to compose mobility operation in leader waiting state.
PlatoonManager getHostPM()
UCLA Getter: for PlatoonManager class.
void mob_op_cb(const carma_v2x_msgs::msg::MobilityOperation::UniquePtr msg)
Callback function for Mobility Operation Message.
bool isVehicleNearTargetPlatoon(double rearVehicleDtd, double frontVehicleDtd, double frontVehicleCtd)
Function to determine if the host vehicle is close to the target platoon (used for cut-in join scenar...
void cmd_cb(const geometry_msgs::msg::TwistStamped::UniquePtr msg)
Callback for the control command.
void pose_cb(const geometry_msgs::msg::PoseStamped::UniquePtr msg)
Callback function for current pose.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationSTATUS()
Function to compose mobility operation message with STATUS params.
void mob_resp_cb(const carma_v2x_msgs::msg::MobilityResponse::UniquePtr msg)
Callback function for Mobility Response Message.
void mob_resp_cb_standby(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in standby state.
carma_v2x_msgs::msg::LocationECEF mob_op_find_ecef_from_INFO_params(std::string strategyParams)
Function to process mobility operation INFO params to find platoon leader's ecef location.
void setHostECEF(carma_v2x_msgs::msg::LocationECEF pose_ecef_point)
UCLA Update the private variable pose_ecef_point_.
int findLaneletIndexFromPath(int target_id, lanelet::routing::LaneletPath &path)
Find lanelet index from path.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationINFO()
Function to compose mobility operation message with INFO params.
void run_lead_with_operation()
UCLA Run lead with operation State.
carma_planning_msgs::msg::PlatooningInfo composePlatoonInfoMsg()
Compose Platoon information message.
void mob_resp_cb_candidatefollower(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in candidate follower state.
carma_v2x_msgs::msg::LocationECEF pose_ecef_point_
double findLaneWidth()
Find lanelet width from local position.
void twist_cb(const geometry_msgs::msg::TwistStamped::UniquePtr msg)
Callback for the twist subscriber, which will store latest twist locally.
void mob_op_cb_standby(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in standby state.
MobilityRequestResponse mob_req_cb_leaderaborting(const carma_v2x_msgs::msg::MobilityRequest &msg)
Function to process mobility request in leaderaborting state.
void mob_op_cb_follower(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in follower state.
void mob_resp_cb_leaderwaiting(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in leader waiting state.
void updatePlatoonList(std::vector< PlatoonMember > platoon_list)
UCLA Setter: Update platoon list (Unit Test).
void mob_op_cb_STATUS(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation message with STATUS params, read ecef location and update plat...
void mob_resp_cb_leaderaborting(const carma_v2x_msgs::msg::MobilityResponse &msg)
Function to process mobility response in leaderaborting state.
bool plan_maneuver_cb(carma_planning_msgs::srv::PlanManeuvers::Request &req, carma_planning_msgs::srv::PlanManeuvers::Response &resp)
Callback function to the maneuver request.
bool isVehicleRightBehind(double downtrack, double crosstrack)
Function to determine if the given downtrack distance (m) is behind the host vehicle.
carma_v2x_msgs::msg::MobilityOperation composeMobilityOperationLeader(const std::string &type)
Function to compose mobility operation in leader state.
void mob_op_cb_leader(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in leader state.
void mob_op_cb_preparetojoin(const carma_v2x_msgs::msg::MobilityOperation &msg)
Function to process mobility operation in PrepareToJoin state (cut-in join)
std::shared_ptr< const WorldModel > WorldModelConstPtr
Definition: WorldModel.hpp:452
PlatoonState
Platoon States. UCLA: Added additional states (i.e., LEADERABORTING and CANDIDATELEADER) for same-lan...
std::function< void(const carma_v2x_msgs::msg::MobilityOperation &)> MobilityOperationCB
std::function< void(const carma_planning_msgs::msg::PlatooningInfo &)> PlatooningInfoCB
std::function< void(const carma_v2x_msgs::msg::MobilityResponse &)> MobilityResponseCB
std::function< void(const carma_v2x_msgs::msg::MobilityRequest &)> MobilityRequestCB
MobilityRequestResponse
A response to an MobilityRequest message. ACK - indicates that the plugin accepts the MobilityRequest...
Stuct containing the algorithm configuration values for the yield_pluginConfig.