PosePredictionVisualizerRVIZ.cpp
Go to the documentation of this file.
1 
17 //Header include
19 
20 //Ilcas Include
22 
23 namespace VIZ {
24 
26  asr_msgs::AsrAttributedPointCloud attributedPointCloud,
27  std::string markerNameSpace)
28 {
29  ROS_DEBUG("Publish Debug Marker");
30  std::string referenceNameSpace = markerNameSpace + "_reference";
31  std::string arrowNamespace = markerNameSpace + "_arrows";
32  std::string pointCloudNamespace = markerNameSpace + "_point_cloud";
33 
34  ColorRGBA referenceColor = VizHelperRVIZ::createColorRGBA(0.0, 0.0, 1.0, 1.0);
35  ColorRGBA pointColor = VizHelperRVIZ::createColorRGBA(0.0, 1.0, 0.0, 1.0);
36  unsigned int id = 0;
37 
38  Marker referenceMarker = VizHelperRVIZ::createSphereMarker(referencePosePtr->point,
39  baseFrame, referenceNameSpace, id, referenceRadius,
40  referenceColor, arrowLifeTime);
41  id++;
42  addMarker(referenceMarker);
43 
44  std::map< std::string, ColorRGBA> objectColors;
45  for (asr_msgs::AsrAttributedPoint attributedPoint: attributedPointCloud.elements)
46  {
47  std::string object_type = attributedPoint.type;
48  ColorRGBA arrowColor;
49  if (objectColors.find(object_type) != objectColors.end())
50  arrowColor = objectColors[object_type];
51  else
52  {
53  arrowColor = VizHelperRVIZ::hsvToRGBA(colorStepSize * objectColors.size(), 1.0, 1.0);
54  objectColors[object_type] = arrowColor;
55  }
56 
57  ISM::PointPtr ismPointPtr(new ISM::Point(attributedPoint.pose.position.x,
58  attributedPoint.pose.position.y,
59  attributedPoint.pose.position.z));
60  Marker arrowMarker = VizHelperRVIZ::createArrowMarkerToPoint(referencePosePtr->point,ismPointPtr,
61  baseFrame, arrowNamespace, id++, arrowScaleX,
62  arrowScaleY, arrowScaleZ, arrowColor,
64  Marker pointCloudMarker = VizHelperRVIZ::createSphereMarker(ismPointPtr, baseFrame,
65  pointCloudNamespace, id++ , pointRadius,
66  pointColor, pointLifeTime);
67  addMarker(arrowMarker);
68  addMarker(pointCloudMarker);
69  }
70 }
71 }
static ColorRGBA hsvToRGBA(double hue, double saturation, double value)
visualization_msgs::Marker Marker
static Marker createSphereMarker(ISM::PointPtr point, std::string baseFrame, std::string markerNamespace, int id, float radius, ColorRGBA color, double markerLifetime)
static ColorRGBA createColorRGBA(float red, float green, float blue, float alpha)
std_msgs::ColorRGBA ColorRGBA
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)
void addPosePredictionVisualization(ISM::PosePtr referencePosePtr, asr_msgs::AsrAttributedPointCloud attributedPointCloud, std::string markerNameSpace)
#define ROS_DEBUG(...)


asr_ism_visualizations
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Meißner Pascal, Reckling Reno, Stöckle Patrick, Trautmann Jeremias
autogenerated on Fri Nov 8 2019 03:28:47