in ctrl_pkg/src/ctrl_node.cpp [311:329]
void getCarCalHdl(const std::shared_ptr<rmw_request_id_t> request_header,
std::shared_ptr<deepracer_interfaces_pkg::srv::GetCalibrationSrv::Request> req,
std::shared_ptr<deepracer_interfaces_pkg::srv::GetCalibrationSrv::Response> res) {
(void)request_header;
std::vector<int> cal;
if (activeState_ == stateList_.end()) {
RCLCPP_ERROR(this->get_logger(), "No active state");
return;
}
activeState_->second->getCalibration(req->cal_type, cal);
if (cal.size() != ServoCalType::total) {
RCLCPP_ERROR(this->get_logger(), "Failed to retrieve calibrations");
return ;
}
res->max = cal[ServoCalType::max];
res->mid = cal[ServoCalType::mid];
res->min = cal[ServoCalType::min];
res->polarity = cal[ServoCalType::polarity];
}