3#include <yaml-cpp/yaml.h>
10 auto mocker_config_path =
12 auto mocker_config = YAML::LoadFile(mocker_config_path);
14 auto track_name = mocker_config[
"global"][
"track_name"].as<std::string>();
15 auto sim = mocker_config[
"global"][
"adapter"].as<std::string>();
17 std::string planning_gtruth_file = std::string(std::filesystem::current_path()) +
18 "/gtruths/tracks/" + sim +
"/" + track_name +
"/" +
19 track_name +
"_gtruth.csv";
20 std::string se_gtruth_file = std::string(std::filesystem::current_path()) +
"/gtruths/tracks/" +
21 sim +
"/" + track_name +
"/" + track_name +
".csv";
27 "/path_planning/mock_path",
28 rclcpp::QoS(10).durability(RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL));
29 se_publisher = this->create_publisher<custom_interfaces::msg::ConeArray>(
30 "/state_estimation/mock_map",
31 rclcpp::QoS(10).durability(RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL));
34 "/path_planning/smoothed_mock_path", 10);
38 this->
timer_ = this->create_wall_timer(std::chrono::milliseconds(100),
std::string _map_frame_id_
rclcpp::Publisher< custom_interfaces::msg::ConeArray >::SharedPtr se_publisher
void publish_data()
publish the messages
rclcpp::TimerBase::SharedPtr timer_
custom_interfaces::msg::ConeArray gtruth_se
MockerNode()
Constructor for a new Mocker Node object.
rclcpp::Publisher< custom_interfaces::msg::PathPointArray >::SharedPtr planning_publisher
custom_interfaces::msg::PathPointArray gtruth_planning
rclcpp::Publisher< visualization_msgs::msg::Marker >::SharedPtr planning_visualization_publisher
Timer for the periodic publishing.
custom_interfaces::msg::ConeArray se_gtruth_fromfile(std::istream &in)
read state estimation ground truth information from stream and place it in an array of Cone objects
std::istream & open_file_as_stream(const std::string &filename)
recieve path to a file and return it as an input stream
custom_interfaces::msg::PathPointArray planning_gtruth_fromfile(std::istream &in)
read planning ground truth information from stream and place it in an array of PathPoint objects
std::vector< common_lib::structures::PathPoint > path_point_array_from_ci_vector(const custom_interfaces::msg::PathPointArray &path_point_array)
Convert from custom interfaces PathPointArray to vector of common_lib PathPoints.
visualization_msgs::msg::Marker line_marker_from_structure_array(const std::vector< T > &structure_array, const std::string &name_space, const std::string &frame_id, const int id, const std::string &color="red", const std::string &shape="line", float scale=0.1f, int action=visualization_msgs::msg::Marker::MODIFY)
Converts a vector of cones to a marker array.
std::string get_config_yaml_path(const std::string &package_name, const std::string &dir, const std::string &filename)