4 #include <boost/tuple/tuple.hpp> 6 #include <choreo_msgs/TaskSequenceProcessing.h> 11 choreo_msgs::TaskSequenceProcessingResponse& res)
17 case choreo_msgs::TaskSequenceProcessing::Request::SPATIAL_EXTRUSION:
19 ROS_WARN_STREAM(
"[ts processor] using spatial extrusion parsing mode now.");
22 ts_processor.
setParams(req.model_params, req.task_sequence_params, req.world_frame);
26 ROS_ERROR(
"[Task Seq Process] Could not process input task sequence!");
27 res.succeeded =
false;
31 std::vector<choreo_task_sequence_processing_utils::UnitProcess> process_array =
34 std::vector<moveit_msgs::CollisionObject> env_objs =
37 for(
auto& unit_process : process_array)
39 res.process.push_back(unit_process.asElementCandidatePoses());
42 for(
auto& env_obj : env_objs)
44 res.env_collision_objs.push_back(env_obj);
49 case choreo_msgs::TaskSequenceProcessing::Request::PICKNPLACE:
52 req.model_params, req.task_sequence_params, req.world_frame, res.assembly_sequence_pnp))
54 ROS_ERROR(
"[Task Seq Process] Could not process input task sequence!");
55 res.succeeded =
false;
65 ROS_ERROR(
"[Task Seq Process] Unrecognized task sequence processing request");
66 res.succeeded =
false;
75 int main(
int argc,
char** argv)
78 ros::init(argc, argv,
"task_sequence_processor");
82 nh.
advertiseService<choreo_msgs::TaskSequenceProcessingRequest, choreo_msgs::TaskSequenceProcessingResponse>(
85 ROS_INFO(
"[task seq processor] %s server ready to service requests.", task_sequence_processing_server.
getService().c_str());
void setParams(choreo_msgs::ModelInputParameters model_params, choreo_msgs::TaskSequenceInputParameters task_sequence_params, std::string world_frame)
const std::vector< choreo_task_sequence_processing_utils::UnitProcess > & getCandidatePoses() const
const std::vector< moveit_msgs::CollisionObject > & getEnvCollisionObjs() const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool createCandidatePoses()
ROSCPP_DECL void spin(Spinner &spinner)
std::string getService() const
bool parseAssemblySequencePickNPlace(const choreo_msgs::ModelInputParameters &model_params, const choreo_msgs::TaskSequenceInputParameters &task_sequence_params, const std::string &world_frame_, choreo_msgs::AssemblySequencePickNPlace &as_pnp)
#define ROS_WARN_STREAM(args)
bool processTaskSequenceCallback(choreo_msgs::TaskSequenceProcessingRequest &req, choreo_msgs::TaskSequenceProcessingResponse &res)
bool createEnvCollisionObjs()