From 0fed2ec4bb7dd973405622950f6b3446495a9e40 Mon Sep 17 00:00:00 2001 From: Ryotaro Onuki Date: Sun, 26 Apr 2020 10:02:44 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/shape/main.cpp | 18 ++++++++++++++++++ examples/slalom/plot.py | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/examples/shape/main.cpp b/examples/shape/main.cpp index 82ff906..b4cf5f1 100644 --- a/examples/shape/main.cpp +++ b/examples/shape/main.cpp @@ -44,6 +44,7 @@ void printDefinition(std::ostream &os, const std::string &name, void printDefinitions() { for (const auto &e : shapes) printDefinition(std::cout, e.first, e.second); + std::cout << std::endl; } void printCsv(const std::string &filebase, const slalom::Shape &ss, @@ -97,6 +98,20 @@ void printTrajectory() { printCsv("shape/shape_7", shapes[7].second); } +void printTable() { + for (const auto &e : shapes) { + std::cout << "|" << e.first; + std::cout << "|" << e.second.total.th / M_PI * 180; + std::cout << "|(" << e.second.total.x << "," << e.second.total.y << ")"; + std::cout << "|(" << e.second.curve.x << "," << e.second.curve.y << ")"; + std::cout << "|" << e.second.v_ref; + std::cout << "|" << e.second.straight_prev; + std::cout << "|" << e.second.straight_post; + std::cout << "|" << std::endl; + } + std::cout << std::endl; +} + int main(void) { /* print definitions to stdout */ printDefinitions(); @@ -104,5 +119,8 @@ int main(void) { /* print trajectory to file*/ printTrajectory(); + /* print result table */ + printTable(); + return 0; } diff --git a/examples/slalom/plot.py b/examples/slalom/plot.py index b21abd6..ad8a4a9 100644 --- a/examples/slalom/plot.py +++ b/examples/slalom/plot.py @@ -47,8 +47,8 @@ ax.axis('equal') ax.grid(which='major', linestyle='-') ax.grid(which='minor', linestyle=':') -ax.legend(['straight', 'transition curve', - 'pure arc', 'transition curve', 'straight']) +ax.legend(['straight before curve', 'transition curve', + 'pure arc', 'transition curve', 'straight after curve']) ax.set_xlabel('$x$ [mm]') ax.set_ylabel('$y$ [mm]') # ax.set_title('')