本文整理汇总了C++中Capability::isDirectionPossible方法的典型用法代码示例。如果您正苦于以下问题:C++ Capability::isDirectionPossible方法的具体用法?C++ Capability::isDirectionPossible怎么用?C++ Capability::isDirectionPossible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Capability
的用法示例。
在下文中一共展示了Capability::isDirectionPossible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createReachabilitySphereFromCapability
ReachabilitySphere createReachabilitySphereFromCapability(Capability cap, unsigned int numPoints)
{
// spread points over a sphere
std::vector<Vector> points = distributePointsOnSphere(numPoints);
ReachabilitySphere sphere;
for (size_t i = 0; i < points.size(); ++i)
{
double phi = atan2(points[i].y, points[i].x) * 180.0 / M_PI;
double theta = acos(points[i].z) * 180.0 / M_PI;
if (cap.isDirectionPossible(phi, theta))
{
sphere.appendDirection(points[i].x, points[i].y, points[i].z, true);
}
else
{
sphere.appendDirection(points[i].x, points[i].y, points[i].z, false);
}
}
return sphere;
}
示例2: isReachable
bool ReachabilityDummyInterface::isReachable(const octomath::Pose6D &pose) const
{
Capability cap;
if (pose.y() > 0.04 && pose.y() < 0.06 && pose.z() > 0.44 && pose.z() < 0.46)
{
if (pose.x() > 0.14 && pose.x() < 0.16)
{
cap = Capability(SPHERE, 0.0, 0.0, 0.0);
}
else if (pose.x() > 0.34 && pose.x() < 0.36)
{
cap = Capability(CONE, 0.0, 90.0, 15.0);
}
else if (pose.x() > 0.54 && pose.x() < 0.56)
{
cap = Capability(CONE, 90.0, 0.0, 45.0);
}
else if (pose.x() > 0.74 && pose.x() < 0.76)
{
cap = Capability(CONE, 90.0, 0.0, 125.0);
}
else if (pose.x() > 0.94 && pose.x() < 0.96)
{
cap = Capability(CONE, 180.0, 120.0, 70.0);
}
else if (pose.x() > 1.14 && pose.x() < 1.16)
{
cap = Capability(CYLINDER_1, 0.0, 0.0, 10.0);
}
else if (pose.x() > 1.34 && pose.x() < 1.36)
{
cap = Capability(CYLINDER_1, 0.0, 0.0, 90.0);
}
else if (pose.x() > 1.54 && pose.x() < 1.56)
{
cap = Capability(CYLINDER_1, 40.0, 50.0, 45.0);
}
else if (pose.x() > 1.74 && pose.x() < 1.76)
{
cap = Capability(CYLINDER_2, 0.0, 0.0, 10.0);
}
else if (pose.x() > 1.94 && pose.x() < 1.96)
{
cap = Capability(CYLINDER_2, 0.0, 0.0, 45.0);
}
else if (pose.x() > 2.14 && pose.x() < 2.16)
{
cap = Capability(CYLINDER_2, 90.0, 90.0, 89.0);
}
else
{
return false;
}
}
else
{
return false;
}
octomath::Vector3 unitVector(1.0, 0.0, 0.0);
octomath::Vector3 rotatedVector = pose.rot().rotate(unitVector);
double phi = atan2(rotatedVector.y(), rotatedVector.x()) * 180.0 / M_PI;
double theta = acos(rotatedVector.z()) * 180.0 / M_PI;
return cap.isDirectionPossible(phi, theta);
}