8 setObjectName(
"Trajectory utilities");
11 QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
18 QHBoxLayout* back_forward_layout =
new QHBoxLayout;
23 QHBoxLayout *import_export_file_layout =
new QHBoxLayout;
24 QPushButton *import_file_explorer =
new QPushButton;
25 import_file_explorer->setText(
"Import");
26 QPushButton *export_file_explorer =
new QPushButton;
27 export_file_explorer->setText(
"Export");
28 import_export_file_layout->addWidget(import_file_explorer);
29 import_export_file_layout->addWidget(export_file_explorer);
32 QVBoxLayout* main_layout =
new QVBoxLayout(
this);
33 main_layout->addLayout(back_forward_layout);
34 main_layout->addStretch(1);
35 main_layout->addLayout(import_export_file_layout);
51 "ram/buffer/export_trajectory");
53 "ram/buffer/import_trajectory");
70 "RViz panel " <<
getName().toStdString() <<
" connected to the service " << client.
getService());
76 "RViz panel " <<
getName().toStdString() <<
" could not connect to ROS service: " << client.
getService());
84 Q_EMIT setEnabled(
false);
91 Q_EMIT setEnabled(
true);
97 Q_EMIT setEnabled(
false);
106 Q_EMIT setEnabled(
false);
122 else if (!
params_.response.error.empty())
125 QString::fromStdString(
params_.response.error),
129 Q_EMIT setEnabled(
true);
134 QString file_dir(
"");
138 file_dir = file.dir().path();
142 file_dir = QString::fromStdString(path);
147 QString file_path = browser.getSaveFileName(
this,
"Save trajectory", file_dir,
"Bag files (*.bag)");
151 if (!file_path.endsWith(
".bag"))
155 Q_EMIT setEnabled(
false);
164 QString file_dir(
"");
168 file_dir = file.dir().path();
172 file_dir = QString::fromStdString(path);
177 QString file_path = browser.getOpenFileName(
this,
"Choose Bag file", file_dir,
"Bag files (*.bag)");
182 Q_EMIT setEnabled(
false);
214 Q_EMIT setEnabled(
true);
242 Q_EMIT setEnabled(
true);
263 const QString message,
264 const QString info_msg)
266 bool old_state(isEnabled());
267 Q_EMIT setEnabled(
false);
269 msg_box.setWindowTitle(title);
270 msg_box.setText(message);
271 msg_box.setInformativeText(info_msg);
272 msg_box.setIcon(QMessageBox::Critical);
273 msg_box.setStandardButtons(QMessageBox::Ok);
275 Q_EMIT setEnabled(old_state);
279 const QString info_msg)
281 bool old_state(isEnabled());
282 Q_EMIT setEnabled(
false);
284 msg_box.setText(message);
285 msg_box.setInformativeText(info_msg);
286 msg_box.setIcon(QMessageBox::Information);
287 msg_box.setStandardButtons(QMessageBox::Ok);
289 Q_EMIT setEnabled(old_state);
ros::ServiceClient export_trajectory_client_
void displaySuccessBoxHandler(const QString message, const QString info_msg)
void connectToService(ros::ServiceClient &client)
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
QPushButton * back_button_
bool call(MReq &req, MRes &res)
ram_utils::ExportTrajectory export_filename_
void browseFilesToImportTrajectory()
bool mapGetString(const QString &key, QString *value_out) const
void mapSetValue(const QString &key, QVariant value)
virtual void setName(const QString &name)
void load(const rviz::Config &config)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
void forwardButtonHandler()
virtual QString getName() const
ROSLIB_DECL std::string getPath(const std::string &package_name)
TrajectoryUtils(QWidget *parent=NULL)
virtual ~TrajectoryUtils()
ros::ServiceClient import_trajectory_client_
#define ROS_INFO_STREAM(args)
ram_utils::BufferParams params_
ros::ServiceClient trajectory_buffer_client_
virtual void save(Config config) const
#define ROS_ERROR_STREAM(args)
virtual void load(const Config &config)
void browseFilesToExportTrajectory()
void displayErrorMessageBox(const QString, const QString, const QString)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
ram_utils::ExportTrajectory import_filename_
QPushButton * forward_button_
void displayErrorBoxHandler(const QString title, const QString message, const QString info_msg)
void displaySuccessMessageBox(const QString, const QString)
void save(rviz::Config config) const