36 if (!FLAGS_enable_print_curve) {
39 std::stringstream ssm;
40 ssm <<
"print_" << id_ <<
":";
41 for (
size_t i = 0; i < points.size(); i++) {
42 ssm << std::fixed <<
"(" << points[i].first <<
", " << points[i].second
49 if (!FLAGS_enable_print_curve) {
52 if (curve_map_.count(key) == 0) {
55 curve_map_[key].AddPoint(x, y);
60 if (!FLAGS_enable_print_curve) {
63 if (curve_map_.count(key) == 0) {
66 curve_map_[key].AddPoint(point.
x(), point.
y());
70 const std::vector<common::math::Vec2d>& points) {
71 if (!FLAGS_enable_print_curve) {
74 for (
const auto& point : points) {
79 if (!FLAGS_enable_print_curve) {
82 for (
auto iter = curve_map_.begin(); iter != curve_map_.end(); iter++) {
83 iter->second.PrintToLog();
88 bool is_rear_axle_point) {
89 const auto& vehicle_param =
91 if (is_rear_axle_point) {
93 double rear_axle_to_center =
95 x += rear_axle_to_center * cos(heading);
96 y += rear_axle_to_center * sin(heading);
99 {x, y, heading, vehicle_param.length(), vehicle_param.width()});
103 std::stringstream ssm;
104 ssm <<
"print_" << id_ <<
":";
105 for (
size_t i = 0; i < box_points.size(); i++) {
107 for (
size_t j = 0; j < box_points[i].size(); j++) {
108 ssm << std::fixed << box_points[i][j];
109 if (j != box_points[i].size() - 1) {
114 if (i != box_points.size() - 1) {
static const VehicleConfig & GetConfig()
Get the current vehicle configuration.
Implements a class of 2-dimensional vectors.
double y() const
Getter for y component
double x() const
Getter for x component
void AddAdcBox(double x, double y, double heading, bool is_rear_axle_point=true)
void AddPoint(std::string key, double x, double y)
add point to curve key
void set_id(std::string id)
set curve id
void PrintToLog()
print curve to log
void AddPoint(double x, double y)
add points to curve
Planning module main class.
optional VehicleParam vehicle_param
optional double front_edge_to_center