ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
test jdk kjd kjjkd jk
2 | No.2 Revision |
test jdk kjd kjjkd jkFor anyone who is interested I had a look at this, which converts the std_msgs into an Array but this is how the vector is done:
void setdot(const std_msgs::Int32MultiArray::ConstPtr& array){
vector<double> tmp;
for(std::vector<int>::const_iterator it = array->data.begin(); it != array->data.end(); ++it)
{
tmp.push_back( *it);
}
//do sth with tmp ..
}
3 | No.3 Revision |
For anyone who is interested I had a look at this, which converts the std_msgs into an Array but this is how the vector is done:
void setdot(const std_msgs::Int32MultiArray::ConstPtr& array){
vector<double> tmp;
for(std::vector<int>::const_iterator it = array->data.begin(); it != array->data.end(); ++it)
{
tmp.push_back( *it);
}
//do sth with tmp ..
}
Furthermore check if the input message is not empty, which might occur on the first callbacks as it was in my case.
4 | No.4 Revision |
For anyone who is interested I had a look at this, which converts the std_msgs into an Array but this is how the vector is done:
void setdot(const std_msgs::Int32MultiArray::ConstPtr& array){
vector<double> tmp;
for(std::vector<int>::const_iterator it = array->data.begin(); it != array->data.end(); ++it)
{
tmp.push_back( *it);
}
//do sth with tmp ..
}
Furthermore check if the input message is not empty, which might occur on the first callbacks as it was in my case.
Otherwise Segmentation fault (core dumped)
might happen.