17#include <carma_ros2_utils/timers/TimerFactory.hpp>
18#include <carma_ros2_utils/timers/ROSTimerFactory.hpp>
22 namespace std_ph = std::placeholders;
68 auto error = update_params<bool>({
74 auto error2 = update_params<int>({
82 auto error3 = update_params<double>({
106 rcl_interfaces::msg::SetParametersResult result;
108 result.successful = !error && !error2 && !error3;
110 if (result.successful &&
worker_)
160 mob_response_pub = create_publisher<carma_v2x_msgs::msg::MobilityResponse>(
"outgoing_mobility_response", 5);
161 mob_request_pub = create_publisher<carma_v2x_msgs::msg::MobilityRequest>(
"outgoing_mobility_request", 5);
162 mob_operation_pub = create_publisher<carma_v2x_msgs::msg::MobilityOperation>(
"outgoing_mobility_operation", 5);
163 platoon_info_pub = create_publisher<carma_planning_msgs::msg::PlatooningInfo>(
"platoon_info", 1);
170 std::make_shared<carma_ros2_utils::timers::ROSTimerFactory>(shared_from_this()));
174 mob_request_sub = create_subscription<carma_v2x_msgs::msg::MobilityRequest>(
"incoming_mobility_request", 10,
177 mob_response_sub = create_subscription<carma_v2x_msgs::msg::MobilityResponse>(
"incoming_mobility_response", 10,
180 mob_operation_sub = create_subscription<carma_v2x_msgs::msg::MobilityOperation>(
"incoming_mobility_operation", 10,
183 current_pose_sub = create_subscription<geometry_msgs::msg::PoseStamped>(
"current_pose", 10,
186 current_twist_sub = create_subscription<geometry_msgs::msg::TwistStamped>(
"current_velocity", 10,
189 cmd_sub = create_subscription<geometry_msgs::msg::TwistStamped>(
"twist_raw", 10,
192 georeference_sub = create_subscription<std_msgs::msg::String>(
"georeference", 10,
197 std::chrono::milliseconds(100),
201 return CallbackReturn::SUCCESS;
215 return CallbackReturn::SUCCESS;
220 std::shared_ptr<rmw_request_id_t>,
221 carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req,
222 carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp)
225 worker_->plan_maneuver_cb(*req, *resp);
238#include "rclcpp_components/register_node_macro.hpp"
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...
ROS Node to for Platooning Strategic Plugin IHP2 variant. It includes all the service clients,...
rcl_interfaces::msg::SetParametersResult parameter_update_callback(const std::vector< rclcpp::Parameter > ¶meters)
Callback for dynamic parameter updates.
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityRequest > mob_request_sub
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityResponse > mob_response_pub
bool get_availability() override
Get the availability status of this plugin based on the current operating environment....
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityOperation > mob_operation_sub
std::string get_version_id() override
Returns the version id of this plugin.
rclcpp::TimerBase::SharedPtr loop_timer_
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityOperation > mob_operation_pub
Node(const rclcpp::NodeOptions &)
Node constructor.
carma_ros2_utils::CallbackReturn on_cleanup_plugin()
Method which is triggered when this plugin is moved from the INACTIVE to UNCONFIGURED states....
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityRequest > mob_request_pub
carma_ros2_utils::SubPtr< geometry_msgs::msg::TwistStamped > cmd_sub
carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > current_pose_sub
carma_ros2_utils::SubPtr< std_msgs::msg::String > georeference_sub
carma_ros2_utils::CallbackReturn on_configure_plugin()
This method should be used to load parameters and will be called on the configure state transition.
carma_ros2_utils::SubPtr< geometry_msgs::msg::TwistStamped > current_twist_sub
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::PlatooningInfo > platoon_info_pub
std::shared_ptr< PlatoonStrategicIHPPlugin > worker_
void plan_maneuvers_callback(std::shared_ptr< rmw_request_id_t >, carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp) override
Extending class provided callback which should return a planned trajectory based on the provided traj...
PlatoonPluginConfig config_
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityResponse > mob_response_sub
void georeference_cb(const std_msgs::msg::String::UniquePtr msg)
Callback for the georeference.
void mob_req_cb(const carma_v2x_msgs::msg::MobilityRequest::UniquePtr msg)
Callback function for Mobility Request Message.
void mob_op_cb(const carma_v2x_msgs::msg::MobilityOperation::UniquePtr msg)
Callback function for Mobility Operation Message.
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.
void mob_resp_cb(const carma_v2x_msgs::msg::MobilityResponse::UniquePtr msg)
Callback function for Mobility Response Message.
bool onSpin()
Spin callback function.
void twist_cb(const geometry_msgs::msg::TwistStamped::UniquePtr msg)
Callback for the twist subscriber, which will store latest twist locally.
Stuct containing the algorithm configuration values for the yield_pluginConfig.
double significantDTDchange
double desiredJoinTimeGap
double minPlatooningSpeed
double maxCrosstrackError
double maxAllowedJoinTimeGap
double minAllowableHeadaway
double headawayStableUpperBond
double longitudinalCheckThresold
double headawayStableLowerBond
int statusMessageInterval
double waitingStateTimeout
double cmdSpeedMaxAdjustment
double maxAllowableHeadaway