8 #include <QtConcurrent/QtConcurrentRun> 11 #include <choreo_msgs/ModelInputParameters.h> 12 #include <choreo_msgs/TaskSequenceInputParameters.h> 29 gui.
setText(
"Task Sequence Processing State (recompute assembly sequence or read a saved one).\n" 30 "Click 'Next' to continue.\n");
70 std::string assembly_type;
80 const choreo_msgs::ModelInputParameters& model_params,
81 const choreo_msgs::TaskSequenceInputParameters& task_sequence_params,
82 std::string& assembly_type)
84 choreo_msgs::TaskSequenceProcessingGoal goal;
85 goal.action = choreo_msgs::TaskSequenceProcessingGoal::FIND_AND_PROCESS;
86 goal.use_default_parameters =
false;
87 goal.model_params = model_params;
88 goal.task_sequence_params = task_sequence_params;
97 ROS_ERROR_STREAM(
"[UI] action task sequence processing server not connected");
115 assembly_type.clear();
128 const choreo_msgs::TaskSequenceProcessingResultConstPtr& result)
137 const choreo_msgs::TaskSequenceProcessingFeedbackConstPtr& feedback)
139 Q_EMIT
feedbackReceived(QString::fromStdString((feedback->last_completed).c_str()));
151 const choreo_msgs::ModelInputParameters& model_params,
152 const choreo_msgs::TaskSequenceInputParameters& task_sequence_params)
154 choreo_msgs::TaskSequencePlanningGoal goal;
155 goal.model_params = model_params;
156 goal.task_sequence_params = task_sequence_params;
158 ROS_INFO(
"[UI] Waiting for task sequence planning action server to start.");
180 const choreo_msgs::TaskSequencePlanningResultConstPtr& result)
182 std::string assembly_type;
197 const choreo_msgs::TaskSequencePlanningFeedbackConstPtr& feedback)
199 Q_EMIT
feedbackReceived(QString::fromStdString((feedback->last_completed).c_str()));
virtual void onBack(ChoreoWidget &gui)
TaskSequenceProcessingState()
void taskSequencePlanningDoneCallback(const actionlib::SimpleClientGoalState &state, const choreo_msgs::TaskSequencePlanningResultConstPtr &result)
void taskSequenceProcessingDoneCallback(const actionlib::SimpleClientGoalState &state, const choreo_msgs::TaskSequenceProcessingResultConstPtr &result)
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
bool makeTaskSequenceProcessingRequest(const choreo_msgs::ModelInputParameters &model_params, const choreo_msgs::TaskSequenceInputParameters &task_sequence_params, std::string &assembly_type)
bool waitForResult(const ros::Duration &timeout=ros::Duration(0, 0))
static const std::string TASK_SEQUENCE_PROCESSING_ACTION_CLIENT_NAME
void taskSequenceProcessingActiveCallback()
~TaskSequenceProcessingState()
virtual void onExit(ChoreoWidget &gui)
void taskSequenceProcessingFeedbackCallback(const choreo_msgs::TaskSequenceProcessingFeedbackConstPtr &feedback)
bool isServerConnected() const
actionlib::SimpleActionClient< choreo_msgs::TaskSequencePlanningAction > task_sequence_planning_action_client_
void feedbackReceived(QString feedback)
void taskSequenceProcessOrPlan()
void taskSequencePlanningOn()
#define ROS_WARN_STREAM(args)
actionlib::SimpleActionClient< choreo_msgs::TaskSequenceProcessingAction > task_sequence_processing_action_client_
virtual void onReset(ChoreoWidget &gui)
virtual void onStart(ChoreoWidget &gui)
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
void taskSequencePlanningFeedbackCallback(const choreo_msgs::TaskSequencePlanningFeedbackConstPtr &feedback)
#define ROS_INFO_STREAM(args)
bool makeTaskSequencePlanningRequest(const choreo_msgs::ModelInputParameters &model_params, const choreo_msgs::TaskSequenceInputParameters &task_sequence_params)
static const std::string TASK_SEQUENCE_PLANNING_ACTION_CLIENT_NAME
void taskSequencePlanningActiveCallback()
#define ROS_ERROR_STREAM(args)
ResultConstPtr getResult() const
virtual void onNext(ChoreoWidget &gui)
void newStateAvailable(GuiState *)
void setFeedbackText(QString feedback)