ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

test jdk kjd kjjkd jk

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 ..
    }

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.

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.