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

Looking closer at imu_sensor_controller, the covariance loops (over j, the index of the covariance matrix) all use the index i (the IMU sensor to publish). (Comments are mine.)

// outerloop over the realtime publishers (one per sensor)
for (unsigned i=0; i<realtime_pubs_.size(); i++){
      if (publish_rate_ > 0.0 && last_publish_times_[i] + ros::Duration(1.0/publish_rate_) < time){
        // try to publish
        if (realtime_pubs_[i]->trylock()){
          //...
          // Orientation covariance
          if (sensors_[i].getOrientationCovariance())
          {
            // inner loop over the indices of the covariance
            for (unsigned j=0; j<realtime_pubs_[i]->msg_.orientation_covariance.size(); ++j){
              // all of these are being access by 'i', none are being access by 'j'
              realtime_pubs_[i]->msg_.orientation_covariance[i] = sensors_[i].getOrientationCovariance()[i];
            }
          }