51 PathPlugin::PathPlugin() : config_widget_(new QWidget())
54 ui_.path_color->setColor(Qt::green);
58 p.setColor(QPalette::Background, Qt::white);
62 QPalette p3(
ui_.status->palette());
63 p3.setColor(QPalette::Text, Qt::red);
64 ui_.status->setPalette(p3);
66 connect(
ui_.selecttopic, SIGNAL(clicked()),
this, SLOT(
SelectTopic()));
67 connect(
ui_.topic, SIGNAL(editingFinished()),
this, SLOT(
TopicEdited()));
68 connect(
ui_.path_color, SIGNAL(colorEdited(
const QColor&)),
this,
81 if (!topic.
name.empty())
83 ui_.topic->setText(QString::fromStdString(topic.
name));
90 std::string topic =
ui_.topic->text().trimmed().toStdString();
120 for (
unsigned int i = 0; i < path->poses.size(); i++)
123 stamped_point.
stamp = path->header.stamp;
126 path->poses[i].pose.position.y, 0);
128 points_.push_back(stamped_point);
165 QColor old_color =
ui_.path_color->color();
183 node[
"topic"] >> topic;
184 ui_.topic->setText(topic.c_str());
191 node[
"color"] >> color;
199 std::string topic =
ui_.topic->text().toStdString();
200 emitter << YAML::Key <<
"topic" << YAML::Value << topic;
202 std::string color =
ui_.path_color->color().name().toStdString();
203 emitter << YAML::Key <<
"color" << YAML::Value << color;
void PrintInfo(const std::string &message)
static ros::master::TopicInfo selectTopic(const std::string &datatype, QWidget *parent=0)
ros::Subscriber path_sub_
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
bool Initialize(QGLWidget *canvas)
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)
static void PrintInfoHelper(QLabel *status_label, const std::string &message, double throttle=0.0)
void PrintWarning(const std::string &message)
bool FindValue(const YAML::Node &node, const std::string &name)
QWidget * GetConfigWidget(QWidget *parent)
void SaveConfig(YAML::Emitter &emitter, const std::string &path)
virtual void SetColor(const QColor &color)
void LoadConfig(const YAML::Node &node, const std::string &path)
void pathCallback(const nav_msgs::PathConstPtr &path)
void PrintError(const std::string &message)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void Draw(double x, double y, double scale)
std::list< StampedPoint > points_