22 #include <ISM/utility/GeometryHelper.hpp> 25 #include <Eigen/StdVector> 33 std::string name_space_prefix)
44 std::string name_space_prefix)
49 if (result->referencePose ==
nullptr)
54 std::string markerNamespace = name_space_prefix +
prefix +
"ism_" + result->patternName;
57 auto refPose = result->referencePose;
63 this->
baseFrame, markerNamespace +
"_ref",
66 retMarkers.markers.push_back(refMarker);
74 markerNamespace +
"_point_of_ascension_arrow",
id++, 0.024, 0.04,
76 retMarkers.markers.push_back(ascArrowMarker);
82 for (ISM::ObjectPtr& obj : result->recognizedSet->objects)
86 this->
baseFrame, markerNamespace +
"_to_ref_arrow",
88 retMarkers.markers.push_back(arrowToRefMarker);
92 for (ISM::RecognitionResultPtr& subPattern : result->subPatterns)
95 for (
auto tempMarker : subMarkers.markers)
97 retMarkers.markers.push_back(tempMarker);
105 Eigen::Quaternion<double> rotation = ISM::GeometryHelper::quatToEigenQuat(pose->quat);
106 rotation.normalize();
107 Eigen::Vector3d translation(0.0, (-depth * 0.10), 0.0);
108 Eigen::Vector3d offset = rotation._transformVector(translation);
109 return ISM::PointPtr(
new ISM::Point(pose->point->eigen.x() + offset[0],
110 pose->point->eigen.y() + offset[1],
111 pose->point->eigen.z() + offset[2]));
void publishCollectedMarkers()
static Marker createSphereMarker(ISM::PointPtr point, std::string baseFrame, std::string markerNamespace, int id, float radius, ColorRGBA color, double markerLifetime)
ISM::PointPtr getAdjustedPosition(ISM::PosePtr pose, int depth)
static ColorRGBA createColorRGBA(float red, float green, float blue, float alpha)
visualization_msgs::MarkerArray getMarkersFromResult(const ISM::RecognitionResultPtr result, int depth, std::string name_space_prefix="")
std_msgs::ColorRGBA ColorRGBA
void addVisualization(const ISM::RecognitionResultPtr recognition_result, std::string name_space_prefix="")
visualization_msgs::MarkerArray MarkerArray
void clearAllMarkerOfTopic()
static Marker createArrowMarkerToPoint(ISM::PointPtr fromPoint, ISM::PointPtr to, std::string baseFrame, std::string markerNamespace, int id, float xScale, float yScale, float zScale, ColorRGBA color, double markerLifetime)
void addMarker(visualization_msgs::Marker marker)
~OLD_ResultVisualizerRVIZ()
static ColorRGBA confidenceToColor(double confidence)