32 unsigned int& pMarkerId,
34 double pQualityOfMatch)
38 throw std::invalid_argument(
"Empty ros::publisher cannot be used to publish marker messages.");
40 visualization_msgs::MarkerArray array;
46 pPublisher->publish(array);
50 unsigned int& pMarkerId,
55 throw std::invalid_argument(
"Empty ros::publisher cannot be used to publish marker messages.");
57 visualization_msgs::MarkerArray array;
63 pPublisher->publish(array);
67 unsigned int& pMarkerId,
69 std::vector<double> pScores,
70 double pQualityOfMatch)
74 throw std::invalid_argument(
"Empty ros::publisher cannot be used to publish marker messages.");
76 visualization_msgs::MarkerArray array;
78 double arrowLength = 0.2;
84 for(
unsigned int i = 0; i < pScores.size(); i++)
91 pPublisher->publish(array);
95 unsigned int& pMarkerId,
96 const Eigen::Vector3d pFrom,
97 const Eigen::Vector3d pTo,
98 double pQualityOfMatch)
102 throw std::invalid_argument(
"Empty ros::publisher cannot be used to publish marker messages.");
104 visualization_msgs::MarkerArray array;
107 array.markers.push_back(
generateArrowMessage(pMarkerId, pFrom, pTo, pQualityOfMatch, 0.04, 0.1, 0.10));
110 pPublisher->publish(array);
119 const Eigen::Vector3d pPosition)
121 visualization_msgs::Marker msg;
131 msg.id = pMarkerId++;
134 msg.type = visualization_msgs::Marker::SPHERE;
137 msg.action = visualization_msgs::Marker::ADD;
145 msg.pose.orientation.w = 1;
146 msg.pose.orientation.x = 0;
147 msg.pose.orientation.y = 0;
148 msg.pose.orientation.z = 0;
151 msg.scale.x = msg.scale.y = msg.scale.z = 0.05 *
getScaleFactor();
164 const Eigen::Vector3d pFrom,
165 const Eigen::Vector3d pTo,
166 double pQualityOfMatch,
171 visualization_msgs::Marker msg;
178 msg.scale.x = pScalePeak;
179 msg.scale.y = pScaleShaft;
180 msg.scale.z = pPeakLength;
183 msg.type = visualization_msgs::Marker::ARROW;
190 msg.id = pMarkerId++;
193 msg.action = visualization_msgs::Marker::ADD;
196 geometry_msgs::Point start;
200 msg.points.push_back(start);
203 geometry_msgs::Point stop;
207 msg.points.push_back(stop);
211 msg.color.r = 1.0 - pQualityOfMatch;
212 msg.color.g = pQualityOfMatch;
222 double pQualityOfMatch,
226 Eigen::Vector3d from = pPose->point->getEigen();
227 Eigen::Vector3d to = pPose->point->getEigen();
230 from[2] -= 0.1 + pLength;
234 visualization_msgs::Marker msg =
generateArrowMessage(pMarkerId, from, to, pQualityOfMatch, 0.055, 0.12, 0.05);
239 msg.color.r = msg.color.g = msg.color.b = 0.7;
250 visualization_msgs::Marker msg;
260 msg.id = pMarkerId++;
263 msg.type = visualization_msgs::Marker::SPHERE;
266 msg.action = visualization_msgs::Marker::ADD;
269 msg.pose.position.x = pPose->point->getEigen()[0] *
getScaleFactor();
270 msg.pose.position.y = pPose->point->getEigen()[1] *
getScaleFactor();
271 msg.pose.position.z = pPose->point->getEigen()[2] *
getScaleFactor() - (0.2 + pOffset);
274 msg.pose.orientation.w = 1;
275 msg.pose.orientation.x = 0;
276 msg.pose.orientation.y = 0;
277 msg.pose.orientation.z = 0;
286 msg.color.r = 1.0 - pScore;
287 msg.color.g = pScore;
291 msg.color.r = msg.color.g = msg.color.b = 0.7;
std::string getNamespace()
KinematicChainVisualizer()
void publishObjectPositionAsPoint(boost::shared_ptr< ros::Publisher > pPublisher, unsigned int &pMarkerId, const boost::shared_ptr< ISM::Pose > pPose)
visualization_msgs::Marker generateArrowMessage(unsigned int &pMarkerId, const Eigen::Vector3d pFrom, const Eigen::Vector3d pTo, double pQualityOfMatch, double pScalePeak, double pScaleShaft, double pPeakLength)
void publishLink(boost::shared_ptr< ros::Publisher > pPublisher, unsigned int &pMarkerId, const Eigen::Vector3d pFrom, const Eigen::Vector3d pTo, double pQualityOfMatch)
void setBestStatus(bool pStatus)
visualization_msgs::Marker generateTermIndicatorMessage(unsigned int &pMarkerId, const boost::shared_ptr< ISM::Pose > pPose, double pOffset, double pScore)
void publishObjectPositionAsPointWithScore(boost::shared_ptr< ros::Publisher > pPublisher, unsigned int &pMarkerId, const boost::shared_ptr< ISM::Pose > pPose, std::vector< double > pScores, double pQualityOfMatch)
~KinematicChainVisualizer()
visualization_msgs::Marker generatePointMessage(unsigned int &pMarkerId, const Eigen::Vector3d pPosition)
visualization_msgs::Marker generatePerpendicularArrowMessage(unsigned int &pMarkerId, const boost::shared_ptr< ISM::Pose > pPose, double pQualityOfMatch, double pLength)
void publishObjectPositionAsArrow(boost::shared_ptr< ros::Publisher > pPublisher, unsigned int &pMarkerId, const boost::shared_ptr< ISM::Pose > pPose, double pQualityOfMatch)