15 custom_interfaces::msg::PathPointArray gtruth_mock;
18 std::getline(in, line);
19 while (std::getline(in, line)) {
20 std::stringstream iss(line);
21 if (getline(iss, x,
',') && getline(iss, y,
',') && getline(iss, velocity,
',')) {
23 custom_interfaces::msg::PathPoint custom_point;
24 custom_point.x = std::stod(x);
25 custom_point.y = std::stod(y);
26 custom_point.v = std::stod(velocity);
27 gtruth_mock.pathpoint_array.push_back(custom_point);
28 }
catch (
const std::invalid_argument& e) {
29 RCLCPP_ERROR(rclcpp::get_logger(
"rclcpp"),
30 "Invalid argument encountered while converting to double: %s \n", e.what());
31 }
catch (
const std::out_of_range& e) {
32 RCLCPP_ERROR(rclcpp::get_logger(
"rclcpp"),
33 "Out of range exception encountered while converting to double: %s \n",
36 }
else if (!line.empty()) {
37 RCLCPP_ERROR(rclcpp::get_logger(
"rclcpp"),
"Unexpected format in line with content: %s \n",
49 custom_interfaces::msg::ConeArray gtruth_mock;
52 std::getline(in, line);
53 while (std::getline(in, line)) {
54 std::stringstream iss(line);
55 if (getline(iss, x,
',') && getline(iss, y,
',') && getline(iss, color,
',')) {
57 custom_interfaces::msg::Cone cone;
58 cone.position.x = std::stod(x);
59 cone.position.y = std::stod(y);
62 gtruth_mock.cone_array.push_back(cone);
63 }
catch (
const std::invalid_argument& e) {
64 RCLCPP_ERROR(rclcpp::get_logger(
"rclcpp"),
65 "Invalid argument encountered while converting to double: %s \n", e.what());
66 }
catch (
const std::out_of_range& e) {
67 RCLCPP_ERROR(rclcpp::get_logger(
"rclcpp"),
68 "Out of range exception encountered while converting to double: %s \n",
71 }
else if (!line.empty()) {
72 RCLCPP_ERROR(rclcpp::get_logger(
"rclcpp"),
"Unexpected format in line with content: %s \n",