31 asr_world_model::PushViewport::Response &response)
44 asr_world_model::EmptyViewportList::Response &response)
46 const std::string &object_type = request.object_type;
49 if (std::string(
"all") == object_type || std::string(
"") == object_type) {
55 std::vector<std::string>::iterator foundObjectIt = std::find(viewportListIt->object_type_name_list.begin(), viewportListIt->object_type_name_list.end(), object_type);
56 if (foundObjectIt != viewportListIt->object_type_name_list.end()) {
58 if (viewportListIt->object_type_name_list.size() == 1) {
62 viewportListIt->object_type_name_list.erase(foundObjectIt);
73 asr_world_model::GetViewportList::Response &response)
75 const std::string &object_type = request.object_type;
78 if (std::string(
"all") == object_type || std::string(
"") == object_type) {
80 response.viewport_list.push_back(viewport);
84 std::vector<std::string>::iterator foundObjectIt = std::find(viewport.object_type_name_list.begin(), viewport.object_type_name_list.end(), object_type);
85 if (foundObjectIt != viewport.object_type_name_list.end()) {
86 response.viewport_list.push_back(viewport);
96 asr_world_model::FilterViewportDependingOnAlreadyVisitedViewports::Response &response)
100 asr_msgs::AsrViewport filteredViewport = request.viewport;
101 response.isBeenFiltered =
false;
104 if (
pose_helper_ptr_->checkPosesAreApproxEquale(alreadyVisitedViewport.pose, filteredViewport.pose,
107 response.isBeenFiltered =
true;
112 response.filteredViewport = filteredViewport;
118 std::vector<std::string> &objectTypesToFilter = viewport_to_filter.object_type_name_list;
120 for (
const std::string &filter_object_type : filter_viewport.object_type_name_list) {
121 bool isFound =
false;
123 std::vector<std::string>::iterator iter = std::find(objectTypesToFilter.begin(), objectTypesToFilter.end(), filter_object_type);
124 if (iter != objectTypesToFilter.end()) {
125 objectTypesToFilter.erase(iter);
135 for (
const asr_msgs::AsrViewport &viewport : viewport_list) {
142 return strm << *viewport_list_ptr;
SettingsPtr settings_ptr_
bool processEmptyViewportListServiceCall(asr_world_model::EmptyViewportList::Request &request, asr_world_model::EmptyViewportList::Response &response)
Removes the whole next best view viewports from list if request.object_type is set to "all" in the ot...
bool processPushViewportServiceCall(asr_world_model::PushViewport::Request &request, asr_world_model::PushViewport::Response &response)
Pushes a next best view viewport to a list.
std::vector< asr_msgs::AsrViewport > ViewportList
DebugHelperPtr debug_helper_ptr_
static boost::shared_ptr< PoseHelper > getInstance()
void filterObjectTypesOfViewport(asr_msgs::AsrViewport &viewport_to_filter, const asr_msgs::AsrViewport &filter_viewport)
PoseHelperPtr pose_helper_ptr_
static boost::shared_ptr< DebugHelper > getInstance()
bool processGetViewportListServiceCall(asr_world_model::GetViewportList::Request &request, asr_world_model::GetViewportList::Response &response)
Returns the whole list of next best view viewports if request.object_type is set to "all" else just t...
ViewPortHandler(SettingsPtr settings_ptr)
Creates a new instance of the ViewPortHandler.
std::ostream & operator<<(std::ostream &strm, const CompletePatterns &complete_patterns)
bool processFilterViewportDependingOnAlreadyVisitedViewportsVisited(asr_world_model::FilterViewportDependingOnAlreadyVisitedViewports::Request &request, asr_world_model::FilterViewportDependingOnAlreadyVisitedViewports::Response &response)
Filter the objects of the viewport depending on already visited viewports.
#define ROS_INFO_STREAM(args)
std::size_t number_of_all_viewports
ViewportListPtr viewport_list_ptr_