2 #include "choreo_msgs/ChoreoParameters.h" 7 #include <ui_choreo_widget.h> 8 #include <QtConcurrent/QtConcurrentRun> 12 #include <choreo_msgs/ProcessPlanningAction.h> 24 ui_ =
new Ui::ChoreoWidget;
30 params_->setWindowFlags(Qt::WindowStaysOnTopHint);
38 connect(
ui_->pushbutton_next, SIGNAL(clicked()),
this, SLOT(
onNextButton()));
39 connect(
ui_->pushbutton_back, SIGNAL(clicked()),
this, SLOT(
onBackButton()));
40 connect(
ui_->pushbutton_reset, SIGNAL(clicked()),
this, SLOT(
onResetButton()));
42 connect(
ui_->pushbutton_picknplace, SIGNAL(clicked()),
this, SLOT(
onPicknPlace()));
73 ui_->textedit_status->setPlainText(QString::fromStdString(txt));
78 ui_->textedit_status->moveCursor(QTextCursor::End);
79 ui_->textedit_status->insertPlainText(QString::fromStdString(txt));
80 ui_->textedit_status->moveCursor(QTextCursor::End);
97 choreo_msgs::SimulateMotionPlanGoal goal;
98 goal.action = choreo_msgs::SimulateMotionPlanGoal::RESET_TO_DEFAULT_POSE;
100 goal.wait_for_execution =
true;
113 choreo_msgs::ChoreoParameters msg;
114 msg.request.action = choreo_msgs::ChoreoParameters::Request::SAVE_PARAMETERS;
121 ROS_WARN_STREAM(
"Could not complete service call to save parameters!");
126 choreo_msgs::ChoreoParameters msg;
127 msg.request.action = choreo_msgs::ChoreoParameters::Request::SET_PARAMETERS;
149 choreo_msgs::ProcessPlanningGoal goal;
150 goal.action = choreo_msgs::ProcessPlanningGoal::PICKNPLACE_TEST;
152 ROS_INFO(
"Waiting for pickn place process planning action server to start.");
166 process_planning_action_client.
sendGoal(goal);
195 ui_->pushbutton_next->setEnabled(enabled);
196 ui_->pushbutton_back->setEnabled(enabled);
197 ui_->pushbutton_reset->setEnabled(enabled);
202 ui_->pushbutton_params->setEnabled(enabled);
207 choreo_msgs::ChoreoParameters srv;
208 srv.request.action = srv.request.GET_CURRENT_PARAMETERS;
215 ROS_ERROR(
"[UI] Unable to connect to parameter server in core service!");
219 ROS_INFO_STREAM(
"[UI] Connected to parameter server in core service.");
222 if (param_client.
call(srv))
238 ui_->label_status->setText( QString::fromStdString(txt));
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
virtual void onNext(ChoreoWidget &gui)=0
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
bool call(MReq &req, MRes &res)
bool isServerConnected() const
virtual void onReset(ChoreoWidget &gui)=0
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
virtual void onBack(ChoreoWidget &gui)=0
SimpleClientGoalState sendGoalAndWait(const Goal &goal, const ros::Duration &execute_timeout=ros::Duration(0, 0), const ros::Duration &preempt_timeout=ros::Duration(0, 0))
#define ROS_WARN_STREAM(args)
virtual void onExit(ChoreoWidget &gui)=0
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
#define ROS_INFO_STREAM(args)
virtual void onStart(ChoreoWidget &gui)=0