26 #include <ceres/ceres.h>
35 yawPre(yawPre), weight(weight)
39 mutable_parameter_block_sizes()->push_back(1);
40 mutable_parameter_block_sizes()->push_back(1);
46 double** jacobians)
const override
48 const double yaw = parameters[0][0];
49 const double yawNext = parameters[0][1];
57 if (jacobians ==
nullptr)
61 double* jacobian0 = jacobians[0];
62 if (jacobian0 ==
nullptr)
67 double* jacobian1 = jacobians[1];
68 if (jacobian1 ==
nullptr)
75 jacobian0[0] = weight * periodicDiffJ0.at(1);
76 jacobian0[1] = weight * periodicDiffJ1.at(0);
81 jacobian1[1] = weight * periodicDiffJ1.at(1);
95 yawNext(yawNext), weight(weight)
99 mutable_parameter_block_sizes()->push_back(1);
100 mutable_parameter_block_sizes()->push_back(1);
106 double** jacobians)
const override
108 const double yawPre = parameters[0][0];
109 const double yaw = parameters[0][1];
117 if (jacobians ==
nullptr)
121 double* jacobian0 = jacobians[0];
122 if (jacobian0 ==
nullptr)
127 double* jacobian1 = jacobians[1];
128 if (jacobian1 ==
nullptr)
134 jacobian0[0] = weight * periodicDiffJ0.at(0);
138 jacobian1[0] = weight * periodicDiffJ0.at(1);
139 jacobian1[1] = weight * periodicDiffJ1.at(0);
145 const double yawNext;
153 prior(prior), weight(weight)
160 double** jacobians)
const override
162 const double yaw = parameters[0][0];
168 if (jacobians ==
nullptr)
172 double* jacobian = jacobians[0];
173 if (jacobian ==
nullptr)
179 jacobian[0] = weight * periodicDiffJ.at(1);
193 set_num_residuals(2);
195 mutable_parameter_block_sizes()->push_back(1);
196 mutable_parameter_block_sizes()->push_back(1);
197 mutable_parameter_block_sizes()->push_back(1);
203 double** jacobians)
const override
205 const double yawPrev = parameters[0][0];
206 const double yaw = parameters[0][1];
207 const double yawNext = parameters[0][2];
215 if (jacobians ==
nullptr)
220 double* jacobian0 = jacobians[0];
221 if (jacobian0 ==
nullptr)
226 double* jacobian1 = jacobians[1];
227 if (jacobian1 ==
nullptr)
232 double* jacobian2 = jacobians[2];
233 if (jacobian2 ==
nullptr)
239 jacobian0[0] = weight * periodicDiffJ0.at(0);
243 jacobian1[0] = weight * periodicDiffJ0.at(1);
244 jacobian1[1] = weight * periodicDiffJ1.at(0);
248 jacobian2[1] = weight * periodicDiffJ1.at(1);