12 const std::string GraspDescriptor::TypeNames[] = {
13 "physical_success",
"physical_failure",
"physical_unstable",
14 "virtual_success",
"virtual_failure",
"pe_error",
"kinematic_error",
17 double ColorDescriptor::distanceTo(
const Descriptor &d)
const
20 const ColorDescriptor* cd =
dynamic_cast<const ColorDescriptor*
>(&d);
23 HSVConeColor c1(getColor());
24 HSVConeColor c2(cd->getColor());
25 return c1.distanceTo(c2);
27 const ColorPairDescriptor* cpd =
dynamic_cast<const ColorPairDescriptor*
>(&d);
30 HSVConeColor c1(getColor());
31 HSVConeColor c2(cpd->getLeftColor());
32 HSVConeColor c3(cpd->getRightColor());
33 return std::min(c1.distanceTo(c2),
41 double ColorPairDescriptor::distanceTo(
const Descriptor &d)
const
44 const ColorDescriptor* cd =
dynamic_cast<const ColorDescriptor*
>(&d);
47 HSVConeColor c1(getLeftColor());
48 HSVConeColor c2(getRightColor());
49 HSVConeColor c3(cd->getColor());
50 return std::min(c1.distanceTo(c3),
60 #if BOOST_VERSION < 104100
63 BOOST_CLASS_EXPORT_GUID(
nuklei::ColorDescriptor, "mdfh_Descriptor_Color")
64 BOOST_CLASS_EXPORT_GUID(
nuklei::GraspDescriptor, "mdfh_Descriptor_Grasp")
65 BOOST_CLASS_EXPORT_GUID(
nuklei::TwoFingerDescriptor, "mdfh_Descriptor_TwoFinger")
66 BOOST_CLASS_EXPORT_GUID(
nuklei::PlaneDescriptor, "mdfh_Descriptor_Plane")
67 BOOST_CLASS_EXPORT_GUID(
nuklei::RGBColor, "mdfh_Color_RGB")
68 BOOST_CLASS_EXPORT_GUID(
nuklei::HSVColor, "mdfh_Color_HSV")
69 BOOST_CLASS_EXPORT_GUID(
nuklei::HSVConeColor, "mdfh_Color_HSVCone")
82 #endif // BOOST_VERSION