25 #include <boost/filesystem.hpp> 26 #include <boost/foreach.hpp> 27 #include <boost/range/algorithm_ext/iota.hpp> 28 #include <boost/lexical_cast.hpp> 29 #include <boost/shared_ptr.hpp> 30 #include <sensor_msgs/PointCloud2.h> 31 #include <pcl_conversions/pcl_conversions.h> 41 #include "asr_msgs/AsrAttributedPointCloud.h" 42 #include "asr_msgs/AsrAttributedPoint.h" 44 #include <visualization_msgs/Marker.h> 45 #include <visualization_msgs/MarkerArray.h> 46 #include <geometry_msgs/Point.h> 47 #include <geometry_msgs/Quaternion.h> 49 #include <std_msgs/ColorRGBA.h> 97 std::string iterationVisualization;
98 std::string frustumVisualization;
99 std::string objectsVisualization;
100 std::string objectNormalsVisualization;
101 std::string frustumObjectsVisualization;
102 std::string frustumObjectNormalsVisualization;
103 std::string cropBoxVisualization;
104 std::string samplingVisualization;
106 mNodeHandle.
getParam(
"/nbv/iterationVisualization", iterationVisualization);
107 mNodeHandle.
getParam(
"/nbv/frustumVisualization", frustumVisualization);
108 mNodeHandle.
getParam(
"/nbv/objectsVisualization", objectsVisualization);
109 mNodeHandle.
getParam(
"/nbv/objectNormalsVisualization", objectNormalsVisualization);
110 mNodeHandle.
getParam(
"/nbv/frustumObjectsVisualization", frustumObjectsVisualization);
111 mNodeHandle.
getParam(
"/nbv/frustumObjectNormalsVisualization", frustumObjectNormalsVisualization);
112 mNodeHandle.
getParam(
"/nbv/cropBoxVisualization", cropBoxVisualization);
113 mNodeHandle.
getParam(
"/nbv/samplingVisualization", samplingVisualization);
116 mIterationMarkerArrayPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(iterationVisualization, 1000);
117 mFrustumMarkerArrayPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(frustumVisualization, 1000);
118 mObjectMeshMarkerPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(objectsVisualization, 100,
false);
119 mFrustumObjectMeshMarkerPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(frustumObjectsVisualization, 100,
false);
120 mPointObjectNormalPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(objectNormalsVisualization, 100,
false);
121 mCropBoxMarkerPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(cropBoxVisualization, 100,
false);
122 mSamplingPublisher = mNodeHandle.
advertise<visualization_msgs::MarkerArray>(samplingVisualization, 10000,
false);
124 if (!mIterationMarkerArrayPublisher) {
125 ROS_ERROR(
"mIterationMarkerArrayPublisher is invalid.");
126 throw "Publisher invalid";
128 if (!mFrustumMarkerArrayPublisher) {
129 ROS_ERROR(
"mFrustumMarkerArrayPublisher is invalid.");
130 throw "Publisher invalid";
132 if (!mObjectMeshMarkerPublisher) {
133 ROS_ERROR(
"mObjectMeshMarkerPublisher is invalid.");
134 throw "Publisher invalid";
136 if (!mFrustumObjectMeshMarkerPublisher) {
137 ROS_ERROR(
"mFrustumObjectMeshMarkerPublisher is invalid.");
138 throw "Publisher invalid";
140 if (!mPointObjectNormalPublisher) {
141 ROS_ERROR(
"mPointObjectNormalPublisher is invalid.");
142 throw "Publisher invalid";
146 mNodeHandle.
getParam(
"/nbv/boolClearBetweenIterations", mBoolClearBetweenIterations);
149 mIterationMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
150 mNewFrustumMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
151 mOldFrustumMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
152 mObjectMeshMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
153 mObjectNormalsMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
154 mFrustumObjectMeshMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
155 mFrustumObjectNormalsMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
156 mCropBoxMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
157 mSamplingMarkerArrayPtr = boost::make_shared<visualization_msgs::MarkerArray>();
173 if(!sampledOrientationsPtr){
174 ROS_ERROR(
"triggerIterationVisualizations call with pointer sampledOrientationsPtr being null.");
179 ROS_ERROR(
"triggerIterationVisualizations call with pointer pointcloud being null.");
183 if(!spaceSamplerPtr){
184 ROS_ERROR(
"triggerIterationVisualizations call with pointer spaceSamplerPtr being null.");
188 if(!mIterationMarkerArrayPtr){
189 ROS_ERROR(
"triggerIterationVisualizations call with pointer mIterationMarkerArrayPtr being null.");
194 if (iterationStep == 0 && mBoolClearBetweenIterations ==
true) {
197 this->
deleteMarkerArray(mIterationMarkerArrayPtr, mIterationMarkerArrayPublisher);
201 std::string
s = boost::lexical_cast<std::string>(iterationStep);
202 this->mIterationStep=iterationStep;
203 m_j = iterationStep*0.25;
204 m_j = std::min(1.0
f, m_j);
211 mIterationMarkerArrayPublisher.
publish(mIterationMarkerArrayPtr);
222 ROS_ERROR(
"triggerSamplingVisualization call with pointer samples being null");
226 if (!mSamplingMarkerArrayPtr) {
227 ROS_ERROR(
"triggerSamplingVisualization call with pointer mSamplingMarkerArrayPtr being null");
236 SimpleVector3 viewportPointPosition = viewportPoint.getPosition();
237 viewportPointPosition[2] = 0.1;
238 bool isInFilteredPositions =
false;
241 isInFilteredPositions =
true;
245 if (!isInFilteredPositions) {
246 filteredPositions.push_back(viewportPointPosition);
252 double SpaceSamplingMarkerScale;
253 mNodeHandle.
getParam(
"/nbv/SpaceSamplingMarker_Scale", SpaceSamplingMarkerScale);
254 SimpleVector3 scale(SpaceSamplingMarkerScale, SpaceSamplingMarkerScale, SpaceSamplingMarkerScale);
257 mSamplingMarkerArrayPtr->markers.push_back(samplingMarker);
261 mSamplingPublisher.
publish(mSamplingMarkerArrayPtr);
284 ROS_ERROR(
"triggerNewFrustumVisualization call with pointer newCamera being null.");
288 if(!mNewFrustumMarkerArrayPtr){
289 ROS_ERROR(
"triggerNewFrustumVisualization call with pointer mNewFrustumMarkerArrayPtr being null.");
295 this->
deleteMarkerArray(mNewFrustumMarkerArrayPtr, mFrustumMarkerArrayPublisher);
297 uint32_t sequence = 0;
298 mNewFrustumMarkerArrayPtr = newCamera->getVisualizationMarkerArray(sequence, 0.0);
300 mDebugHelperPtr->write(std::stringstream() <<
"Frustum Pivot Point : " 301 << newCamera->getPivotPointPosition()[0]
302 <<
" , " << newCamera->getPivotPointPosition()[1]
303 <<
" , " << newCamera->getPivotPointPosition()[2],
306 std::string ns =
"new_nbv_frustum";
308 for (
unsigned int i = 0; i < mNewFrustumMarkerArrayPtr->markers.size(); i++)
310 mNewFrustumMarkerArrayPtr->markers.at(i).color.r = 0;
311 mNewFrustumMarkerArrayPtr->markers.at(i).color.g = 1;
312 mNewFrustumMarkerArrayPtr->markers.at(i).color.b = 1;
313 mNewFrustumMarkerArrayPtr->markers.at(i).ns = ns;
317 mFrustumMarkerArrayPublisher.
publish(*mNewFrustumMarkerArrayPtr);
325 if(!mOldFrustumMarkerArrayPtr){
326 ROS_ERROR(
"triggerOldFrustumVisualization call with pointer mOldFrustumMarkerArrayPtr being null.");
332 this->
deleteMarkerArray(mOldFrustumMarkerArrayPtr, mFrustumMarkerArrayPublisher);
334 std::string ns =
"old_nbv_frustum";
337 uint32_t sequence = 0;
338 mOldFrustumMarkerArrayPtr = camera->getVisualizationMarkerArray(sequence, 0.0);
339 for (
unsigned int i = 0; i < mOldFrustumMarkerArrayPtr->markers.size(); i++)
341 mOldFrustumMarkerArrayPtr->markers.at(i).color.r = 1;
342 mOldFrustumMarkerArrayPtr->markers.at(i).color.g = 0;
343 mOldFrustumMarkerArrayPtr->markers.at(i).color.b = 1;
344 mOldFrustumMarkerArrayPtr->markers.at(i).lifetime =
ros::Duration(4.0);
345 mOldFrustumMarkerArrayPtr->markers.at(i).ns = ns;
350 if(!mNewFrustumMarkerArrayPtr){
351 ROS_ERROR(
"triggerOldFrustumVisualization call with pointer mNewFrustumMarkerArrayPtr being null.");
357 if (mNewFrustumMarkerArrayPtr->markers.size() != 0)
360 std::copy(mNewFrustumMarkerArrayPtr->markers.begin(), mNewFrustumMarkerArrayPtr->markers.end(),
361 back_inserter(mOldFrustumMarkerArrayPtr->markers));
364 for (
unsigned int i = 0; i < mOldFrustumMarkerArrayPtr->markers.size(); i++)
366 mOldFrustumMarkerArrayPtr->markers.at(i).lifetime =
ros::Duration(4.0);
367 mOldFrustumMarkerArrayPtr->markers.at(i).color.r = 1;
368 mOldFrustumMarkerArrayPtr->markers.at(i).color.g = 0;
369 mOldFrustumMarkerArrayPtr->markers.at(i).color.b = 1;
370 mOldFrustumMarkerArrayPtr->markers.at(i).ns = ns;
375 if (mOldFrustumMarkerArrayPtr->markers.size() != 0) {
377 mFrustumMarkerArrayPublisher.
publish(mOldFrustumMarkerArrayPtr);
385 if(!mNewFrustumMarkerArrayPtr){
386 ROS_ERROR(
"clearFrustumVisualization call with pointer mNewFrustumMarkerArrayPtr being null.");
390 if (mNewFrustumMarkerArrayPtr->markers.size() == 0) {
396 this->
deleteMarkerArray(mNewFrustumMarkerArrayPtr, mFrustumMarkerArrayPublisher);
397 this->
deleteMarkerArray(mOldFrustumMarkerArrayPtr, mFrustumMarkerArrayPublisher);
408 if(!mObjectMeshMarkerArrayPtr){
409 ROS_ERROR(
"triggerObjectPointCloudVisualization call with pointer mObjectMeshMarkerArrayPtr being null.");
415 mObjectMeshMarkerArrayPtr, mObjectMeshMarkerPublisher);
428 if(!mFrustumObjectMeshMarkerArrayPtr){
429 ROS_ERROR(
"triggerFrustumObjectPointCloudVisualization call with pointer mFrustumObjectMeshMarkerArrayPtr being null.");
434 std_msgs::ColorRGBA::Ptr colorFrustumMeshMarkerPtr(
new std_msgs::ColorRGBA(this->
createColorRGBA(0, 0, 1, 0.8)));
437 mFrustumObjectMeshMarkerArrayPtr, mFrustumObjectMeshMarkerPublisher,
438 colorFrustumMeshMarkerPtr);
444 deleteMarkerArray(mFrustumObjectMeshMarkerArrayPtr, mFrustumObjectMeshMarkerPublisher);
449 if(!mCropBoxMarkerArrayPtr)
451 ROS_ERROR_STREAM(
"triggerCropBoxVisualization::mCropBoxMarkerArrayPtr is empty.");
455 std::vector<double> CropBoxMarkerRGBA;
456 mNodeHandle.
getParam(
"/nbv/CropBoxMarker_RGBA", CropBoxMarkerRGBA);
460 for(std::vector<CropBoxWrapperPtr>::const_iterator it = cropBoxWrapperPtrList->begin(); it != cropBoxWrapperPtrList->end(); ++it)
463 CropBoxPtr cropBoxPtr = cropBoxWrapperPtr->getCropBox();
464 Eigen::Vector4f ptMin,ptMax;
465 ptMin = cropBoxPtr->getMin();
466 ptMax = cropBoxPtr->getMax();
467 Eigen::Vector3f rotation, translation;
468 rotation = cropBoxPtr->getRotation();
469 translation = cropBoxPtr->getTranslation();
471 Eigen::Matrix3f rotationMatrix;
472 rotationMatrix = Eigen::AngleAxisf(rotation[0], Eigen::Vector3f::UnitX())
473 * Eigen::AngleAxisf(rotation[1], Eigen::Vector3f::UnitY())
474 * Eigen::AngleAxisf(rotation[2], Eigen::Vector3f::UnitZ());
478 position_cb_frame[0] = (ptMax[0] + ptMin[0])/2;
479 position_cb_frame[1] = (ptMax[1] + ptMin[1])/2;
480 position_cb_frame[2] = (ptMax[2] + ptMin[2])/2;
483 position_map_frame = rotationMatrix * position_cb_frame + translation;
488 scale[0] = std::abs(ptMax[0] - ptMin[0]);
489 scale[1] = std::abs(ptMax[1] - ptMin[1]);
490 scale[2] = std::abs(ptMax[2] - ptMin[2]);
492 std::stringstream ns;
493 ns <<
"cropbox_ns" << id;
496 position_map_frame, orientation, scale, color, ns.str()));
499 mCropBoxMarkerPublisher.
publish(*mCropBoxMarkerArrayPtr);
505 if(!mObjectNormalsMarkerArrayPtr){
506 ROS_ERROR(
"triggerObjectPointCloudHypothesisVisualization call with pointer mObjectNormalsMarkerArrayPtr being null.");
512 mObjectNormalsMarkerArrayPtr, mPointObjectNormalPublisher);
522 if ( ( observedId.length() == 12 ) && ( observedId.find_first_not_of(
"0123456789") == std::string::npos ) )
528 for (
int i = 0; i <= 3; i++)
532 temp = observedId.substr( (i * 3), 3 );
533 rgba[i] = std::stof(temp) / 100.0;
536 catch (std::invalid_argument& ia)
556 if(!sampledOrientationsPtr){
557 ROS_ERROR(
"triggerCameraVis call with pointer sampledOrientationsPtr being null.");
560 if(!mIterationMarkerArrayPtr){
561 ROS_ERROR(
"triggerCameraVis call with pointer mIterationMarkerArrayPtr being null.");
566 std::vector<double> ViewPortMarkerScales;
567 std::vector<double> ViewPortMarkerRGBA;
568 std::vector<double> ViewPortDirectionsRGBA;
569 std::vector<double> ViewPortDirectionsScales;
570 std::vector<double> ColumnPositionMarkerRGBA;
571 double ViewPortMarkerHeightFactor;
572 double ViewPortMarkerShrinkFactor;
573 double ColumnPositionMarkerWidth;
575 mNodeHandle.
getParam(
"/nbv/ViewPortMarker_Scales", ViewPortMarkerScales);
576 mNodeHandle.
getParam(
"/nbv/ViewPortMarker_HeightFactor", ViewPortMarkerHeightFactor);
577 mNodeHandle.
getParam(
"/nbv/ViewPortMarker_ShrinkFactor", ViewPortMarkerShrinkFactor);
578 mNodeHandle.
getParam(
"/nbv/ViewPortMarker_RGBA", ViewPortMarkerRGBA);
579 mNodeHandle.
getParam(
"/nbv/ViewPortDirections_RGBA", ViewPortDirectionsRGBA);
580 mNodeHandle.
getParam(
"/nbv/ViewPortDirections_Scales", ViewPortDirectionsScales);
581 mNodeHandle.
getParam(
"/nbv/ColumnPositionMarker_Width", ColumnPositionMarkerWidth);
582 mNodeHandle.
getParam(
"/nbv/ColumnPositionMarker_RGBA", ColumnPositionMarkerRGBA);
588 colorViewPortDirection[0] -=
m_j;
589 colorViewPortDirection[1] +=
m_j;
593 colorViewPort[0] -=
m_j;
594 colorViewPort[1] +=
m_j;
600 visualAxis[0] = visualAxis[0]/ViewPortMarkerShrinkFactor + position[0];
601 visualAxis[1] = visualAxis[1]/ViewPortMarkerShrinkFactor + position[1];
602 visualAxis[2] = visualAxis[2]/ViewPortMarkerShrinkFactor + position[2]
603 + mIterationStep * ViewPortMarkerHeightFactor;
607 std::string ns =
"ViewPortDirections" + s;
609 visualization_msgs::Marker ViewPortDirectionsMarker =
MarkerHelper::getArrowMarker(m_i, visualAxis, q, scaleViewPortDirection, colorViewPortDirection, ns);
610 mIterationMarkerArrayPtr->markers.push_back(ViewPortDirectionsMarker);
614 ns =
"visualAxis" + s;
617 mIterationMarkerArrayPtr->markers.push_back(ViewPortMarker);
622 spherePosition[2] += mIterationStep * ViewPortMarkerHeightFactor;
624 SimpleVector3 scale(2.0/ViewPortMarkerShrinkFactor, 2.0/ViewPortMarkerShrinkFactor, 2.0/ViewPortMarkerShrinkFactor);
631 std::string ns =
"visualAxisSphere" + s;
636 mIterationMarkerArrayPtr->markers.push_back(ViewPortSphereMarker);
642 point2[2] += mIterationStep * ViewPortMarkerHeightFactor;
643 std::vector<SimpleVector3> points;
644 points.push_back(point1);
645 points.push_back(point2);
655 mIterationMarkerArrayPtr->markers.push_back(ColumnPositionMarker);
658 scale =
SimpleVector3(1, ColumnPositionMarkerWidth, ColumnPositionMarkerWidth);
664 ns =
"ArrowVizu" +s ;
671 mIterationMarkerArrayPtr->markers.push_back(NextBestViewCameraDirectionMarker);
677 ROS_ERROR(
"triggerSpaceSampling call with pointer pointcloud being null.");
680 if(!mIterationMarkerArrayPtr){
681 ROS_ERROR(
"triggerSpaceSampling call with pointer mIterationMarkerArrayPtr being null.");
686 double SpaceSamplingMarkerScale;
687 std::vector<double> SpaceSamplingMarkerRGBA;
688 mNodeHandle.
getParam(
"/nbv/SpaceSamplingMarker_Scale", SpaceSamplingMarkerScale);
689 mNodeHandle.
getParam(
"/nbv/SpaceSamplingMarker_RGBA", SpaceSamplingMarkerRGBA);
691 SimpleVector3 scale(SpaceSamplingMarkerScale, SpaceSamplingMarkerScale, SpaceSamplingMarkerScale);
698 for(SamplePointCloud::iterator it = pointcloud->points.begin(); it < pointcloud->points.end(); it++)
701 gm::Point point = it->getPoint();
705 std::string ns =
"SamplePoints_NS" + s;
710 mIterationMarkerArrayPtr->markers.push_back(SpaceSamplingMarker);
717 if(!spaceSamplerPtr){
718 ROS_ERROR(
"triggerGrid call with pointer spaceSamplerPtr being null.");
721 if(!mIterationMarkerArrayPtr){
722 ROS_ERROR(
"triggerGrid call with pointer mIterationMarkerArrayPtr being null.");
727 double GridMarkerScaleZ;
728 std::vector<double> GridMarkerRGBA;
729 mNodeHandle.
getParam(
"/nbv/GridMarker_ScaleZ", GridMarkerScaleZ);
730 mNodeHandle.
getParam(
"/nbv/GridMarker_RGBA", GridMarkerRGBA);
732 double xwidth = std::abs(spaceSamplerPtr->getXtop() - spaceSamplerPtr->getXbot());
733 double ywidth = std::abs(spaceSamplerPtr->getYtop() - spaceSamplerPtr->getYbot());
734 double xmid = (spaceSamplerPtr->getXtop() + spaceSamplerPtr->getXbot())/2.0;
735 double ymid = (spaceSamplerPtr->getYtop() + spaceSamplerPtr->getYbot())/2.0;
747 std::string ns =
"Radius" + s;
752 mIterationMarkerArrayPtr->markers.push_back(GridMarker);
757 mMapHelperPtr->worldToMapSize(worldVoxelSize, mapVoxelSize);
759 SimpleVector3 mapPosition(((
double) voxelPos[0] + 0.5) * mapVoxelSize, ((
double) voxelPos[1] + 0.5) * mapVoxelSize, ((
double) voxelPos[2] + 0.5) * mapVoxelSize);
761 mMapHelperPtr->mapToWorldCoordinates(mapPosition, worldPosition);
764 SimpleVector3 scale(worldVoxelSize,worldVoxelSize,worldVoxelSize);
777 visualization_msgs::MarkerArray::Ptr objectMarkerArrayPtr,
ros::Publisher& objectPublisher,
778 std_msgs::ColorRGBA::Ptr objectColorPtr = NULL) {
784 unsigned int index = 0;
785 std::string ns =
"ObjectMeshes";
787 for(ObjectPointCloud::iterator it = objectPointCloud.begin(); it < objectPointCloud.end(); it++)
789 geometry_msgs::Pose pose = it->getPose();
790 std_msgs::ColorRGBA color;
792 if (!objectColorPtr) {
796 color = *objectColorPtr;
799 visualization_msgs::Marker objectMarker =
getObjectMarker(pose, it->type, color, typeToMeshResource, index, ns);
801 objectMarkerArrayPtr->markers.push_back(objectMarker);
806 debugHelperPtr->write(std::stringstream() <<
"Publishing " << objectPointCloud.size() <<
" object points",
808 objectPublisher.
publish(*objectMarkerArrayPtr);
818 visualization_msgs::MarkerArray::Ptr objectNormalsMarkerArrayPtr,
ros::Publisher& objectNormalsPublisher) {
824 unsigned int index = 0;
827 std::string ns =
"ObjectNormals";
829 for(
unsigned int i = 0; i < objectPointCloud.points.size(); i++)
844 objectNormalsMarkerArrayPtr->markers.push_back(objectNormalMarker);
851 objectNormalsPublisher.
publish(*objectNormalsMarkerArrayPtr);
856 if(!array || !publisher)
859 if (array->markers.size() == 0) {
863 for (
unsigned int i = 0; i < array->markers.size(); i++)
865 array->markers.at(i).action = visualization_msgs::Marker::DELETE;
869 array->markers.clear();
872 static visualization_msgs::Marker
getObjectMarker(geometry_msgs::Pose pose, std::string type, std_msgs::ColorRGBA color,
873 std::map<std::string, std::string> typeToMeshResource,
int id, std::string ns) {
874 visualization_msgs::Marker objectMarker;
879 if (typeToMeshResource.count(type) == 1) {
880 std::string meshResource = typeToMeshResource[type];
883 boost::filesystem::path meshResourcePath = boost::filesystem::path(meshResource).replace_extension(
".dae");
884 meshResource = meshResourcePath.string();
890 objectMarker.color = color;
901 static std_msgs::ColorRGBA
createColorRGBA(
float red,
float green,
float blue,
float alpha)
903 std_msgs::ColorRGBA color;
MapHelperPtr mMapHelperPtr
pcl::PointCloud< ObjectPoint > ObjectPointCloud
static bool vector3Equal(SimpleVector3 v1, SimpleVector3 v2)
void publish(const boost::shared_ptr< M > &message) const
static SimpleVector4 getSimpleVector4(const std::vector< double > &vector)
void triggerGrid(SpaceSamplerPtr spaceSamplerPtr, std::string s)
SimpleVector3CollectionPtr normal_vectors
static visualization_msgs::Marker getCubeMarker(int id, SimpleVector3 position, SimpleQuaternion orientation, SimpleVector3 scale, SimpleVector4 color, std::string ns="my_namespace")
returns a cube marker with the given settings
ViewportPointCloud::Ptr ViewportPointCloudPtr
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
bool getBoolClearBetweenIterations()
void clearFrustumObjectPointCloudVisualization()
void triggerObjectPointCloudVisualization(ObjectPointCloud &objectPointCloud, std::map< std::string, std::string > &typeToMeshResource)
triggerObjectPointCloudVisualization shows only objects without hypothesis
void triggerCropBoxVisualization(const boost::shared_ptr< std::vector< CropBoxWrapperPtr >> cropBoxWrapperPtrList)
visualization_msgs::Marker getVoxelMarker(GridVector3 voxelPos, double worldVoxelSize, SimpleVector4 color, int id, std::string ns)
ros::Publisher mPointObjectNormalPublisher
visualization_msgs::MarkerArray::Ptr mFrustumObjectNormalsMarkerArrayPtr
void triggerSpaceSampling(SamplePointCloudPtr pointcloud, std::string s)
Eigen::Matrix< int, 3, 1 > GridVector3
ros::Publisher mCropBoxMarkerPublisher
void triggerSamplingVisualization(ViewportPointCloudPtr samples, Color markerColor, std::string ns)
void triggerCameraVis(std::string s, const SimpleQuaternionCollectionPtr &sampledOrientationsPtr, ViewportPoint currentBestViewport)
static visualization_msgs::Marker getCylinderMarker(int id, SimpleVector3 position, double w, SimpleVector3 scale, SimpleVector4 color, std::string ns="my_namespace")
returns a cylinder marker with the given settings
ros::Publisher mObjectMeshMarkerPublisher
SamplePointCloud::Ptr SamplePointCloudPtr
ros::NodeHandle mNodeHandle
SimpleQuaternion getSimpleQuaternion() const
static std_msgs::ColorRGBA createColorRGBA(float red, float green, float blue, float alpha)
void triggerFrustumObjectPointCloudVisualization(ObjectPointCloud &frustumObjectPointCloud, std::map< std::string, std::string > &typeToMeshResource)
triggerFrustumObjectPointCloudVisualization shows only objects without hypothesis.
visualization_msgs::MarkerArray::Ptr mObjectMeshMarkerArrayPtr
Eigen::Matrix< Precision, 4, 1 > SimpleVector4
ros::Publisher mIterationMarkerArrayPublisher
this namespace contains all generally usable classes.
static visualization_msgs::Marker getObjectMarker(geometry_msgs::Pose pose, std::string type, std_msgs::ColorRGBA color, std::map< std::string, std::string > typeToMeshResource, int id, std::string ns)
void triggerObjectNormalsVisualization(ObjectPointCloud &objectPointCloud)
visualization_msgs::MarkerArray::Ptr mObjectNormalsMarkerArrayPtr
static void deleteMarkerArray(visualization_msgs::MarkerArray::Ptr &array, ros::Publisher &publisher)
static boost::shared_ptr< DebugHelper > getInstance()
DebugHelperPtr mDebugHelperPtr
static SimpleVector3 getVisualAxis(const SimpleQuaternion &orientation)
visualization_msgs::MarkerArray::Ptr mOldFrustumMarkerArrayPtr
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher mFrustumObjectMeshMarkerPublisher
ros::Publisher mSamplingPublisher
visualization_msgs::MarkerArray::Ptr mCropBoxMarkerArrayPtr
void triggerFrustumsVisualization(CameraModelFilterPtr newCamera)
visualizes the frustum of the last camera that was given and the frustum of the new given camera...
SimpleVector3 getPosition() const
visualization_msgs::MarkerArray::Ptr mIterationMarkerArrayPtr
boost::shared_ptr< VisualizationHelper > VisualizationHelperPtr
static std_msgs::ColorRGBA getMeshColor(std::string observedId)
void resetSamplingVisualization()
SimpleVector3 getPosition() const
static visualization_msgs::Marker getArrowMarker(int id, SimpleVector3 startPoint, SimpleVector3 endPoint, SimpleVector3 scale=SimpleVector3(0.025, 0.05, 0.05), SimpleVector4 color=SimpleVector4(1.0, 0.0, 0.0, 1.0), std::string ns="my_namespace")
returns an arrow marker with the given settings
#define ROS_INFO_STREAM(args)
void triggerIterationVisualization(int iterationStep, const SimpleQuaternionCollectionPtr &sampledOrientationsPtr, ViewportPoint currentBestViewport, SamplePointCloudPtr pointcloud, SpaceSamplerPtr spaceSamplerPtr)
ros::Publisher mFrustumMarkerArrayPublisher
bool getParam(const std::string &key, std::string &s) const
static SimpleVector3 getSimpleVector3(const geometry_msgs::Pose &pose)
VisualizationHelper(MapHelperPtr mapHelperPtr)
std::vector< SimpleVector3, Eigen::aligned_allocator< SimpleVector3 > > SimpleVector3Collection
void triggerOldFrustumVisualization(CameraModelFilterPtr camera=NULL)
static visualization_msgs::Marker getLineListMarker(int id, std::vector< SimpleVector3 > points, double scale, SimpleVector4 color, std::string ns="my_namespace")
returns a line list marker with the given settings
void triggerNewFrustumVisualization(CameraModelFilterPtr newCamera)
static SimpleQuaternion getSimpleQuaternion(const geometry_msgs::Pose &pose)
bool mBoolClearBetweenIterations
#define ROS_ERROR_STREAM(args)
Eigen::Quaternion< Precision > SimpleQuaternion
visualization_msgs::MarkerArray::Ptr mNewFrustumMarkerArrayPtr
IndicesPtr active_normal_vectors
visualization_msgs::MarkerArray::Ptr mFrustumObjectMeshMarkerArrayPtr
static void visualizePointCloudNormals(ObjectPointCloud &objectPointCloud, visualization_msgs::MarkerArray::Ptr objectNormalsMarkerArrayPtr, ros::Publisher &objectNormalsPublisher)
visualizePointCloudNormals visualizes all hypothesis of each object.
static void visualizePointCloudObjects(ObjectPointCloud &objectPointCloud, std::map< std::string, std::string > &typeToMeshResource, visualization_msgs::MarkerArray::Ptr objectMarkerArrayPtr, ros::Publisher &objectPublisher, std_msgs::ColorRGBA::Ptr objectColorPtr=NULL)
visualizePointCloudObjects visualizes objects of objectPointCloud, using typeToMeshResource to get me...
static visualization_msgs::Marker getSphereMarker(int id, SimpleVector3 position, SimpleVector3 scale, SimpleVector4 color, std::string ns="my_namespace")
returns a sphere marker with the given settings
static visualization_msgs::Marker getMeshMarker(int id, std::string meshResource, SimpleVector3 centroid, SimpleQuaternion quaternion, SimpleVector3 scale=SimpleVector3(0.001, 0.001, 0.001), std::string ns="my_namespace")
returns a mesh marker with the given settings
visualization_msgs::MarkerArray::Ptr mSamplingMarkerArrayPtr
void clearFrustumVisualization()