38 std::vector<SingleTaskPlanningResult> planning_result;
47 for (
int i = 0; i < planning_result.size(); i++)
50 WF_edge* e = planning_result[i].e_;
58 for(
const auto&
v : planning_result[i].eef_directions_)
67 for (
int i = 0; i < planning_result.size(); i++)
70 WF_edge* e = planning_result[i].e_;
75 int uj = ptr_frame->
GetEndu(orig_j);
79 int vj = ptr_frame->
GetEndv(orig_j);
94 assert(start_node_exist || end_node_exist);
105 if (start_node_exist != end_node_exist)
138 std::cout << path << std::endl;
141 rapidjson::Document document;
144 document.SetObject();
149 Value model_object_container(rapidjson::kArrayType);
150 document.AddMember(
"element_number",
process_list_.size(), allocator);
151 document.AddMember(
"support_number",
support_, allocator);
155 rapidjson::Value bc_pt(rapidjson::kArrayType);
159 document.AddMember(
"base_center_pt", bc_pt, allocator);
163 rapidjson::Value element_object_container(rapidjson::kObjectType);
166 element_object_container.AddMember(
"order_id", i, allocator);
167 element_object_container.AddMember(
"wireframe_id", temp.
wireframe_id_, allocator);
171 rapidjson::Value st_pt(rapidjson::kArrayType);
177 rapidjson::Value end_pt(rapidjson::kArrayType);
182 element_object_container.AddMember(
"start_pt", st_pt, allocator);
183 element_object_container.AddMember(
"end_pt", end_pt, allocator);
186 rapidjson::Value type_object(rapidjson::kObjectType);
189 element_object_container.AddMember(
"type",
"support", allocator);
195 element_object_container.AddMember(
"type",
"connect", allocator);
199 element_object_container.AddMember(
"type",
"create", allocator);
207 cout <<
"Error: normal vector empty" << endl;
210 rapidjson::Value feasible_orients(rapidjson::kArrayType);
211 feasible_orients.Clear();
215 rapidjson::Value feasible_orient(rapidjson::kArrayType);
216 feasible_orient.PushBack(
Value().SetDouble(0.0), allocator);
217 feasible_orient.PushBack(
Value().SetDouble(0.0), allocator);
218 feasible_orient.PushBack(
Value().SetDouble(1.0), allocator);
220 std::string vec_id =
"f_orient" + std::to_string(0);
221 Value vec_id_key(vec_id.c_str(), allocator);
223 feasible_orients.PushBack(feasible_orient, allocator);
227 for (
int j = 0; j < temp.
normal_.size(); j++)
229 if (temp.
normal_[j].getZ() < 0)
234 rapidjson::Value feasible_orient(rapidjson::kArrayType);
239 std::string vec_id =
"f_orient" + std::to_string(j);
240 Value vec_id_key(vec_id.c_str(), allocator);
242 feasible_orients.PushBack(feasible_orient, allocator);
246 element_object_container.AddMember(
247 "feasible_orientation", feasible_orients, allocator);
249 std::string
id =
"element" + std::to_string(i);
250 Value id_key(
id.c_str(), allocator);
252 model_object_container.PushBack(element_object_container, allocator);
256 document.AddMember(
"sequenced_elements", model_object_container, allocator);
259 std::string json_path = path;
260 FILE *js_file = fopen(json_path.c_str(),
"w+");
263 std::cout <<
"ERROR: invalid output file path!!!" << endl;
271 document.Accept(p_writer);
273 std::fclose(js_file);
274 std::cout <<
"path file saved successfully!" << std::endl;
GLsizei const GLchar *const * path
vector< point > exist_point_
Vec3f GetBaseCenterPos() const
vector< Process > process_list_
void OutputTaskSequencePlanningResult(std::vector< SingleTaskPlanningResult > &planning_result)
double truncDigits(double v, double scale)
static const double FF_TRUNC_SCALE
DualGraph * ptr_dualgraph_
bool IfPointInVector(point p)
SeqAnalyzer * ptr_seqanalyzer_
#define ROS_INFO_STREAM(args)
std::vector< GeoV3 > normal_