31 #include <opencv2/core/core.hpp> 46 GpsPlugin::GpsPlugin() : config_widget_(new QWidget())
50 ui_.color->setColor(Qt::green);
54 p.setColor(QPalette::Background, Qt::white);
58 QPalette p3(
ui_.status->palette());
59 p3.setColor(QPalette::Text, Qt::red);
60 ui_.status->setPalette(p3);
62 QObject::connect(
ui_.selecttopic, SIGNAL(clicked()),
this,
64 QObject::connect(
ui_.topic, SIGNAL(editingFinished()),
this,
66 QObject::connect(
ui_.positiontolerance, SIGNAL(valueChanged(
double)),
this,
68 QObject::connect(
ui_.buffersize, SIGNAL(valueChanged(
int)),
this,
70 QObject::connect(
ui_.drawstyle, SIGNAL(activated(QString)),
this,
72 QObject::connect(
ui_.static_arrow_sizes, SIGNAL(clicked(
bool)),
74 QObject::connect(
ui_.arrow_size, SIGNAL(valueChanged(
int)),
76 connect(
ui_.color, SIGNAL(colorEdited(
const QColor&)),
this,
89 if (!topic.
name.empty())
91 ui_.topic->setText(QString::fromStdString(topic.
name));
98 std::string topic =
ui_.topic->text().trimmed().toStdString();
131 stamped_point.
stamp = gps->header.stamp;
150 points_.push_back(stamped_point);
207 node[
"topic"] >> topic;
208 ui_.topic->setText(topic.c_str());
214 node[
"color"] >> color;
219 if (node[
"draw_style"])
221 std::string draw_style;
222 node[
"draw_style"] >> draw_style;
224 if (draw_style ==
"lines")
227 ui_.drawstyle->setCurrentIndex(0);
229 else if (draw_style ==
"points")
232 ui_.drawstyle->setCurrentIndex(1);
234 else if (draw_style ==
"arrows")
237 ui_.drawstyle->setCurrentIndex(2);
241 if (node[
"position_tolerance"])
244 ui_.positiontolerance->setValue(position_tolerance_);
247 if (node[
"buffer_size"])
250 ui_.buffersize->setValue(buffer_size_);
253 if (node[
"show_laps"])
255 bool show_laps =
false;
256 node[
"show_laps"] >> show_laps;
257 ui_.show_laps->setChecked(show_laps);
260 if (node[
"static_arrow_sizes"])
262 bool static_arrow_sizes = node[
"static_arrow_sizes"].as<
bool>();
263 ui_.static_arrow_sizes->setChecked(static_arrow_sizes);
267 if (node[
"arrow_size"])
269 ui_.arrow_size->setValue(node[
"arrow_size"].as<int>());
277 std::string topic =
ui_.topic->text().toStdString();
278 emitter << YAML::Key <<
"topic" << YAML::Value << topic;
280 emitter << YAML::Key <<
"color" << YAML::Value
281 <<
ui_.color->color().name().toStdString();
283 std::string draw_style =
ui_.drawstyle->currentText().toStdString();
284 emitter << YAML::Key <<
"draw_style" << YAML::Value << draw_style;
286 emitter << YAML::Key <<
"position_tolerance" <<
291 emitter << YAML::Key <<
"buffer_size" << YAML::Value <<
buffer_size_;
295 emitter << YAML::Key <<
"buffer_size" << YAML::Value <<
buffer_holder_;
298 bool show_laps =
ui_.show_laps->isChecked();
299 emitter << YAML::Key <<
"show_laps" << YAML::Value << show_laps;
301 emitter << YAML::Key <<
"static_arrow_sizes" << YAML::Value <<
ui_.static_arrow_sizes->isChecked();
303 emitter << YAML::Key <<
"arrow_size" << YAML::Value <<
ui_.arrow_size->value();
static ros::master::TopicInfo selectTopic(const std::string &datatype, QWidget *parent=0)
virtual void PositionToleranceChanged(double value)
virtual void SetArrowSize(int arrowSize)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
virtual bool DrawPoints(double scale)
QWidget * GetConfigWidget(QWidget *parent)
static void PrintWarningHelper(QLabel *status_label, const std::string &message, double throttle=0.0)
static void PrintErrorHelper(QLabel *status_label, const std::string &message, double throttle=0.0)
void LoadConfig(const YAML::Node &node, const std::string &path)
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
TFSIMD_FORCE_INLINE const tfScalar & y() const
static void PrintInfoHelper(QLabel *status_label, const std::string &message, double throttle=0.0)
bool Initialize(QGLWidget *canvas)
void GPSFixCallback(const gps_common::GPSFixConstPtr &gps)
static Quaternion createQuaternionFromYaw(double yaw)
double position_tolerance_
void Draw(double x, double y, double scale)
void SaveConfig(YAML::Emitter &emitter, const std::string &path)
virtual void BufferSizeChanged(int value)
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual void SetColor(const QColor &color)
virtual void SetStaticArrowSizes(bool isChecked)
void PrintWarning(const std::string &message)
void PrintInfo(const std::string &message)
void PrintError(const std::string &message)
virtual void SetDrawStyle(QString style)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
tf::Quaternion orientation
swri_transform_util::LocalXyWgs84Util local_xy_util_
std::list< StampedPoint > points_