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

Revision history [back]

Change this code to:

void ODOM::encoders_sub_callback(sensor_msgs::JointState msg){
    if (msg.velocity.size() < 2) return;

    cout<<"callback"<<endl;
    _wl= msg.velocity[0];
    cout<<_wl<<endl;
    _wr=msg.velocity[1];
    cout<<_wr<<endl;
}

Probably you're entering in this callback with some empty jointstate.