Skip to content

Commit

Permalink
fix publisher of offset_covariance.
Browse files Browse the repository at this point in the history
  • Loading branch information
td12321 authored and TakaHoribe committed Dec 21, 2022
1 parent 416abbb commit e1a709b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ AccelBrakeMapCalibrator::AccelBrakeMapCalibrator(const rclcpp::NodeOptions & nod
accel_offset_covariance_value_.resize((accel_map_value_.size()));
brake_offset_covariance_value_.resize((brake_map_value_.size()));
for (auto & m : accel_offset_covariance_value_) {
m.resize(accel_map_value_.at(0).size());
m.resize(accel_map_value_.at(0).size(),covariance_);
}
for (auto & m : brake_offset_covariance_value_) {
m.resize(brake_map_value_.at(0).size());
m.resize(brake_map_value_.at(0).size(),covariance_);
}
map_value_data_.resize(accel_map_value_.size() + brake_map_value_.size() - 1);
for (auto & m : map_value_data_) {
Expand Down Expand Up @@ -986,6 +986,7 @@ bool AccelBrakeMapCalibrator::updateFourCellAroundOffset(
offset_covariance_value.at(pedal_index + 1).at(vel_index + 1)=sigma(1);
offset_covariance_value.at(pedal_index + 0).at(vel_index + 0)=sigma(2);
offset_covariance_value.at(pedal_index + 1).at(vel_index + 1)=sigma(3);

return true;
}

Expand Down Expand Up @@ -1440,7 +1441,7 @@ void AccelBrakeMapCalibrator::publishOffsetCovMap(
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
vec[i * w + j] = static_cast<float>(
getMapColumnFromUnifiedIndex(accel_map_value_, brake_map_value_, i).at(j));
getMapColumnFromUnifiedIndex(accel_map_value, brake_map_value, i).at(j));
}
}
float_map.data = vec;
Expand Down

0 comments on commit e1a709b

Please sign in to comment.