19 #include <boost/cstdint.hpp> 28 #define EVENT_DATE_FORMAT "yyyy:MM:dd-HH:mm:ss.zzz000" 32 int main(
int argc,
char **argv)
34 QApplication app(argc, argv);
39 std::cout <<
"Usage: sscPositionFileReader [-v] <filename> <timestamp>\nTimestamp format " <<
EVENT_DATE_FORMAT << std::endl;
44 bool verbose = (QString(argv[1]) ==
"-v");
46 QString posFile(argv[arg++]);
51 startTS = QString(argv[arg++]);
55 std::cout <<
"This is a version 1 of the record format, and requires a timestamp parameter.";
59 boost::uint64_t tsModifier = 0;
63 boost::uint64_t ret64 = startTime.toTime_t();
67 tsModifier = ret64 & (std::numeric_limits<boost::uint64_t>::max() ^ 0xffffffff);
69 std::cout <<
"Start time: " << startTS <<
", converted to " << startTime.toString(
EVENT_DATE_FORMAT) << std::endl;
91 std::cout <<
"reading file [" << posFile.toStdString() <<
"]" << std::endl;
93 std::cout <<
"[index]\ttimestamp\tmatrix\ttoolIndex" << std::endl;
95 while (!reader.
atEnd())
100 if (!reader.
read(&T, ×tamp, &index))
102 toolIndex = QString(index);
106 if (!reader.
read(&T, ×tamp, &toolIndex))
110 boost::uint64_t ts64 = (boost::uint64_t)timestamp;
119 <<
"index:\t"<< index <<
'\t' 120 <<
"tool id:\t" << toolIndex.toStdString() <<
'\t' 123 <<
"matrix:\n" << T <<
'\n' 128 std::cout <<
"[" << index <<
"]" <<
'\t';
130 boost::array<double, 16> val = T.flatten();
132 std::cout <<
'\t' << toolIndex.toStdString();
133 std::cout << std::endl;
static QString timestampToString(double timestamp)
#define EVENT_DATE_FORMAT
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
std::ostream & stream_range(std::ostream &s, ITER begin, ITER end, char separator=' ')
int main(int argc, char *argv[])
Reader class for the position file.
bool read(Transform3D *matrix, double *timestamp, int *toolIndex)