Skip to content

Commit

Permalink
表示を更新
Browse files Browse the repository at this point in the history
  • Loading branch information
kerikun11 committed Apr 26, 2020
1 parent 6bb0add commit 0fed2ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions examples/shape/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -97,12 +98,29 @@ 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();

/* print trajectory to file*/
printTrajectory();

/* print result table */
printTable();

return 0;
}
4 changes: 2 additions & 2 deletions examples/slalom/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('')
Expand Down

0 comments on commit 0fed2ec

Please sign in to comment.