how to use std::find to search an element in the PoseStamped x and y.
I am working with ros kinetic to check if my poseStamped messages has an element which passed on from a function
double gothrough(int in, int j ){
std::vector<geometry_msgs::PoseStamped> gothro;
std::vector<geometry_msgs::PoseStamped> new_x;
std::vector<geometry_msgs::PoseStamped> new_y;
new_x.push_back(gothrough_x); // where gothrough_x is the posestamped messages from the callback subscriber
new_y.push_back(gothrough_y); // where gothrough_y is the posestamped messages from the callback subscriber
int i =0;
for(std::vector<int>::iterator it =new_x.begin(); it !=new_x.end(); it++){
gothro.push_back(*it);
}
for(int i =0; i < gothro.size(); i++ )
{
std::find(std::begin(gothro), std::end(gothro), in); // **I am trying to find if the element In is present in the gothrough_x but i am getting error at this line std:find, it would be grateful if someone help me out on this**
}
}
This is more a C++ question. You could probably use
std::find_if(..)
and write a lambda that compares ageometry_msgs/PoseStamped
toin
in a meaningful way.