handeye_target_widget.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2019, Intel Corporation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Yu Yan, John Stechschulte */
36 
38 
39 namespace moveit_rviz_plugin
40 {
41 const std::string LOGNAME = "handeye_target_widget";
42 
43 void RosTopicComboBox::addMsgsFilterType(QString msgs_type)
44 {
45  message_types_.insert(msgs_type);
46 }
47 
48 bool RosTopicComboBox::hasTopic(const QString& topic_name)
49 {
51  return image_topics_.contains(topic_name);
52 }
53 
55 {
56  // Get all topic names
57  ros::master::V_TopicInfo ros_topic_vec;
58  if (ros::master::getTopics(ros_topic_vec))
59  {
60  image_topics_.clear();
61  // Filter out the topic names with specific topic type
62  for (const ros::master::TopicInfo& topic_info : ros_topic_vec)
63  {
64  if (message_types_.contains(QString(topic_info.datatype.c_str())))
65  {
66  image_topics_.insert(QString(topic_info.name.c_str()));
67  }
68  }
69  }
70 
71  clear();
72  addItem(QString(""));
73  for (const QString& topic : image_topics_)
74  {
75  addItem(topic);
76  }
77 
78  return !image_topics_.isEmpty();
79 }
80 
81 void RosTopicComboBox::mousePressEvent(QMouseEvent* event)
82 {
84  showPopup();
85 }
86 
88  : QWidget(parent)
89  , calibration_display_(pdisplay)
90  , nh_("~")
91  , it_(nh_)
92  , target_plugins_loader_(nullptr)
93  , target_(nullptr)
94  , target_param_layout_(new QFormLayout())
95 {
96  // Target setting tab area -----------------------------------------------
97  QHBoxLayout* layout = new QHBoxLayout();
98  this->setLayout(layout);
99  QVBoxLayout* layout_left = new QVBoxLayout();
100  layout->addLayout(layout_left);
101 
102  // Target creation area
103  QGroupBox* group_left_top = new QGroupBox("Target Params", this);
104 
105  layout_left->addWidget(group_left_top);
106  group_left_top->setLayout(target_param_layout_);
107 
108  target_type_ = new QComboBox();
109  connect(target_type_, SIGNAL(activated(const QString&)), this, SLOT(targetTypeComboboxChanged(const QString&)));
110  target_param_layout_->addRow("Target Type", target_type_);
111 
112  // Target 3D pose recognition area
113  QGroupBox* group_left_bottom = new QGroupBox("Target Pose Detection", this);
114  layout_left->addWidget(group_left_bottom);
115  QFormLayout* layout_left_bottom = new QFormLayout();
116  group_left_bottom->setLayout(layout_left_bottom);
117 
118  ros_topics_.insert(std::make_pair("image_topic", new RosTopicComboBox(this)));
119  ros_topics_["image_topic"]->addMsgsFilterType("sensor_msgs/Image");
120  layout_left_bottom->addRow("Image Topic", ros_topics_["image_topic"]);
121  connect(ros_topics_["image_topic"], SIGNAL(activated(const QString&)), this,
122  SLOT(imageTopicComboboxChanged(const QString&)));
123 
124  ros_topics_.insert(std::make_pair("camera_info_topic", new RosTopicComboBox(this)));
125  ros_topics_["camera_info_topic"]->addMsgsFilterType("sensor_msgs/CameraInfo");
126  layout_left_bottom->addRow("CameraInfo Topic", ros_topics_["camera_info_topic"]);
127  connect(ros_topics_["camera_info_topic"], SIGNAL(activated(const QString&)), this,
128  SLOT(cameraInfoComboBoxChanged(const QString&)));
129 
130  // Target image dislay, create and save area
131  QGroupBox* group_right = new QGroupBox("Target", this);
132  group_right->setMinimumWidth(330);
133  layout->addWidget(group_right);
134  QVBoxLayout* layout_right = new QVBoxLayout();
135  group_right->setLayout(layout_right);
136 
137  target_display_label_ = new QLabel();
138  target_display_label_->setAlignment(Qt::AlignHCenter);
139  layout_right->addWidget(target_display_label_);
140 
141  QPushButton* create_target_btn = new QPushButton("Create Target");
142  layout_right->addWidget(create_target_btn);
143  connect(create_target_btn, SIGNAL(clicked(bool)), this, SLOT(createTargetImageBtnClicked(bool)));
144 
145  QPushButton* save_target_btn = new QPushButton("Save Target");
146  layout_right->addWidget(save_target_btn);
147  connect(save_target_btn, SIGNAL(clicked(bool)), this, SLOT(saveTargetImageBtnClicked(bool)));
148 
149  // Load availible target plugins
150  loadAvailableTargetPlugins();
151 
152  // Initialize image publisher
153  image_pub_ = it_.advertise("/handeye_calibration/target_detection", 1);
154 
155  // Register custom types
156  qRegisterMetaType<sensor_msgs::CameraInfo>();
157  qRegisterMetaType<std::string>();
158 
159  // Initialize status
160  calibration_display_->setStatusStd(rviz::StatusProperty::Warn, "Target detection", "Not subscribed to image topic.");
161 }
162 
163 void TargetTabWidget::loadWidget(const rviz::Config& config)
164 {
165  if (target_type_->count() > 0)
166  {
167  QString type;
168  if (config.mapGetString("target_type", &type) && target_type_->findText(type, Qt::MatchCaseSensitive) != -1)
169  {
170  target_type_->setCurrentText(type);
172  }
173  }
174 
175  int param_int;
176  float param_float;
177  QString param_enum;
179  {
180  switch (param.parameter_type_)
181  {
182  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Int:
183  if (config.mapGetInt(param.name_.c_str(), &param_int))
184  static_cast<QLineEdit*>(target_param_inputs_[param.name_])->setText(std::to_string(param_int).c_str());
185  break;
186  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Float:
187  if (config.mapGetFloat(param.name_.c_str(), &param_float))
188  static_cast<QLineEdit*>(target_param_inputs_[param.name_])->setText(std::to_string(param_float).c_str());
189  break;
190  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Enum:
191  if (config.mapGetString(param.name_.c_str(), &param_enum))
192  {
193  int index = static_cast<QComboBox*>(target_param_inputs_[param.name_])->findText(param_enum);
194  static_cast<QComboBox*>(target_param_inputs_[param.name_])->setCurrentIndex(index);
195  }
196  break;
197  }
198  }
199 
200  for (const std::pair<const std::string, RosTopicComboBox*>& topic : ros_topics_)
201  {
202  QString topic_name;
203  if (config.mapGetString(topic.first.c_str(), &topic_name))
204  {
205  if (topic.second->hasTopic(topic_name))
206  {
207  topic.second->setCurrentText(topic_name);
208  try
209  {
210  if (!topic.first.compare("image_topic"))
211  {
213  image_sub_ = it_.subscribe(topic_name.toStdString(), 1, &TargetTabWidget::imageCallback, this);
214  }
215 
216  if (!topic.first.compare("camera_info_topic"))
217  {
219  camerainfo_sub_ = nh_.subscribe(topic_name.toStdString(), 1, &TargetTabWidget::cameraInfoCallback, this);
220  }
221  }
223  {
224  ROS_ERROR_STREAM_NAMED(LOGNAME, "Subscribe to " << topic_name.toStdString() << " fail: " << e.what());
225  }
226  }
227  }
228  }
229 }
230 
232 {
233  config.mapSetValue("target_type", target_type_->currentText());
234 
235  QString param_value;
237  {
238  switch (param.parameter_type_)
239  {
240  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Int:
241  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Float:
242  param_value = static_cast<QLineEdit*>(target_param_inputs_[param.name_])->text();
243  config.mapSetValue(param.name_.c_str(), param_value);
244  break;
245  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Enum:
246  param_value = static_cast<QComboBox*>(target_param_inputs_[param.name_])->currentText();
247  config.mapSetValue(param.name_.c_str(), param_value);
248  break;
249  }
250  }
251 
252  for (const std::pair<const std::string, RosTopicComboBox*>& topic : ros_topics_)
253  config.mapSetValue(topic.first.c_str(), topic.second->currentText());
254 }
255 
257 {
259  {
260  try
261  {
263  "moveit_calibration_plugins", "moveit_handeye_calibration::HandEyeTargetBase"));
264  }
266  {
267  QMessageBox::warning(this, tr("Exception while creating handeye target plugin loader "), tr(ex.what()));
268  return false;
269  }
270  }
271 
272  // Get target classes
273  const std::vector<std::string>& classes = target_plugins_loader_->getDeclaredClasses();
274 
275  target_type_->clear();
276  if (classes.empty())
277  {
278  QMessageBox::warning(this, tr("Missing target plugins"), "No MoveIt handeye calibration target plugin found.");
279  return false;
280  }
281 
282  for (const std::string& it : classes)
283  target_type_->addItem(tr(it.c_str()));
284  loadInputWidgetsForTargetType(classes[0]);
285 
286  return true;
287 }
288 
289 bool TargetTabWidget::loadInputWidgetsForTargetType(const std::string& plugin_name)
290 {
291  if (plugin_name.empty())
292  return false;
293 
294  try
295  {
296  target_ = target_plugins_loader_->createUniqueInstance(plugin_name);
297  target_plugin_params_ = target_->getParameters();
298  target_param_inputs_.clear();
299  // clear out layout, except target type
300  while (target_param_layout_->rowCount() > 1)
301  {
302  target_param_layout_->removeRow(1);
303  }
304  for (const auto& param : target_plugin_params_)
305  {
306  switch (param.parameter_type_)
307  {
308  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Int:
309  target_param_inputs_.insert(std::make_pair(param.name_, new QLineEdit()));
310  target_param_layout_->addRow(param.name_.c_str(), target_param_inputs_[param.name_]);
311  static_cast<QLineEdit*>(target_param_inputs_[param.name_])->setText(std::to_string(param.value_.i).c_str());
312  break;
313  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Float:
314  target_param_inputs_.insert(std::make_pair(param.name_, new QLineEdit()));
315  target_param_layout_->addRow(param.name_.c_str(), target_param_inputs_[param.name_]);
316  static_cast<QLineEdit*>(target_param_inputs_[param.name_])->setText(std::to_string(param.value_.f).c_str());
317  break;
318  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Enum:
319  QComboBox* combo_box = new QComboBox();
320  for (const std::string& value : param.enum_values_)
321  {
322  combo_box->addItem(tr(value.c_str()));
323  }
324  target_param_inputs_.insert(std::make_pair(param.name_, combo_box));
325  target_param_layout_->addRow(param.name_.c_str(), target_param_inputs_[param.name_]);
326  static_cast<QComboBox*>(target_param_inputs_[param.name_])->setCurrentIndex(param.value_.e);
327  break;
328  }
329  }
330  }
332  {
333  QMessageBox::warning(this, tr("Exception while loading a handeye target plugin"), tr(ex.what()));
334  target_ = nullptr;
335  return false;
336  }
337  return true;
338 }
339 
341 {
342  if (!target_)
343  return false;
344 
345  try
346  {
347  // TODO: load parameters from GUI
348  for (const auto& param : target_plugin_params_)
349  {
350  switch (param.parameter_type_)
351  {
352  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Int:
353  target_->setParameter(param.name_, static_cast<QLineEdit*>(target_param_inputs_[param.name_])->text().toInt());
354  break;
355  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Float:
356  target_->setParameter(param.name_,
357  static_cast<QLineEdit*>(target_param_inputs_[param.name_])->text().toFloat());
358  break;
359  case moveit_handeye_calibration::HandEyeTargetBase::Parameter::ParameterType::Enum:
360  target_->setParameter(
361  param.name_, static_cast<QComboBox*>(target_param_inputs_[param.name_])->currentText().toStdString());
362  break;
363  }
364  }
365  target_->initialize();
366  }
368  {
369  QMessageBox::warning(this, tr("Exception while loading a handeye target plugin"), tr(ex.what()));
370  target_ = nullptr;
371  return false;
372  }
373 
374  return true;
375 }
376 
377 void TargetTabWidget::imageCallback(const sensor_msgs::ImageConstPtr& msg)
378 {
380 
381  // Depth image format `16UC1` cannot be converted to `MONO8`
382  if (msg->encoding == "16UC1")
383  {
385  "Received 16-bit image, which cannot be processed.");
386  return;
387  }
388 
389  std::string frame_id = msg->header.frame_id;
390  if (!frame_id.empty())
391  {
392  if (optical_frame_.compare(frame_id))
393  {
394  optical_frame_ = frame_id;
396  }
397  }
398  else
399  {
400  ROS_ERROR_STREAM_NAMED(LOGNAME, "Image msg has empty frame_id.");
402  "Image message has empty frame ID.");
403  return;
404  }
405 
406  if (msg->data.empty())
407  {
408  ROS_ERROR_STREAM_NAMED(LOGNAME, "Image msg has empty data.");
409  calibration_display_->setStatus(rviz::StatusProperty::Error, "Target detection", "Image message is empty.");
410  return;
411  }
412 
413  cv_bridge::CvImagePtr cv_ptr;
414  try
415  {
417 
418  sensor_msgs::ImagePtr pub_msg;
419  if (target_ && target_->detectTargetPose(cv_ptr->image))
420  {
421  pub_msg = cv_bridge::CvImage(std_msgs::Header(), "rgb8", cv_ptr->image).toImageMsg();
422 
423  geometry_msgs::TransformStamped tf2_msg = target_->getTransformStamped(optical_frame_);
424  tf_pub_.sendTransform(tf2_msg);
425  if (!target_->areIntrinsicsReasonable())
426  {
428  rviz::StatusProperty::Warn, "Target detection",
429  "Target detector has not received reasonable intrinsics. Attempted detection anyway.");
430  }
431  else
432  {
433  calibration_display_->setStatus(rviz::StatusProperty::Ok, "Target detection", "Target pose detected.");
434  }
435  }
436  else
437  {
438  pub_msg = cv_bridge::CvImage(std_msgs::Header(), "mono8", cv_ptr->image).toImageMsg();
439  calibration_display_->setStatus(rviz::StatusProperty::Error, "Target detection", "Target detection failed.");
440  }
441  image_pub_.publish(pub_msg);
442  }
443  catch (cv_bridge::Exception& e)
444  {
445  std::string error_message = "cv_bridge exception: " + std::string(e.what());
446  calibration_display_->setStatusStd(rviz::StatusProperty::Error, "Target detection", error_message);
447  ROS_ERROR_NAMED(LOGNAME, "%s", error_message.c_str());
448  }
449  catch (cv::Exception& e)
450  {
451  std::string error_message = "cv exception: " + std::string(e.what());
452  calibration_display_->setStatusStd(rviz::StatusProperty::Error, "Target detection", error_message);
453  ROS_ERROR_NAMED(LOGNAME, "%s", error_message.c_str());
454  }
455 }
456 
457 void TargetTabWidget::cameraInfoCallback(const sensor_msgs::CameraInfoConstPtr& msg)
458 {
459  if (target_ && msg->height > 0 && msg->width > 0 && !msg->K.empty() && !msg->D.empty() &&
460  (!camera_info_ || msg->K != camera_info_->K || msg->P != camera_info_->P))
461  {
462  ROS_DEBUG_NAMED(LOGNAME, "Received camera info.");
463  camera_info_ = msg;
464  target_->setCameraIntrinsicParams(camera_info_);
466  }
467 }
468 
469 void TargetTabWidget::targetTypeComboboxChanged(const QString& text)
470 {
471  if (!text.isEmpty())
472  {
473  loadInputWidgetsForTargetType(text.toStdString());
474  if (target_)
475  {
476  target_->setCameraIntrinsicParams(camera_info_);
477  }
478  }
479 }
480 
482 {
484  if (target_)
485  {
486  target_->createTargetImage(target_image_);
487  }
488  else
489  QMessageBox::warning(this, tr("Fail to create a target image."), "No available target plugin.");
490 
491  if (!target_image_.empty())
492  {
493  // Show target image
494  QImage qimage(target_image_.data, target_image_.cols, target_image_.rows, QImage::Format_Grayscale8);
495  if (target_image_.cols > target_image_.rows)
496  qimage = qimage.scaledToWidth(320, Qt::SmoothTransformation);
497  else
498  qimage = qimage.scaledToHeight(260, Qt::SmoothTransformation);
499  target_display_label_->setPixmap(QPixmap::fromImage(qimage));
500  }
501 }
502 
504 {
505  if (target_image_.empty())
506  {
507  QMessageBox::warning(this, tr("Unable to save image"), tr("Please create a target at first."));
508  return;
509  }
510 
511  // DontUseNativeDialog option set to avoid this issue: https://github.com/ros-planning/moveit/issues/2357
512  QString fileName =
513  QFileDialog::getSaveFileName(this, tr("Save Target Image"), "", tr("Target Image (*.png);;All Files (*)"),
514  nullptr, QFileDialog::DontUseNativeDialog);
515 
516  if (fileName.isEmpty())
517  return;
518 
519  if (!fileName.endsWith(".png"))
520  fileName += ".png";
521 
522  QFile file(fileName);
523  if (!file.open(QIODevice::WriteOnly))
524  {
525  QMessageBox::warning(this, tr("Unable to open file"), file.errorString());
526  return;
527  }
528 
529  if (!cv::imwrite(cv::String(fileName.toStdString()), target_image_))
530  ROS_ERROR_STREAM_NAMED(LOGNAME, "Error OpenCV saving image.");
531 }
532 
533 void TargetTabWidget::imageTopicComboboxChanged(const QString& topic)
534 {
536 
537  calibration_display_->setStatusStd(rviz::StatusProperty::Warn, "Target detection", "Not subscribed to image topic.");
538  if (!topic.isNull() and !topic.isEmpty())
539  {
540  try
541  {
542  image_sub_ = it_.subscribe(topic.toStdString(), 1, &TargetTabWidget::imageCallback, this);
543  }
545  {
546  ROS_ERROR_STREAM_NAMED(LOGNAME, "Subscribe to image topic: " << topic.toStdString() << " failed. " << e.what());
548  "Failed to subscribe to image topic.");
549  }
550  }
551 }
552 
553 void TargetTabWidget::cameraInfoComboBoxChanged(const QString& topic)
554 {
557  "Not subscribed to camera info topic.");
558  if (!topic.isNull() and !topic.isEmpty())
559  {
560  try
561  {
562  camerainfo_sub_ = nh_.subscribe(topic.toStdString(), 1, &TargetTabWidget::cameraInfoCallback, this);
563  }
564  catch (ros::Exception& e)
565  {
567  "Subscribe to camera info topic: " << topic.toStdString() << " failed. " << e.what());
569  "Failed to subscribe to camera info topic.");
570  }
571  }
572 }
573 
574 } // namespace moveit_rviz_plugin
moveit_rviz_plugin::TargetTabWidget::image_pub_
image_transport::Publisher image_pub_
Definition: handeye_target_widget.h:201
moveit_rviz_plugin::TargetTabWidget::createTargetInstance
bool createTargetInstance()
Definition: handeye_target_widget.cpp:372
moveit_rviz_plugin::TargetTabWidget::saveWidget
void saveWidget(rviz::Config &config)
Definition: handeye_target_widget.cpp:263
moveit_rviz_plugin::TargetTabWidget::opticalFrameChanged
void opticalFrameChanged(const std::string &frame_id)
boost::shared_ptr
cv_bridge::CvImage::toImageMsg
sensor_msgs::ImagePtr toImageMsg() const
moveit_rviz_plugin::TargetTabWidget::loadInputWidgetsForTargetType
bool loadInputWidgetsForTargetType(const std::string &plugin_name)
Definition: handeye_target_widget.cpp:321
rviz::StatusProperty::Error
Error
moveit_rviz_plugin::TargetTabWidget::tf_pub_
tf2_ros::TransformBroadcaster tf_pub_
Definition: handeye_target_widget.h:204
moveit_rviz_plugin::TargetTabWidget::ros_topics_
std::map< std::string, RosTopicComboBox * > ros_topics_
Definition: handeye_target_widget.h:176
moveit_rviz_plugin::TargetTabWidget::cameraInfoComboBoxChanged
void cameraInfoComboBoxChanged(const QString &topic)
Definition: handeye_target_widget.cpp:585
moveit_rviz_plugin::RosTopicComboBox::addMsgsFilterType
void addMsgsFilterType(QString msgs_type)
Definition: handeye_target_widget.cpp:75
moveit_rviz_plugin::TargetTabWidget::target_type_
QComboBox * target_type_
Definition: handeye_target_widget.h:169
handeye_target_widget.h
moveit_rviz_plugin::TargetTabWidget::image_sub_
image_transport::Subscriber image_sub_
Definition: handeye_target_widget.h:200
moveit_rviz_plugin::TargetTabWidget::target_image_
cv::Mat target_image_
Definition: handeye_target_widget.h:187
moveit_rviz_plugin::TargetTabWidget::target_param_inputs_
std::map< std::string, QWidget * > target_param_inputs_
Definition: handeye_target_widget.h:171
ros::Subscriber::shutdown
void shutdown()
ros::Exception
ROS_ERROR_NAMED
#define ROS_ERROR_NAMED(name,...)
cv_bridge::Exception
moveit_rviz_plugin::TargetTabWidget::target_plugin_params_
std::vector< moveit_handeye_calibration::HandEyeTargetBase::Parameter > target_plugin_params_
Definition: handeye_target_widget.h:170
moveit_rviz_plugin::TargetTabWidget::target_param_layout_
QFormLayout * target_param_layout_
Definition: handeye_target_widget.h:168
ros::master::getTopics
ROSCPP_DECL bool getTopics(V_TopicInfo &topics)
moveit_rviz_plugin::RosTopicComboBox::RosTopicComboBox
RosTopicComboBox(QWidget *parent=Q_NULLPTR)
Definition: handeye_target_widget.h:91
pluginlib::PluginlibException
image_transport::TransportLoadException
moveit_rviz_plugin::HandEyeCalibrationDisplay
Definition: handeye_calibration_display.h:89
moveit_rviz_plugin::RosTopicComboBox::message_types_
QSet< QString > message_types_
Definition: handeye_target_widget.h:105
moveit_rviz_plugin::TargetTabWidget::camerainfo_sub_
ros::Subscriber camerainfo_sub_
Definition: handeye_target_widget.h:202
rviz::Display::setStatus
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
moveit_rviz_plugin::RosTopicComboBox::getFilteredTopics
bool getFilteredTopics()
Definition: handeye_target_widget.cpp:86
moveit_rviz_plugin::LOGNAME
const std::string LOGNAME
Definition: handeye_context_widget.cpp:74
moveit_rviz_plugin::TargetTabWidget::TargetTabWidget
TargetTabWidget(HandEyeCalibrationDisplay *pdisplay, QWidget *parent=Q_NULLPTR)
Definition: handeye_target_widget.cpp:119
moveit_rviz_plugin::TargetTabWidget::saveTargetImageBtnClicked
void saveTargetImageBtnClicked(bool clicked)
Definition: handeye_target_widget.cpp:535
tf2_ros::TransformBroadcaster::sendTransform
void sendTransform(const geometry_msgs::TransformStamped &transform)
moveit_rviz_plugin::TargetTabWidget::nh_
ros::NodeHandle nh_
Definition: handeye_target_widget.h:196
cv_bridge::toCvCopy
CvImagePtr toCvCopy(const sensor_msgs::CompressedImage &source, const std::string &encoding=std::string())
image_transport::ImageTransport::subscribe
Subscriber subscribe(const std::string &base_topic, uint32_t queue_size, const boost::function< void(const sensor_msgs::ImageConstPtr &)> &callback, const ros::VoidPtr &tracked_object=ros::VoidPtr(), const TransportHints &transport_hints=TransportHints())
ROS_DEBUG_NAMED
#define ROS_DEBUG_NAMED(name,...)
ros::master::V_TopicInfo
std::vector< TopicInfo > V_TopicInfo
moveit_rviz_plugin::TargetTabWidget::loadAvailableTargetPlugins
bool loadAvailableTargetPlugins()
Definition: handeye_target_widget.cpp:288
moveit_rviz_plugin::TargetTabWidget::it_
image_transport::ImageTransport it_
Definition: handeye_target_widget.h:199
ROS_ERROR_STREAM_NAMED
#define ROS_ERROR_STREAM_NAMED(name, args)
rviz::StatusProperty::Ok
Ok
rviz::StatusProperty::Warn
Warn
moveit_rviz_plugin::TargetTabWidget::imageCallback
void imageCallback(const sensor_msgs::ImageConstPtr &msg)
Definition: handeye_target_widget.cpp:409
moveit_rviz_plugin::TargetTabWidget::cameraInfoChanged
void cameraInfoChanged(sensor_msgs::CameraInfo msg)
moveit_rviz_plugin::TargetTabWidget::createTargetImageBtnClicked
void createTargetImageBtnClicked(bool clicked)
Definition: handeye_target_widget.cpp:513
value
float value
moveit_handeye_calibration::HandEyeTargetBase::Parameter
ros::NodeHandle::subscribe
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
pluginlib::ClassLoader
moveit_rviz_plugin::RosTopicComboBox::image_topics_
QSet< QString > image_topics_
Definition: handeye_target_widget.h:106
image_transport::Publisher::publish
void publish(const sensor_msgs::Image &message) const
moveit_rviz_plugin::TargetTabWidget::targetTypeComboboxChanged
void targetTypeComboboxChanged(const QString &text)
Definition: handeye_target_widget.cpp:501
text
text
moveit_rviz_plugin::TargetTabWidget::optical_frame_
std::string optical_frame_
Definition: handeye_target_widget.h:189
moveit_rviz_plugin
rviz::Display::setStatusStd
void setStatusStd(StatusProperty::Level level, const std::string &name, const std::string &text)
moveit_rviz_plugin::TargetTabWidget::target_
pluginlib::UniquePtr< moveit_handeye_calibration::HandEyeTargetBase > target_
Definition: handeye_target_widget.h:198
moveit_rviz_plugin::TargetTabWidget::calibration_display_
HandEyeCalibrationDisplay * calibration_display_
Definition: handeye_target_widget.h:161
moveit_rviz_plugin::TargetTabWidget::camera_info_
sensor_msgs::CameraInfoConstPtr camera_info_
Definition: handeye_target_widget.h:191
sensor_msgs::image_encodings::MONO8
const std::string MONO8
cv_bridge::CvImage
moveit_rviz_plugin::RosTopicComboBox::hasTopic
bool hasTopic(const QString &topic_name)
Definition: handeye_target_widget.cpp:80
index
unsigned int index
param
T param(const std::string &param_name, const T &default_val)
moveit_rviz_plugin::TargetTabWidget::cameraInfoCallback
void cameraInfoCallback(const sensor_msgs::CameraInfoConstPtr &msg)
Definition: handeye_target_widget.cpp:489
moveit_rviz_plugin::TargetTabWidget::loadWidget
void loadWidget(const rviz::Config &config)
Definition: handeye_target_widget.cpp:195
moveit_rviz_plugin::TargetTabWidget::imageTopicComboboxChanged
void imageTopicComboboxChanged(const QString &topic)
Definition: handeye_target_widget.cpp:565
moveit_rviz_plugin::RosTopicComboBox::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition: handeye_target_widget.cpp:113
ros::master::TopicInfo
config
config
moveit_rviz_plugin::TargetTabWidget::target_display_label_
QLabel * target_display_label_
Definition: handeye_target_widget.h:179
rviz::Config
moveit_rviz_plugin::TargetTabWidget::target_plugins_loader_
std::unique_ptr< pluginlib::ClassLoader< moveit_handeye_calibration::HandEyeTargetBase > > target_plugins_loader_
Definition: handeye_target_widget.h:197
image_transport::Subscriber::shutdown
void shutdown()


moveit_calibration_gui
Author(s): Yu Yan
autogenerated on Fri Oct 18 2024 02:14:15