22 #include <Eigen/Eigen>
23 #include <boost/algorithm/string/predicate.hpp>
24 #include <boost/filesystem.hpp>
25 #include <boost/foreach.hpp>
35 #ifdef HAVE_PYTHONLIBS
44 int main(
int argc,
char **argv) {
53 PRINT_ERROR(
RED "ERROR: rosrun ov_eval timing_flamegraph <file_times.txt> <num_bins>\n" RESET);
54 std::exit(EXIT_FAILURE);
56 int nbins = atoi(argv[2]);
59 std::vector<std::string> names;
60 std::vector<double> times;
61 std::vector<Eigen::VectorXd> timing_values;
63 PRINT_INFO(
"[TIME]: loaded %d timestamps from file (%d categories)!!\n", (
int)times.size(), (
int)names.size());
66 std::vector<ov_eval::Statistics> stats;
67 for (
size_t i = 0; i < names.size(); i++)
71 for (
size_t i = 0; i < times.size(); i++) {
72 for (
size_t c = 0; c < names.size(); c++) {
73 stats.at(c).timestamps.push_back(times.at(i));
74 stats.at(c).values.push_back(1000.0 * timing_values.at(i)(c));
78 #ifdef HAVE_PYTHONLIBS
83 std::vector<std::string> colors_valid = {
"navy",
"blue",
"lightgreen",
"green",
"orange",
"goldenrod",
"red",
"pink",
"black"};
86 for (
size_t i = 0; i < names.size(); i++) {