52 TfFramePlugin::TfFramePlugin() : config_widget_(new QWidget())
56 ui_.color->setColor(Qt::green);
60 p.setColor(QPalette::Background, Qt::white);
64 QPalette p3(
ui_.status->palette());
65 p3.setColor(QPalette::Text, Qt::red);
66 ui_.status->setPalette(p3);
68 QObject::connect(
ui_.selectframe, SIGNAL(clicked()),
this,
70 QObject::connect(
ui_.frame, SIGNAL(editingFinished()),
this,
72 QObject::connect(
ui_.positiontolerance, SIGNAL(valueChanged(
double)),
this,
74 QObject::connect(
ui_.buffersize, SIGNAL(valueChanged(
int)),
this,
76 QObject::connect(
ui_.drawstyle, SIGNAL(activated(QString)),
this,
78 QObject::connect(
ui_.static_arrow_sizes, SIGNAL(clicked(
bool)),
80 QObject::connect(
ui_.arrow_size, SIGNAL(valueChanged(
int)),
82 QObject::connect(
ui_.color, SIGNAL(colorEdited(
const QColor&)),
this,
84 QObject::connect(
ui_.buttonResetBuffer, SIGNAL(pressed()),
this,
97 ui_.frame->setText(QString::fromStdString(frame));
170 const std::string& path)
175 ui_.frame->setText(source_frame_.c_str());
181 node[
"color"] >> color;
182 QColor qcolor(color.c_str());
184 ui_.color->setColor(qcolor);
187 if (node[
"draw_style"])
189 std::string draw_style;
190 node[
"draw_style"] >> draw_style;
192 if (draw_style ==
"lines")
194 ui_.drawstyle->setCurrentIndex(0);
197 else if (draw_style ==
"points")
199 ui_.drawstyle->setCurrentIndex(1);
202 else if (draw_style ==
"arrows")
204 ui_.drawstyle->setCurrentIndex(2);
209 if (node[
"position_tolerance"])
211 double position_tolerance;
212 node[
"position_tolerance"] >> position_tolerance;
213 ui_.positiontolerance->setValue(position_tolerance);
217 if (node[
"buffer_size"])
220 node[
"buffer_size"] >> buffer_size;
221 ui_.buffersize->setValue(buffer_size);
225 if (node[
"static_arrow_sizes"])
227 bool static_arrow_sizes = node[
"static_arrow_sizes"].as<
bool>();
228 ui_.static_arrow_sizes->setChecked(static_arrow_sizes);
232 if (node[
"arrow_size"])
234 int arrow_size = node[
"arrow_size"].as<
int>();
235 ui_.arrow_size->setValue(arrow_size);
243 const std::string& path)
245 emitter << YAML::Key <<
"frame" << YAML::Value
246 <<
ui_.frame->text().toStdString();
247 emitter << YAML::Key <<
"color" << YAML::Value
248 <<
ui_.color->color().name().toStdString();
250 std::string draw_style =
ui_.drawstyle->currentText().toStdString();
251 emitter << YAML::Key <<
"draw_style" << YAML::Value << draw_style;
253 emitter << YAML::Key <<
"position_tolerance" <<
256 emitter << YAML::Key <<
"buffer_size" << YAML::Value <<
bufferSize();
258 emitter << YAML::Key <<
"static_arrow_sizes" << YAML::Value <<
ui_.static_arrow_sizes->isChecked();
260 emitter << YAML::Key <<
"arrow_size" << YAML::Value <<
ui_.arrow_size->value();
bool GetTransform(const ros::Time &stamp, swri_transform_util::Transform &transform, bool use_latest_transforms=true)
double positionTolerance() const
void Draw(double x, double y, double scale)
void transform(Route &route, const swri_transform_util::Transform &transform, const std::string &target_frame)
virtual void PositionToleranceChanged(double value)
virtual void SetArrowSize(int arrowSize)
void PrintWarning(const std::string &message)
void PrintError(const std::string &message)
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)
std::string target_frame_
static void PrintInfoHelper(QLabel *status_label, const std::string &message, double throttle=0.0)
std::string source_frame_
void TimerCallback(const ros::TimerEvent &event)
void LoadConfig(const YAML::Node &node, const std::string &path)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
virtual void BufferSizeChanged(int value)
virtual void SetColor(const QColor &color)
virtual void SetStaticArrowSizes(bool isChecked)
double bufferSize() const
void SaveConfig(YAML::Emitter &emitter, const std::string &path)
boost::shared_ptr< tf::TransformListener > tf_
void pushPoint(StampedPoint point)
void PrintInfo(const std::string &message)
virtual void SetDrawStyle(QString style)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
tf::Quaternion orientation
bool Initialize(QGLWidget *canvas)