20 namespace std_ph = std::placeholders;
23 : carma_ros2_utils::CarmaLifecycleNode(options),
24 tf2_buffer_(this->get_clock()),
25 wml_(this->get_node_base_interface(), this->get_node_logging_interface(),
26 this->get_node_topics_interface(), this->get_node_parameters_interface()),
27 rg_worker_(tf2_buffer_)
42 auto error = update_params<double>({
49 rcl_interfaces::msg::SetParametersResult result;
51 result.successful = !error && !error_2 && !error_3;
58 RCLCPP_INFO_STREAM(get_logger(),
"Route trying to configure");
70 RCLCPP_INFO_STREAM(get_logger(),
"Loaded params: " <<
config_);
76 twist_sub_ = create_subscription<geometry_msgs::msg::TwistStamped>(
"current_velocity", 1,
78 geo_sub_ = create_subscription<std_msgs::msg::String>(
"georeference", 1,
82 route_pub_ = create_publisher<carma_planning_msgs::msg::Route>(
"route", 1);
83 route_state_pub_ = create_publisher<carma_planning_msgs::msg::RouteState>(
"route_state", 1);
86 rclcpp::PublisherOptions intra_proc_disabled;
87 intra_proc_disabled.use_intra_process_comm = rclcpp::IntraProcessSetting::Disable;
90 auto pub_qos_transient_local = rclcpp::QoS(rclcpp::KeepAll());
91 pub_qos_transient_local.transient_local();
94 route_event_pub_ = create_publisher<carma_planning_msgs::msg::RouteEvent>(
"route_event", pub_qos_transient_local, intra_proc_disabled);
95 route_marker_pub_ = create_publisher<visualization_msgs::msg::Marker>(
"route_marker", 1);
121 return CallbackReturn::SUCCESS;
131 std::chrono::milliseconds(rg_worker_spin_period_ms),
134 return CallbackReturn::SUCCESS;
139#include "rclcpp_components/register_node_macro.hpp"
WorldModelConstPtr getWorldModel()
Returns a pointer to an intialized world model instance.
void enableUpdatesWithoutRouteWL()
Use to allow updates to occur even if they invalidate the current route. This is only meant to be use...
bool checkIfReRoutingNeededWL()
Returns true if a map update has been processed which requires rerouting. This method is meant to be ...
bool setActiveRouteCb(const std::shared_ptr< rmw_request_id_t >, const std::shared_ptr< carma_planning_msgs::srv::SetActiveRoute::Request > req, std::shared_ptr< carma_planning_msgs::srv::SetActiveRoute::Response > resp)
Set_active_route service callback. User can select a route to start following by calling this service...
void setCrosstrackErrorDistance(double cte_dist)
set the maximum crosstrack error distance
bool getAvailableRouteCb(const std::shared_ptr< rmw_request_id_t >, const std::shared_ptr< carma_planning_msgs::srv::GetAvailableRoutes::Request >, std::shared_ptr< carma_planning_msgs::srv::GetAvailableRoutes::Response > resp)
Get_available_route service callback. Calls to this service will respond with a list of route names f...
void setLoggerInterface(rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr logger)
Dependency injection for logger interface.
void setWorldModelPtr(carma_wm::WorldModelConstPtr wm)
Dependency injection for world model pointer.
void setRouteFilePath(const std::string &path)
Set method for configurable parameter.
void initializeBumperTransformLookup()
Initialize transform lookup from front bumper to map.
void setClock(rclcpp::Clock::SharedPtr clock)
Dependency injection for clock object.
void setReroutingChecker(const std::function< bool()> inputFunction)
setReroutingChecker function to set the rerouting flag
void setCrosstrackErrorCountMax(int cte_max)
set the crosstrack error counter maximum limit
void setDowntrackDestinationRange(double dt_dest_range)
Set method for configurable parameter.
bool spinCallback()
Spin callback which will be called frequently based on spin rate.
void twistCb(geometry_msgs::msg::TwistStamped::UniquePtr msg)
Callback for the twist subscriber, which will store latest twist locally.
void setPublishers(const carma_ros2_utils::PubPtr< carma_planning_msgs::msg::RouteEvent > &route_event_pub, const carma_ros2_utils::PubPtr< carma_planning_msgs::msg::RouteState > &route_state_pub, const carma_ros2_utils::PubPtr< carma_planning_msgs::msg::Route > &route_pub, const carma_ros2_utils::PubPtr< visualization_msgs::msg::Marker > &route_marker_pub)
Method to pass publishers into worker class.
void georeferenceCb(std_msgs::msg::String::UniquePtr msg)
Callback for the georeference subscriber used to set the map projection.
bool abortActiveRouteCb(const std::shared_ptr< rmw_request_id_t >, const std::shared_ptr< carma_planning_msgs::srv::AbortActiveRoute::Request >, std::shared_ptr< carma_planning_msgs::srv::AbortActiveRoute::Response > resp)
Abort_active_route service callback. User can call this service to abort a current following route an...
The route package provides the following functionality:
carma_wm::WorldModelConstPtr wm_
RouteGeneratorWorker rg_worker_
Route(const rclcpp::NodeOptions &)
Route constructor.
rcl_interfaces::msg::SetParametersResult parameter_update_callback(const std::vector< rclcpp::Parameter > ¶meters)
Function callback for dynamic parameter updates.
carma_ros2_utils::SubPtr< geometry_msgs::msg::TwistStamped > twist_sub_
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &)
rclcpp::TimerBase::SharedPtr spin_timer_
carma_ros2_utils::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &)
carma_ros2_utils::ServicePtr< carma_planning_msgs::srv::GetAvailableRoutes > get_available_route_srv_
carma_ros2_utils::SubPtr< std_msgs::msg::String > geo_sub_
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::Route > route_pub_
carma_ros2_utils::ServicePtr< carma_planning_msgs::srv::SetActiveRoute > set_active_route_srv_
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::RouteState > route_state_pub_
carma_ros2_utils::ServicePtr< carma_planning_msgs::srv::AbortActiveRoute > abort_active_route_srv_
carma_ros2_utils::PubPtr< visualization_msgs::msg::Marker > route_marker_pub_
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::RouteEvent > route_event_pub_
carma_wm::WMListener wml_
Struct containing the algorithm configuration values for the route node.
std::string route_file_path
double destination_downtrack_range
double max_crosstrack_error