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,
82 if (!topic.
name.empty())
84 ui_.topic->setText(QString::fromStdString(topic.
name));
91 std::string topic =
ui_.topic->text().trimmed().toStdString();
121 for (
unsigned int i = 0; i < path->poses.size(); i++)
124 stamped_point.
stamp = path->header.stamp;
127 path->poses[i].pose.position.y, 0);
166 QColor old_color =
ui_.path_color->color();
167 QColor color = old_color.dark(200);
185 node[
"topic"] >> topic;
186 ui_.topic->setText(topic.c_str());
193 node[
"color"] >> color;
194 QColor qcolor(color.c_str());
196 ui_.path_color->setColor(qcolor);
202 std::string topic =
ui_.topic->text().toStdString();
203 emitter << YAML::Key <<
"topic" << YAML::Value << topic;
205 std::string color =
ui_.path_color->color().name().toStdString();
206 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)
const std::deque< StampedPoint > & points() const
void pushPoint(StampedPoint point)
virtual void SetDrawStyle(QString style)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void Draw(double x, double y, double scale)