42 #include <opencv2/core/core.hpp>
61 ui_.color->setColor(Qt::green);
65 p.setColor(QPalette::Background, Qt::white);
69 QPalette p3(
ui_.status->palette());
70 p3.setColor(QPalette::Text, Qt::red);
71 ui_.status->setPalette(p3);
73 QObject::connect(
ui_.selecttopic, SIGNAL(clicked()),
this,
75 QObject::connect(
ui_.topic, SIGNAL(editingFinished()),
this,
77 QObject::connect(
ui_.positiontolerance, SIGNAL(valueChanged(
double)),
this,
79 QObject::connect(
ui_.buffersize, SIGNAL(valueChanged(
int)),
this,
81 QObject::connect(
ui_.drawstyle, SIGNAL(activated(QString)),
this,
83 QObject::connect(
ui_.static_arrow_sizes, SIGNAL(clicked(
bool)),
85 QObject::connect(
ui_.use_latest_transforms, SIGNAL(clicked(
bool)),
87 QObject::connect(
ui_.arrow_size, SIGNAL(valueChanged(
int)),
89 QObject::connect(
ui_.color, SIGNAL(colorEdited(
const QColor&)),
this,
91 QObject::connect(
ui_.show_laps, SIGNAL(toggled(
bool)),
this,
93 QObject::connect(
ui_.buttonResetBuffer, SIGNAL(pressed()),
this,
106 if (!topic.
name.empty())
108 ui_.topic->setText(QString::fromStdString(topic.
name));
115 std::string topic =
ui_.topic->text().trimmed().toStdString();
144 stamped_point.
stamp = pose->header.stamp;
153 pose->pose.position.y,
154 pose->pose.position.z);
157 pose->pose.orientation.x,
158 pose->pose.orientation.y,
159 pose->pose.orientation.z,
160 pose->pose.orientation.w);
208 node[
"topic"] >> topic;
209 ui_.topic->setText(topic.c_str());
215 node[
"color"] >> color;
216 QColor qcolor(color.c_str());
218 ui_.color->setColor(qcolor);
221 if (node[
"draw_style"])
223 std::string draw_style;
224 node[
"draw_style"] >> draw_style;
226 if (draw_style ==
"lines")
228 ui_.drawstyle->setCurrentIndex(0);
231 else if (draw_style ==
"points")
233 ui_.drawstyle->setCurrentIndex(1);
236 else if (draw_style ==
"arrows")
238 ui_.drawstyle->setCurrentIndex(2);
243 if (node[
"position_tolerance"])
245 double position_tolerance;
246 node[
"position_tolerance"] >> position_tolerance;
247 ui_.positiontolerance->setValue(position_tolerance);
251 if (node[
"buffer_size"])
254 node[
"buffer_size"] >> buffer_size;
255 ui_.buffersize->setValue(buffer_size);
259 if (node[
"show_laps"])
261 bool show_laps =
false;
262 node[
"show_laps"] >> show_laps;
263 ui_.show_laps->setChecked(show_laps);
267 if (node[
"static_arrow_sizes"])
269 bool static_arrow_sizes = node[
"static_arrow_sizes"].as<
bool>();
270 ui_.static_arrow_sizes->setChecked(static_arrow_sizes);
274 if (node[
"arrow_size"])
276 int arrow_size = node[
"arrow_size"].as<
int>();
277 ui_.arrow_size->setValue(arrow_size);
281 if (node[
"use_latest_transforms"])
283 bool use_latest_transforms = node[
"use_latest_transforms"].as<
bool>();
284 ui_.use_latest_transforms->setChecked(use_latest_transforms);
293 std::string topic =
ui_.topic->text().toStdString();
294 emitter << YAML::Key <<
"topic" << YAML::Value << topic;
296 emitter << YAML::Key <<
"color" << YAML::Value
297 <<
ui_.color->color().name().toStdString();
299 std::string draw_style =
ui_.drawstyle->currentText().toStdString();
300 emitter << YAML::Key <<
"draw_style" << YAML::Value << draw_style;
302 emitter << YAML::Key <<
"position_tolerance" <<
305 emitter << YAML::Key <<
"buffer_size" << YAML::Value <<
bufferSize();
307 bool show_laps =
ui_.show_laps->isChecked();
308 emitter << YAML::Key <<
"show_laps" << YAML::Value << show_laps;
310 emitter << YAML::Key <<
"static_arrow_sizes" << YAML::Value <<
ui_.static_arrow_sizes->isChecked();
312 emitter << YAML::Key <<
"arrow_size" << YAML::Value <<
ui_.arrow_size->value();
314 emitter << YAML::Key <<
"use_latest_transforms" << YAML::Value <<
ui_.use_latest_transforms->isChecked();