23 nextCameraPosePtr(), nextRobotPosePtr(), nextPtuPtr(), nextFilteredSearchedObjectTypesAndIds(), remainingPosesDistances(0.0),
24 isSameRobotPoseAsBefore(false), isRobotPoseChanged(true), isNoPoseLeft(false), arePosesFromDemonstrationLeft(false), poseHelperPtr(
PoseHelper::getInstance()) {
47 ROS_INFO(
"Get next robot state called, when no poses were left");
58 ROS_ERROR(
"It is not allowed to have a robot_pose with no PTU config left!");
71 ROS_INFO(
"Get next robot state called, when only one PTU tuple was left");
83 ROS_INFO(
"Get next robot state called, when more than one PTU tuple was left");
93 const geometry_msgs::Pose &robotPose =
poseHelperPtr->getCurrentRobotPose();
96 double loop_distance =
poseHelperPtr->calculateDistance(robotPose, *it->get()->getRobotPosePtr());
97 if (loop_distance < distance) {
98 distance = loop_distance;
103 ROS_INFO(
"Poses to explore have been reordered.");
105 buffer_vectorPtr->insert(buffer_vectorPtr->end(),saved_it,
posesToExplorePtr->end());
106 buffer_vectorPtr->insert(buffer_vectorPtr->end(),
posesToExplorePtr->begin(), saved_it);
127 for (
const std::string &filter_searched_object_type : filter_searched_object_types) {
128 bool isFound =
false;
130 SearchedObjectTypes::iterator iter = std::find(searched_object_types_to_filter.begin(), searched_object_types_to_filter.end(), filter_searched_object_type);
131 if (iter != searched_object_types_to_filter.end()) {
132 searched_object_types_to_filter.erase(iter);
142 for (
const std::string &filter_searched_object_type : filter_searched_object_types) {
143 SearchedObjectTypesAndIds::iterator searched_object_type_and_id_to_filter_iter = searched_object_types_and_ids_to_filter.begin();
144 while (searched_object_type_and_id_to_filter_iter != searched_object_types_and_ids_to_filter.end()) {
145 if (searched_object_type_and_id_to_filter_iter->type == filter_searched_object_type) {
146 searched_object_type_and_id_to_filter_iter = searched_object_types_and_ids_to_filter.erase(searched_object_type_and_id_to_filter_iter);
148 ++searched_object_type_and_id_to_filter_iter;
160 std::sort(copySearchecObjectTypes1.begin(), copySearchecObjectTypes1.end());
161 std::sort(copySearchecObjectTypes2.begin(), copySearchecObjectTypes2.end());
163 std::set_intersection(copySearchecObjectTypes1.begin(), copySearchecObjectTypes1.end(),
164 copySearchecObjectTypes2.begin(), copySearchecObjectTypes2.end(),
165 std::back_inserter(resultSearchedObjectTypes));
167 return resultSearchedObjectTypes;
173 checkParameterFromOtherNode<std::string>(nh,
"rp_ism_node",
"dbfilename");
175 checkParameterFromOtherNode<double>(nh,
"asr_flir_ptu_driver",
"pan_min_angle");
176 checkParameterFromOtherNode<double>(nh,
"asr_flir_ptu_driver",
"pan_max_angle");
177 checkParameterFromOtherNode<double>(nh,
"asr_flir_ptu_driver",
"tilt_min_angle");
178 checkParameterFromOtherNode<double>(nh,
"asr_flir_ptu_driver",
"tilt_max_angle");
181 template <
typename T>
183 std::string full_name =
"/" + node_name +
"/" + param_name;
virtual bool getNextRobotState(const SearchedObjectTypesAndIds &searchedObjectTypesAndIds)
void filterSearchedObjectTypes(SearchedObjectTypes &searched_object_types_to_filter, const SearchedObjectTypes &filter_searched_object_types)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
bool arePosesFromDemonstrationLeft
void checkParametersFromOtherNode()
virtual ~DirectSearchHandler()
virtual bool backToInitial(const SearchedObjectTypesAndIds &searchedObjectTypesAndIds)
boost::shared_ptr< RobotStatePtrVec > RobotStatePtrVecPtr
bool isSameRobotPoseAsBefore
PoseHelperPtr poseHelperPtr
std::vector< std::string > SearchedObjectTypes
ROSCPP_DECL const std::string & getName()
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
void calculateRemainingPosesDistances()
void checkParameterFromOtherNode(ros::NodeHandle &nh, const std::string &node_name, const std::string ¶m_name)
static void resetInstance()
std::vector< asr_msgs::AsrTypeAndId > SearchedObjectTypesAndIds
double remainingPosesDistances
void filterSearchedObjectTypesAndIds(SearchedObjectTypesAndIds &searched_object_types_and_ids_to_filter, const SearchedObjectTypes &filter_searched_object_types)
SearchedObjectTypesAndIds nextFilteredSearchedObjectTypesAndIds
RobotStatePtrVecPtr posesToExplorePtr
std::vector< RobotStatePtr > RobotStatePtrVec
virtual bool resetHandler()
#define ROS_INFO_STREAM(args)
bool getParam(const std::string &key, std::string &s) const
bool hasParam(const std::string &key) const
PosePtr nextCameraPosePtr
SearchedObjectTypes getIntersectionOfSearchObjectTypes(const SearchedObjectTypes &first_searched_object_types, const SearchedObjectTypes &second_searched_object_types)
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const