21#include <rclcpp/rclcpp.hpp>
23#include <carma_ros2_utils/carma_ros2_utils.hpp>
24#include <autoware_lanelet2_msgs/msg/map_bin.hpp>
26#include <carma_perception_msgs/msg/roadway_obstacle_list.hpp>
27#include <carma_planning_msgs/msg/route.hpp>
28#include <carma_v2x_msgs/msg/spat.hpp>
29#include <carma_ros2_utils/carma_lifecycle_node.hpp>
30#include <rosgraph_msgs/msg/clock.hpp>
34class WMListenerWorker;
58 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base,
59 rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging,
60 rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics,
61 rclcpp::node_interfaces::NodeParametersInterface::SharedPtr
node_params_,
62 bool multi_thread =
false);
103 std::unique_lock<std::mutex>
getLock(
bool pre_locked =
true);
131 void mapUpdateCallback(autoware_lanelet2_msgs::msg::MapBin::SharedPtr geofence_msg);
135 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr
node_base_;
138 rclcpp::node_interfaces::NodeParametersInterface::SharedPtr
node_params_;
142 carma_ros2_utils::SubPtr<autoware_lanelet2_msgs::msg::MapBin>
map_sub_;
143 carma_ros2_utils::SubPtr<carma_planning_msgs::msg::Route>
route_sub_;
Class which provies automated subscription and threading support for the world model.
rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging_
void mapUpdateCallback(autoware_lanelet2_msgs::msg::MapBin::SharedPtr geofence_msg)
void setConfigSpeedLimit(double config_lim) const
Allows user to set a callback to be triggered when a route update is received NOTE: If operating in m...
carma_ros2_utils::SubPtr< autoware_lanelet2_msgs::msg::MapBin > map_update_sub_
void setMapCallback(std::function< void()> callback)
Allows user to set a callback to be triggered when a map update is received NOTE: If operating in mul...
WorldModelConstPtr getWorldModel()
Returns a pointer to an intialized world model instance.
carma_ros2_utils::SubPtr< rosgraph_msgs::msg::Clock > sim_clock_sub_
carma_ros2_utils::SubPtr< rosgraph_msgs::msg::Clock > ros1_clock_sub_
rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics_
carma_ros2_utils::SubPtr< autoware_lanelet2_msgs::msg::MapBin > map_sub_
std::unique_ptr< WMListenerWorker > worker_
void enableUpdatesWithoutRouteWL()
Use to allow updates to occur even if they invalidate the current route. This is only meant to be use...
rclcpp::node_interfaces::NodeParametersInterface::SharedPtr node_params_
carma_ros2_utils::SubPtr< carma_perception_msgs::msg::RoadwayObstacleList > roadway_objects_sub_
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base_
void setRouteCallback(std::function< void()> callback)
Allows user to set a callback to be triggered when a route update is received NOTE: If operating in m...
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::Route > route_sub_
WMListener(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging, rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics, rclcpp::node_interfaces::NodeParametersInterface::SharedPtr node_params_, bool multi_thread=false)
Constructor which can be used to specify threading behavior of this class.
const bool multi_threaded_
bool checkIfReRoutingNeededWL()
Returns true if a map update has been processed which requires rerouting. This method is meant to be ...
std::unique_lock< std::mutex > getLock(bool pre_locked=true)
Returns a unique_lock which can be used to lock world model updates until the user finishes a desired...
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::SPAT > traffic_spat_sub_
bool callback(cav_srvs::PlanTrajectory::Request &req, cav_srvs::PlanTrajectory::Response &res)
std::shared_ptr< const WorldModel > WorldModelConstPtr