7 #include <visualization_msgs/MarkerArray.h> 9 #include <boost/filesystem.hpp> 34 const static Eigen::Affine3d
ZERO_POSE = Eigen::Affine3d::Identity();
46 std::string marker_topic,
47 robot_model::RobotModelConstPtr robot_model)
63 visual_path_array.clear();
78 Eigen::Vector3d avr_vec = Eigen::Vector3d(0,0,0);
79 int m = path_array[i].feasible_orients.size();
80 for(
int j=0; j < m; j++)
86 avr_vec = avr_vec + e;
91 avr_vec = avr_vec / avr_vec.norm() * 0.001 * 15;
92 avr_vec = avr_vec + v_unit_path.
start_pt;
96 visual_path_array.push_back(v_unit_path);
103 visual_path_array.clear();
112 v_unit_path.
layer_id = path_array[i].layer_id;
113 v_unit_path.
diameter = path_array[i].element_diameter;
115 visual_path_array.push_back(v_unit_path);
158 assert(
as_pnp_.sequenced_elements.size() > 0);
162 for(std::size_t i = 0; i <
as_pnp_.sequenced_elements.size(); i++)
164 const auto& current_as =
as_pnp_.sequenced_elements[i];
166 assert(boost::filesystem::exists(current_as.file_path + current_as.pick_element_geometry_file_name));
167 assert(boost::filesystem::exists(current_as.file_path + current_as.place_element_geometry_file_name));
171 FILE_URL_PREFIX + current_as.file_path + current_as.pick_element_geometry_file_name,
177 FILE_URL_PREFIX + current_as.file_path + current_as.place_element_geometry_file_name,
193 for(std::size_t j = 0; j < i; j++)
216 assert(
as_pnp_.sequenced_elements.size() > 0 && i <
as_pnp_.sequenced_elements.size() && i >= 0);
218 const auto& current_as =
as_pnp_.sequenced_elements[i];
220 assert(boost::filesystem::exists(current_as.file_path + current_as.pick_element_geometry_file_name));
221 assert(boost::filesystem::exists(current_as.file_path + current_as.place_element_geometry_file_name));
225 FILE_URL_PREFIX + current_as.file_path + current_as.pick_element_geometry_file_name,
231 FILE_URL_PREFIX + current_as.file_path + current_as.place_element_geometry_file_name,
239 for(std::size_t j = 0; j < i; j++)
241 const auto& as =
as_pnp_.sequenced_elements[j];
244 assert(boost::filesystem::exists(as.file_path + as.place_element_geometry_file_name));
246 if (std::find(current_as.place_contact_ngh_ids.begin(),current_as.place_contact_ngh_ids.end(),j)
247 != current_as.place_contact_ngh_ids.end())
264 for(std::size_t j = i+1; j <
as_pnp_.sequenced_elements.size(); j++)
266 const auto& as =
as_pnp_.sequenced_elements[j];
269 assert(boost::filesystem::exists(as.file_path + as.pick_element_geometry_file_name));
271 if (std::find(current_as.pick_contact_ngh_ids.begin(),current_as.pick_contact_ngh_ids.end(),j)
272 != current_as.pick_contact_ngh_ids.end())
312 "orientation_cylinder");
330 "orientation_cylinder");
337 assert(0 <= index && index <
as_pnp_.sequenced_elements.size());
338 assert(0 <= grasp_id && grasp_id <
as_pnp_.sequenced_elements[index].grasps.size());
340 const auto& g =
as_pnp_.sequenced_elements[index].grasps[grasp_id];
353 const robot_model::JointModelGroup
376 const robot_model::JointModelGroup
406 std::vector<std::string> empty_v;
413 const std::vector<std::string>& pick_contact_surf_names,
414 const std::vector<std::string>& place_contact_surf_names)
416 for(
const std::string& pick_surf :
as_pnp_.pick_support_surface_file_names)
418 assert(boost::filesystem::exists(
as_pnp_.file_path + pick_surf));
423 if (std::find(pick_contact_surf_names.begin(),pick_contact_surf_names.end(),pick_surf)
424 != pick_contact_surf_names.end())
440 for(
const std::string& place_surf :
as_pnp_.place_support_surface_file_names)
442 assert(boost::filesystem::exists(
as_pnp_.file_path + place_surf));
446 if (std::find(place_contact_surf_names.begin(),place_contact_surf_names.end(), place_surf)
447 != place_contact_surf_names.end())
void vectorMsgToEigen(const geometry_msgs::Vector3 &m, Eigen::Vector3d &e)
void pointMsgToEigen(const geometry_msgs::Point &m, Eigen::Vector3d &e)