31 #include <opencv2/core/core.hpp> 47 NavSatPlugin::NavSatPlugin() : config_widget_(new QWidget())
51 ui_.color->setColor(Qt::green);
55 p.setColor(QPalette::Background, Qt::white);
59 QPalette p3(
ui_.status->palette());
60 p3.setColor(QPalette::Text, Qt::red);
61 ui_.status->setPalette(p3);
63 QObject::connect(
ui_.selecttopic, SIGNAL(clicked()),
this,
65 QObject::connect(
ui_.topic, SIGNAL(editingFinished()),
this,
67 QObject::connect(
ui_.positiontolerance, SIGNAL(valueChanged(
double)),
this,
69 QObject::connect(
ui_.buffersize, SIGNAL(valueChanged(
int)),
this,
71 QObject::connect(
ui_.drawstyle, SIGNAL(activated(QString)),
this,
73 QObject::connect(
ui_.color, SIGNAL(colorEdited(
const QColor&)),
this,
86 if (!topic.
name.empty())
88 ui_.topic->setText(QString::fromStdString(topic.
name));
95 std::string topic =
ui_.topic->text().trimmed().toStdString();
115 const sensor_msgs::NavSatFixConstPtr navsat)
128 stamped_point.
stamp = navsat->header.stamp;
144 points_.push_back(stamped_point);
200 node[
"topic"] >> topic;
201 ui_.topic->setText(topic.c_str());
207 node[
"color"] >> color;
212 if (node[
"draw_style"])
214 std::string draw_style;
215 node[
"draw_style"] >> draw_style;
217 if (draw_style ==
"lines")
220 ui_.drawstyle->setCurrentIndex(0);
222 else if (draw_style ==
"points")
225 ui_.drawstyle->setCurrentIndex(1);
229 if (node[
"position_tolerance"])
232 ui_.positiontolerance->setValue(position_tolerance_);
235 if (node[
"buffer_size"])
238 ui_.buffersize->setValue(buffer_size_);
246 std::string topic =
ui_.topic->text().toStdString();
247 emitter << YAML::Key <<
"topic" << YAML::Value << topic;
249 std::string color =
ui_.color->color().name().toStdString();
250 emitter << YAML::Key <<
"color" << YAML::Value << color;
252 std::string draw_style =
ui_.drawstyle->currentText().toStdString();
253 emitter << YAML::Key <<
"draw_style" << YAML::Value << draw_style;
255 emitter << YAML::Key <<
"position_tolerance" <<
258 emitter << YAML::Key <<
"buffer_size" << YAML::Value <<
buffer_size_;
static ros::master::TopicInfo selectTopic(const std::string &datatype, QWidget *parent=0)
void PrintInfo(const std::string &message)
virtual void PositionToleranceChanged(double value)
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)
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)
QWidget * GetConfigWidget(QWidget *parent)
swri_transform_util::LocalXyWgs84Util local_xy_util_
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
TFSIMD_FORCE_INLINE const tfScalar & y() const
ros::Subscriber navsat_sub_
static void PrintInfoHelper(QLabel *status_label, const std::string &message, double throttle=0.0)
void Draw(double x, double y, double scale)
static Quaternion createQuaternionFromYaw(double yaw)
void NavSatFixCallback(const sensor_msgs::NavSatFixConstPtr navsat)
double position_tolerance_
virtual void BufferSizeChanged(int value)
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual void SetColor(const QColor &color)
void PrintWarning(const std::string &message)
void LoadConfig(const YAML::Node &node, const std::string &path)
bool Initialize(QGLWidget *canvas)
virtual void SetDrawStyle(QString style)
void PrintError(const std::string &message)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
tf::Quaternion orientation
std::list< StampedPoint > points_
void SaveConfig(YAML::Emitter &emitter, const std::string &path)