36 #define BOOST_PARAMETER_MAX_ARITY 7
50 const std::vector<float>& coefficients):
57 const Eigen::Vector3f&
p, Eigen::Vector3f& output)
63 const Eigen::Affine3f& pose, Eigen::Affine3f& output)
65 Eigen::Vector3f
p(pose.translation());
66 Eigen::Vector3f output_p;
72 Eigen::Quaternionf rot;
73 rot.setFromTwoVectors(pose.rotation() * Eigen::Vector3f::UnitZ(),
74 coordinates().rotation() * Eigen::Vector3f::UnitZ());
75 Eigen::Quaternionf coords_rot(
coordinates().rotation());
76 Eigen::Quaternionf pose_rot(pose.rotation());
88 output = Eigen::Affine3f(rot * pose.rotation());
89 output.pretranslate(output_p);
99 std::back_inserter(new_vertices));
100 std::vector<float> reversed_coefficients(4);
101 reversed_coefficients[0] = -
normal_[0];
102 reversed_coefficients[1] = -
normal_[1];
103 reversed_coefficients[2] = -
normal_[2];
104 reversed_coefficients[3] = -
d_;
111 Eigen::Vector3f point_on_plane;
115 output = point_on_plane;
119 double min_distance = DBL_MAX;
120 Eigen::Vector3f min_point;
123 Eigen::Vector3f foot;
136 Eigen::Vector3f output_f;
137 Eigen::Vector3f p_f(
p[0],
p[1],
p[2]);
139 pointFromVectorToVector<Eigen::Vector3f, Eigen::Vector3d>(output_f, output);
144 Eigen::Vector3f p_f(
p[0],
p[1],
p[2]);
150 Eigen::Vector3f output_f;
152 pointFromVectorToVector<Eigen::Vector3f, Eigen::Vector3d>(output_f, output);
158 Eigen::Vector3f ret(0, 0, 0);
168 for (
size_t i = 0;
i < polygon.points.size();
i++) {
170 pointFromXYZToVector<geometry_msgs::Point32, Eigen::Vector3f>(
171 polygon.points[
i],
p);
172 vertices.push_back(
p);
180 for (
size_t i = 0;
i < polygon.points.size();
i++) {
182 pointFromXYZToVector<geometry_msgs::Point32, Eigen::Vector3f>(
183 polygon.points[
i],
p);
184 vertices.push_back(
p);
190 double distance_threshold)
192 double dummy_distance;
197 double distance_threshold,
198 double& output_distance)
202 if (plane_distance > distance_threshold) {
203 output_distance = plane_distance;
207 Eigen::Vector3f foot_point;
209 double convex_distance = (
p - foot_point).norm();
210 output_distance = convex_distance;
211 return convex_distance < distance_threshold;
218 Eigen::Vector3f p_k_1;
225 if ((p_k - p_k_1).norm() < thr) {
234 double min_distance = DBL_MAX;
237 double d = (
p - v).norm();
238 if (
d < min_distance) {
267 new_vertices.push_back((
vertices_[
i] - c) * scale_factor + c);
275 geometry_msgs::Polygon polygon;
277 geometry_msgs::Point32 ros_point;
281 polygon.points.push_back(ros_point);
289 Eigen::Vector3f foot_point;