24 #include <boost/foreach.hpp> 25 #include <eigen3/Eigen/Dense> 26 #include <pcl-1.7/pcl/point_cloud.h> 27 #include <pcl_conversions/pcl_conversions.h> 34 #include <object_database/ObjectManager.h> 35 #include <dynamic_reconfigure/server.h> 36 #include <asr_next_best_view/DynamicParametersConfig.h> 40 #include "asr_next_best_view/RatedViewport.h" 41 #include "asr_next_best_view/RateViewports.h" 42 #include "asr_next_best_view/RemoveObjects.h" 43 #include "asr_next_best_view/NormalsInfo.h" 44 #include "asr_next_best_view/TriggerFrustumVisualization.h" 45 #include "asr_next_best_view/TriggerFrustumsAndPointCloudVisualization.h" 46 #include "asr_next_best_view/GetAttributedPointCloud.h" 47 #include "asr_next_best_view/GetNextBestView.h" 48 #include "asr_next_best_view/SetAttributedPointCloud.h" 49 #include "asr_next_best_view/SetInitRobotState.h" 50 #include "asr_next_best_view/ResetCalculator.h" 51 #include "asr_next_best_view/UpdatePointCloud.h" 55 #include "asr_msgs/AsrAttributedPointCloud.h" 56 #include "asr_msgs/AsrAttributedPoint.h" 57 #include "asr_msgs/AsrViewport.h" 68 #include <robot_model_services/robot_model/impl/MILDRobotModelWithExactIK.hpp> 69 #include <robot_model_services/robot_model/impl/MILDRobotModelWithApproximatedIK.hpp> 70 #include <robot_model_services/robot_model/impl/MILDRobotModelWithExactIKFactory.hpp> 71 #include <robot_model_services/robot_model/impl/MILDRobotModelWithApproximatedIKFactory.hpp> 72 #include <robot_model_services/robot_model/impl/MILDRobotState.hpp> 88 namespace viz = visualization_msgs;
89 namespace odb = object_database;
132 asr_next_best_view::DynamicParametersConfig
mConfig;
172 mDynamicReconfigServer.setCallback(f);
182 this->mVisualizationThread->join();
189 mDebugHelperPtr->write(std::stringstream() <<
"debugLevels: " << mDebugHelperPtr->getLevelString(),
DebugHelper::PARAMETERS);
191 mCurrentlyPublishingVisualization =
false;
202 mDebugHelperPtr->write(std::stringstream() <<
"samples: " << mConfig.sampleSizeUnitSphereSampler,
DebugHelper::PARAMETERS);
203 mDebugHelperPtr->write(std::stringstream() <<
"speedFactorRecognizer: " << mConfig.speedFactorRecognizer,
DebugHelper::PARAMETERS);
232 if (mSphereSamplerFactoryPtr) {
233 mSphereSamplerFactoryPtr.reset();
243 mMapHelperPtr->setCollisionThreshold(mConfig.colThresh);
256 mDebugHelperPtr->write(std::stringstream() <<
"sampleSizeMapBasedRandomSpaceSampler: " << mConfig.sampleSizeMapBasedRandomSpaceSampler,
DebugHelper::PARAMETERS);
257 mDebugHelperPtr->write(std::stringstream() <<
"spaceSamplerId: " << mConfig.spaceSamplerId,
DebugHelper::PARAMETERS);
260 if (mSpaceSampleFactoryPtr) {
261 mSpaceSampleFactoryPtr.reset();
264 mCalculator.
setSpaceSampler(mSpaceSampleFactoryPtr->createSpaceSampler());
267 mDebugHelperPtr->write(std::stringstream() <<
"cameraFilterId: " << mConfig.cameraFilterId,
DebugHelper::PARAMETERS);
275 if (mCameraModelFactoryPtr) {
276 mCameraModelFactoryPtr.reset();
295 if (mRobotModelFactoryPtr) {
296 mRobotModelFactoryPtr.reset();
299 mCalculator.
setRobotModel(mRobotModelFactoryPtr->createRobotModel());
306 mDebugHelperPtr->write(std::stringstream() <<
"useTargetRobotState: " << mConfig.useTargetRobotState,
DebugHelper::PARAMETERS);
309 if (mRatingModuleFactoryPtr) {
310 mRatingModuleFactoryPtr.reset();
313 mCalculator.
setRatingModule(mRatingModuleFactoryPtr->createRatingModule());
322 if (mHypothesisUpdaterFactoryPtr) {
323 mHypothesisUpdaterFactoryPtr.reset();
334 mDebugHelperPtr->setLevels(mConfig.debugLevels);
339 mDebugHelperPtr->write(std::stringstream() <<
"maxIterationSteps: " << mConfig.maxIterationSteps,
DebugHelper::PARAMETERS);
343 mNodeHandle.
getParam(
"/scene_exploration_sm/min_utility_for_moving", minUtility);
346 mShowPointcloud = mConfig.show_point_cloud;
347 mShowFrustumPointCloud = mConfig.show_frustum_point_cloud;
348 mShowFrustumMarkerArray = mConfig.show_frustum_marker_array;
349 mShowNormals = mConfig.show_normals;
352 mDebugHelperPtr->write(std::stringstream() <<
"boolClearBetweenIterations: " << mVisHelperPtr->getBoolClearBetweenIterations(),
DebugHelper::PARAMETERS);
381 std::stringstream ss;
382 ss << mConfig.sphereSamplerId <<
" is not a valid sphere sampler ID";
384 throw std::runtime_error(ss.str());
409 std::stringstream ss;
410 ss << mConfig.spaceSamplerId <<
" is not a valid space sampler ID";
412 throw std::runtime_error(ss.str());
423 SimpleVector3 oneCameraPivotPointOffset = (leftCameraPivotPointOffset + rightCameraPivotPointOffset) * 0.5;
429 mConfig.fovx, mConfig.fovy,
430 mConfig.fcp, mConfig.ncp,
431 mConfig.speedFactorRecognizer));
435 mConfig.fovx, mConfig.fovy,
436 mConfig.fcp, mConfig.ncp,
437 mConfig.speedFactorRecognizer));
439 std::stringstream ss;
440 ss << mConfig.cameraFilterId <<
" is not a valid camera filter ID";
442 throw std::runtime_error(ss.str());
454 return robot_model_services::RobotModelAbstractFactoryPtr(
new robot_model_services::MILDRobotModelWithExactIKFactory(mConfig.tiltMin, mConfig.tiltMax, mConfig.panMin, mConfig.panMax));
457 return robot_model_services::RobotModelAbstractFactoryPtr(
new robot_model_services::MILDRobotModelWithApproximatedIKFactory(mConfig.tiltMin, mConfig.tiltMax, mConfig.panMin, mConfig.panMax));
459 std::stringstream ss;
460 ss << mConfig.robotModelId <<
" is not a valid robot model ID";
462 throw std::runtime_error(ss.str());
469 robot_model_services::RobotModelAbstractFactoryPtr robotModelFactoryPtr;
477 mConfig.fcp, mConfig.ncp,
478 mConfig.useTargetRobotState,
479 robotModelFactoryPtr, cameraModelFactoryPtr, mMapHelperPtr,
480 mConfig.mRatingNormalAngleThreshold / 180.0 * M_PI,
481 mConfig.mOmegaUtility, mConfig.mOmegaPan, mConfig.mOmegaTilt,
482 mConfig.mOmegaRot, mConfig.mOmegaBase, mConfig.mOmegaRecognizer,
483 mConfig.useOrientationUtility, mConfig.useProximityUtility, mConfig.useSideUtility));
485 std::stringstream ss;
486 ss << mConfig.ratingModuleId <<
" is not a valid rating module ID";
488 throw std::runtime_error(ss.str());
501 mConfig.mHypothesisUpdaterAngleThreshold / 180.0 * M_PI));
505 std::stringstream ss;
506 ss << mConfig.hypothesisUpdaterId <<
" is not a valid hypothesis module ID";
508 throw std::runtime_error(ss.str());
514 mConfigLevel = std::numeric_limits<uint32_t>::max();
517 response.succeeded =
true;
522 bool processRateViewports(asr_next_best_view::RateViewports::Request &request, asr_next_best_view::RateViewports::Response &response) {
525 if (request.viewports.empty()) {
538 for (geometry_msgs::Pose viewport : request.viewports) {
541 sampleViewport.
oldIdx = i;
542 sampleViewportsPtr->push_back(sampleViewport);
555 mCalculator.
rateViewports(feasibleSampleViewportsPtr, currentCameraViewport, ratedSampleViewportsPtr, request.use_object_type_to_rate);
557 mDebugHelperPtr->write(std::stringstream() <<
"number of rated viewports: " << ratedSampleViewportsPtr->size(),
DebugHelper::SERVICE_CALLS);
562 return a.
oldIdx < b.oldIdx;
566 unsigned int nextRatedViewportIdx = 0;
567 unsigned int nextRatedViewportOldIdx = 0;
568 if (ratedSampleViewportsPtr->size() == 0) {
569 nextRatedViewportOldIdx = -1;
571 nextRatedViewportOldIdx = ratedSampleViewportsPtr->at(nextRatedViewportIdx).oldIdx;
573 for (i = 0; i < sampleViewportsPtr->size(); i++) {
574 asr_next_best_view::RatedViewport responseViewport;
575 if (i != nextRatedViewportOldIdx) {
577 responseViewport.pose = unratedViewport.
getPose();
578 responseViewport.oldIdx = i;
580 responseViewport.object_type_name_list = std::vector<std::string>(unratedViewport.
object_type_set->size());
583 responseViewport.object_type_name_list.begin());
587 ViewportPoint& ratedViewport = ratedSampleViewportsPtr->at(nextRatedViewportIdx);
588 responseViewport.pose = ratedViewport.
getPose();
589 responseViewport.oldIdx = i;
591 responseViewport.object_type_name_list = std::vector<std::string>(ratedViewport.
object_type_set->size());
594 responseViewport.object_type_name_list.begin());
598 responseViewport.utility = ratedViewport.
score->getUnweightedUnnormalizedUtility();
599 responseViewport.inverse_costs = ratedViewport.
score->getWeightedInverseCosts();
600 responseViewport.base_translation_inverse_costs = ratedViewport.
score->getUnweightedInverseMovementCostsBaseTranslation();
601 responseViewport.base_rotation_inverse_costs = ratedViewport.
score->getUnweightedInverseMovementCostsBaseRotation();
602 responseViewport.ptu_movement_inverse_costs = ratedViewport.
score->getUnweightedInverseMovementCostsPTU();
603 responseViewport.recognition_inverse_costs = ratedViewport.
score->getUnweightedInverseRecognitionCosts();
604 nextRatedViewportIdx++;
605 if (nextRatedViewportIdx < ratedSampleViewportsPtr->size()) {
606 nextRatedViewportOldIdx = ratedSampleViewportsPtr->at(nextRatedViewportIdx).oldIdx;
609 response.sortedRatedViewports.push_back(responseViewport);
613 std::stable_sort(response.sortedRatedViewports.begin(), response.sortedRatedViewports.end(), [](asr_next_best_view::RatedViewport a, asr_next_best_view::RatedViewport b)
615 return a.rating > b.rating;
622 bool processRemoveObjects(asr_next_best_view::RemoveObjects::Request &request, asr_next_best_view::RemoveObjects::Response &response) {
626 bool is_valid = mCalculator.
removeObjects(request.type, request.identifier);
628 response.is_valid = is_valid;
636 pointCloudMessage.elements.clear();
645 asr_msgs::AsrAttributedPoint aPoint;
648 aPoint.type = point.
type;
651 pointCloudMessage.elements.push_back(aPoint);
655 bool processGetPointCloudServiceCall(asr_next_best_view::GetAttributedPointCloud::Request &request, asr_next_best_view::GetAttributedPointCloud::Response &response) {
659 if (request.minNumberNormals < 1)
660 request.minNumberNormals = 1;
667 bool processSetPointCloudServiceCall(asr_next_best_view::SetAttributedPointCloud::Request &request, asr_next_best_view::SetAttributedPointCloud::Response &response) {
672 ROS_ERROR(
"Could not set point cloud from message.");
679 response.is_valid =
false;
685 std::vector<ViewportPoint> viewportPointList;
686 BOOST_FOREACH(asr_msgs::AsrViewport &viewport, request.viewports_to_filter)
690 viewportConversionPoint.
object_type_set->insert(viewport.object_type_name_list.begin(), viewport.object_type_name_list.end());
691 viewportPointList.push_back(viewportConversionPoint);
697 response.is_valid =
true;
700 std::vector<std::pair<std::string, std::string>> typeAndIds = mCalculator.
getTypeAndIds();
701 for (
auto &typeAndId : typeAndIds) {
702 asr_next_best_view::NormalsInfo curNormalsInfo;
703 std::string type = typeAndId.first;
704 std::string identifier = typeAndId.second;
707 unsigned int deactivatedNormals = totalNormals - activeNormals;
708 curNormalsInfo.active_normals = totalNormals;
709 curNormalsInfo.deactivated_object_normals = deactivatedNormals;
710 curNormalsInfo.type = type;
711 curNormalsInfo.identifier = identifier;
712 response.normals_per_object.push_back(curNormalsInfo);
725 robot_model_services::MILDRobotStatePtr currentRobotStatePtr(
new robot_model_services::MILDRobotState());
726 currentRobotStatePtr->pan = request.robotState.pan;
727 currentRobotStatePtr->tilt = request.robotState.tilt;
728 currentRobotStatePtr->rotation = request.robotState.rotation;
729 currentRobotStatePtr->x = request.robotState.x;
730 currentRobotStatePtr->y = request.robotState.y;
732 ROS_INFO_STREAM(
"Initial pose: pan " << currentRobotStatePtr->pan <<
", tilt " << currentRobotStatePtr->tilt
733 <<
", rotation " << currentRobotStatePtr->rotation <<
", x " << currentRobotStatePtr->x <<
", y " << currentRobotStatePtr->y);
735 mCalculator.
getRobotModel()->setCurrentRobotState(currentRobotStatePtr);
751 response.found =
false;
760 response.found =
false;
765 response.found =
true;
766 response.viewport.pose = resultingViewport.
getPose();
773 response.viewport.fovx = mConfig.fovx;
774 response.viewport.fovy = mConfig.fovy;
775 response.viewport.ncp = mConfig.ncp;
776 response.viewport.fcp = mConfig.fcp;
781 robot_model_services::MILDRobotStatePtr mildState = boost::static_pointer_cast<robot_model_services::MILDRobotState>(state);
783 asr_next_best_view::RobotStateMessage robotStateMsg;
784 robotStateMsg.pan = mildState->pan;
785 robotStateMsg.tilt = mildState->tilt;
786 robotStateMsg.rotation = mildState->rotation;
787 robotStateMsg.x = mildState->x;
788 robotStateMsg.y = mildState->y;
791 response.robot_state = robotStateMsg;
794 response.utility = resultingViewport.
score->getUnweightedUnnormalizedUtility();
795 response.utility_normalization = resultingViewport.
score->getUtilityNormalization();
796 response.inverse_costs = resultingViewport.
score->getWeightedInverseCosts();
797 response.base_translation_inverse_costs = resultingViewport.
score->getUnweightedInverseMovementCostsBaseTranslation();
798 response.base_rotation_inverse_costs = resultingViewport.
score->getUnweightedInverseMovementCostsBaseRotation();
799 response.ptu_movement_inverse_costs = resultingViewport.
score->getUnweightedInverseMovementCostsPTU();
800 response.recognition_inverse_costs = resultingViewport.
score->getUnweightedInverseRecognitionCosts();
802 mCurrentCameraViewport = resultingViewport;
812 std::stringstream pose;
813 pose <<
"x = " << request.pose_for_update.position.x <<
", " 814 <<
"y = " << request.pose_for_update.position.y <<
", " 815 <<
"z = " << request.pose_for_update.position.z <<
", " 816 <<
"qw = " << request.pose_for_update.orientation.w <<
", " 817 <<
"qx = " << request.pose_for_update.orientation.x <<
", " 818 <<
"qy = " << request.pose_for_update.orientation.y <<
", " 819 <<
"qz = " << request.pose_for_update.orientation.z;
820 std::string objects =
"";
821 BOOST_FOREACH(std::string
object, request.object_type_name_list) {
822 if (objects.length() != 0) {
835 mDebugHelperPtr->write(std::stringstream() <<
"Do frustum culling: ActiveIndices=" 848 response.deactivated_object_normals = deactivatedNormals;
857 asr_next_best_view::TriggerFrustumVisualization::Response &response)
860 geometry_msgs::Pose pose = request.current_pose;
872 asr_next_best_view::TriggerFrustumVisualization::Response &response)
875 geometry_msgs::Pose pose = request.current_pose;
887 asr_next_best_view::TriggerFrustumsAndPointCloudVisualization::Response &response)
889 mDebugHelperPtr->writeNoticeably(
"STARTING NBV TRIGGER-FRUSTUMS-AND-POINT-CLOUD-VISUALIZATION SERVICE CALL",
DebugHelper::SERVICE_CALLS);
912 BOOST_FOREACH(std::string objectType, request.new_viewport.object_type_name_list)
913 objectTypeSetPtr->insert(objectType);
921 mDebugHelperPtr->writeNoticeably(
"ENDING NBV TRIGGER-FRUSTUMS-AND-POINT-CLOUD-VISUALIZATION SERVICE CALL",
DebugHelper::SERVICE_CALLS);
931 if (mCurrentlyPublishingVisualization) {
936 mCurrentlyPublishingVisualization =
true;
951 mDebugHelperPtr->write(std::stringstream() <<
"Frustum Pivot Point : " << mCalculator.
getCameraModelFilter()->getPivotPointPosition()[0]
956 mDebugHelperPtr->write(std::stringstream() <<
"Object points in the viewport: " << viewport.
child_indices->size(),
963 if (mShowFrustumPointCloud) {
971 std::map<std::string, std::string> typeToMeshResource = this->
getMeshResources(objectPointCloud);
973 mVisHelperPtr->triggerObjectPointCloudVisualization(objectPointCloud, typeToMeshResource);
975 if (mShowFrustumPointCloud)
979 std::map<std::string, std::string> typeToMeshResource = this->
getMeshResources(frustumObjectPointCloud);
981 mVisHelperPtr->triggerFrustumObjectPointCloudVisualization(frustumObjectPointCloud, typeToMeshResource);
983 if (mShowFrustumMarkerArray && publishFrustum)
988 mCurrentlyPublishingVisualization =
false;
999 mVisHelperPtr->clearFrustumObjectPointCloudVisualization();
1002 std::map<std::string, std::string> typeToMeshResource = this->
getMeshResources(objectPointCloud);
1004 mVisHelperPtr->triggerObjectPointCloudVisualization(objectPointCloud, typeToMeshResource);
1009 mVisHelperPtr->triggerObjectNormalsVisualization(objectPointCloud);
1019 mVisHelperPtr->triggerObjectNormalsVisualization(objectPointCloud);
1030 std::set_difference(activeIndices->begin(), activeIndices->end(),
1031 childIndices->begin(), childIndices->end(),
1032 std::back_inserter(resultIndices));
1036 std::map<std::string, std::string> typeToMeshResource;
1037 for(ObjectPointCloud::iterator it = objectPointCloud.begin(); it < objectPointCloud.end(); it++) {
1038 if (typeToMeshResource.count(it->type) == 0) {
1041 if (path.compare(
"-2") != 0) {
1046 return typeToMeshResource;
1053 this->mConfig = config;
1054 this->mConfigLevel = level;
bool rateViewports(const ViewportPointCloudPtr &sampleNextBestViewportsPtr, const ViewportPoint ¤tCameraViewport, ViewportPoint &resultViewport, bool objectTypeSetIsKnown=false)
rates given viewports, which must contain child_indices
bool getFeasibleHypothesis(SimpleVector3 samplePoint, IndicesPtr &resultIndicesPtr)
getFeasibleHypothesis finds object hypothesis near samplePoint
ObjectPointCloudPtr getPointCloudPtr()
bool processTriggerOldFrustumVisualization(asr_next_best_view::TriggerFrustumVisualization::Request &request, asr_next_best_view::TriggerFrustumVisualization::Response &response)
VisualizationHelperPtr mVisHelperPtr
void setHypothesisUpdater(const HypothesisUpdaterPtr &hypothesisUpdaterPtr)
unsigned int getNumberTotalNormals(std::string type, std::string identifier)
IndicesPtr getActiveIndices()
bool processGetNextBestViewServiceCall(asr_next_best_view::GetNextBestView::Request &request, asr_next_best_view::GetNextBestView::Response &response)
CameraModelFilterAbstractFactoryPtr createCameraModelFromConfig(int moduleId)
pcl::PointCloud< ObjectPoint > ObjectPointCloud
void setEnableIntermediateObjectWeighting(const bool mEnableIntermediateObjectWeighting)
HypothesisUpdaterAbstractFactoryPtr createHypothesisUpdaterFromConfig(int moduleId)
bool doFrustumCulling(const SimpleVector3 &position, const SimpleQuaternion &orientation, const IndicesPtr &indices, ViewportPoint &viewportPoint)
creates a new camera viewport with the given data
RatingModuleAbstractFactoryPtr createRatingModuleFromConfig(int moduleId)
void setCameraModelFilter(const CameraModelFilterPtr &cameraModelFilterPtr)
ros::ServiceServer mResetCalculatorServer
bool processResetCalculatorServiceCall(asr_next_best_view::ResetCalculator::Request &request, asr_next_best_view::ResetCalculator::Response &response)
std::string getMeshPathByName(std::string objectType)
asr_next_best_view::DynamicParametersConfig mConfig
void setCameraModelFilterAbstractFactoryPtr(const CameraModelFilterAbstractFactoryPtr &cameraModelFilterAbstractFactoryPtr)
setCameraModelFilterAbstractFactoryPtr used to generate camera models per thread. ...
ViewportPointCloud::Ptr ViewportPointCloudPtr
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
boost::shared_ptr< UnitSphereSamplerAbstractFactory > UnitSphereSamplerAbstractFactoryPtr
void setMaxIterationSteps(int maxIterationSteps)
void publishVisualization(ViewportPoint viewport, bool publishFrustum)
Publishes the Visualization of the NextBestView.
ros::ServiceServer mSetPointCloudServiceServer
void initializeRobotState(const ViewportPoint ¤tCameraViewport)
initializeRobotState initializes the robotstate to the given viewport
bool setPointCloudFromMessage(const asr_msgs::AsrAttributedPointCloud &msg)
///
robot_model_services::RobotModelAbstractFactoryPtr mRobotModelFactoryPtr
bool processTriggerFrustumVisualization(asr_next_best_view::TriggerFrustumVisualization::Request &request, asr_next_best_view::TriggerFrustumVisualization::Response &response)
ros::ServiceServer mRemoveObjectsServer
bool mShowFrustumPointCloud
boost::shared_ptr< SpaceSamplerAbstractFactory > SpaceSamplerAbstractFactoryPtr
ROSCPP_DECL const std::string & getName()
NextBestView is a configuration class of the related node.
DebugHelperPtr mDebugHelperPtr
ViewportPoint mCurrentCameraViewport
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool processSetInitRobotStateServiceCall(asr_next_best_view::SetInitRobotState::Request &request, asr_next_best_view::SetInitRobotState::Response &response)
void setNumberOfThreads(int value)
sets number of threads used to rate samples, negative numbers use boost::thread::hardware_concurrency...
std::set< std::string > ObjectTypeSet
std::vector< int > Indices
boost::shared_ptr< boost::thread > mVisualizationThread
ros::NodeHandle mGlobalNodeHandle
bool mCurrentlyPublishingVisualization
unsigned int updateObjectPointCloud(const ObjectTypeSetPtr &objectTypeSetPtr, const ViewportPoint &viewportPoint)
Updates the point cloud under the assumption that the given viewport was chosen.
bool triggerVisualization(ViewportPoint viewport)
SimpleQuaternion getSimpleQuaternion() const
bool triggerVisualization()
void dynamicReconfigureCallback(asr_next_best_view::DynamicParametersConfig &config, uint32_t level)
DefaultScoreContainerPtr score
ros::ServiceServer mGetNextBestViewServiceServer
void setMinUtility(double minUtility)
void setSpaceSampler(const SpaceSamplerPtr &spaceSamplerPtr)
ros::ServiceServer mSetInitRobotStateServiceServer
boost::shared_ptr< HypothesisUpdaterAbstractFactory > HypothesisUpdaterAbstractFactoryPtr
this namespace contains all generally usable classes.
void setRatingModuleAbstractFactoryPtr(const RatingModuleAbstractFactoryPtr &ratingModuleAbstractFactoryPtr)
setRatingModuleAbstractFactoryPtr used to generate rating modules per thread.
void setMapHelper(const MapHelperPtr &mapHelperPtr)
NextBestViewCalculator mCalculator
UnitSphereSamplerAbstractFactoryPtr mSphereSamplerFactoryPtr
void publishPointCloudNormals()
pcl::PointCloud< ViewportPoint > ViewportPointCloud
UnitSphereSamplerAbstractFactoryPtr createSphereSamplerFromConfig(int moduleId)
void loadCropBoxListFromFile(const std::string mCropBoxListFilePath)
static boost::shared_ptr< DebugHelper > getInstance()
void updateFromExternalViewportPointList(const std::vector< ViewportPoint > &viewportPointList)
updates point cloud with external viewport point list
boost::shared_ptr< Indices > IndicesPtr
ros::NodeHandle mNodeHandle
bool filterObjectPointCloudByTypes(const ObjectTypeSetPtr &objectTypeSetPtr, ViewportPoint &viewportPoint)
filters all the objects in this viewport with one of the given types and puts them in a new viewport...
void setUnitSphereSampler(const UnitSphereSamplerPtr &unitSphereSamplerPtr)
ros::ServiceServer mUpdatePointCloudServiceServer
SpaceSamplerAbstractFactoryPtr mSpaceSampleFactoryPtr
bool processUpdatePointCloudServiceCall(asr_next_best_view::UpdatePointCloud::Request &request, asr_next_best_view::UpdatePointCloud::Response &response)
boost::shared_ptr< CameraModelFilterAbstractFactory > CameraModelFilterAbstractFactoryPtr
boost::shared_ptr< ObjectTypeSet > ObjectTypeSetPtr
SimpleVector3 getPosition() const
RatingModuleAbstractFactoryPtr mRatingModuleFactoryPtr
boost::shared_ptr< RatingModuleAbstractFactory > RatingModuleAbstractFactoryPtr
boost::shared_ptr< VisualizationHelper > VisualizationHelperPtr
bool processTriggerFrustumsAndPointCloudVisualization(asr_next_best_view::TriggerFrustumsAndPointCloudVisualization::Request &request, asr_next_best_view::TriggerFrustumsAndPointCloudVisualization::Response &response)
robot_model_services::RobotModelPtr getRobotModel()
void setEnableCropBoxFiltering(const bool mEnableCropBoxFiltering)
robot_model_services::RobotModelAbstractFactoryPtr createRobotModelFromConfig(int moduleId)
ros::ServiceServer mTriggerFrustumVisualizationServer
HypothesisUpdaterAbstractFactoryPtr mHypothesisUpdaterFactoryPtr
std::vector< std::pair< std::string, std::string > > getTypeAndIds()
bool removeObjects(std::string type, std::string identifier)
#define ROS_INFO_STREAM(args)
void setRobotModel(const robot_model_services::RobotModelPtr &robotModelPtr)
static void convertObjectPointCloudToAttributedPointCloud(const ObjectPointCloud &pointCloud, asr_msgs::AsrAttributedPointCloud &pointCloudMessage, uint minNumberNormals)
void setEpsilon(float epsilon)
ros::ServiceServer mGetPointCloudServiceServer
NextBestView()
Creates an instance of the NextBestView class.
bool processGetPointCloudServiceCall(asr_next_best_view::GetAttributedPointCloud::Request &request, asr_next_best_view::GetAttributedPointCloud::Response &response)
bool getParam(const std::string &key, std::string &s) const
static SimpleVector3 getSimpleVector3(const geometry_msgs::Pose &pose)
bool processRateViewports(asr_next_best_view::RateViewports::Request &request, asr_next_best_view::RateViewports::Response &response)
bool processSetPointCloudServiceCall(asr_next_best_view::SetAttributedPointCloud::Request &request, asr_next_best_view::SetAttributedPointCloud::Response &response)
dynamic_reconfigure::Server< asr_next_best_view::DynamicParametersConfig > mDynamicReconfigServer
MapHelperPtr mMapHelperPtr
std::map< std::string, std::string > getMeshResources(ObjectPointCloud objectPointCloud)
RatingModulePtr getRatingModule()
MapHelperPtr getMapHelper()
bool calculateNextBestView(const ViewportPoint ¤tCameraViewport, ViewportPoint &resultViewport)
static SimpleQuaternion getSimpleQuaternion(const geometry_msgs::Pose &pose)
CameraModelFilterPtr getCameraModelFilter()
#define ROS_ERROR_STREAM(args)
void getIndicesOutsideFrustum(const ViewportPoint &viewport, Indices &resultIndices)
Eigen::Quaternion< Precision > SimpleQuaternion
ros::ServiceServer mTriggerOldFrustumVisualizationServer
int getNumberActiveNormals()
bool processRemoveObjects(asr_next_best_view::RemoveObjects::Request &request, asr_next_best_view::RemoveObjects::Response &response)
ros::ServiceServer mRateViewportsServer
boost::shared_ptr< asr_next_best_view::DynamicParametersConfig > DynamicParametersConfigPtr
NextBestViewCalculator & getCalculator()
ros::ServiceServer mTriggerFrustmsAndPointCloudVisualizationServer
void publishNewPointCloudVisualization()
IndicesPtr active_normal_vectors
void getFeasibleViewports(const ViewportPointCloudPtr &sampleViewportsPtr, IndicesPtr &resultIndicesPtr)
getFeasibleViewports returns a vector of indices/sampleViewports which contain nearby (hypothesis) ...
ObjectTypeSetPtr object_type_set
void setRatingModule(const RatingModulePtr &ratingModulePtr)
bool mShowFrustumMarkerArray
CameraModelFilterAbstractFactoryPtr mCameraModelFactoryPtr
std::vector< std::string > ObjectTypeList
boost::shared_ptr< MapHelper > MapHelperPtr
SpaceSamplerAbstractFactoryPtr createSpaceSamplerFromConfig(int moduleId)