Skip to content

Commit 401ebf3

Browse files
committed
fix error plotting
1 parent 6e86381 commit 401ebf3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

franka-driver/franka_driver.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <chrono>
33
#include <cmath>
44
#include <optional>
5+
#include <sstream>
56
#include <stdexcept>
67
#include <string>
78
#include <vector>
@@ -129,8 +130,14 @@ void CopyArrayToVector(std::vector<T>* dest, const std::array<T, N>& src) {
129130

130131
template <typename T, std::size_t N>
131132
std::string PrintArray(const std::string& name, std::array<T, N> data) {
132-
return
133-
name + ": " + /*common_robotics_utilities::print::Print(data, true) +*/ "\n";
133+
std::ostringstream oss;
134+
oss << name << ": [";
135+
for (std::size_t i = 0; i < N; ++i) {
136+
oss << data[i];
137+
if (i < N - 1) oss << ", ";
138+
}
139+
oss << "]\n";
140+
return oss.str();
134141
}
135142

136143
constexpr int kNdof = 7;

0 commit comments

Comments
 (0)