24 #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);
47 double** jacobians)
const override
49 const double yaw = parameters[0][0];
50 const double yawNext = parameters[0][1];
58 if (jacobians ==
nullptr)
62 double* jacobian0 = jacobians[0];
63 if (jacobian0 ==
nullptr)
68 double* jacobian1 = jacobians[1];
69 if (jacobian1 ==
nullptr)
76 jacobian0[0] = weight * periodicDiffJ0.at(1);
77 jacobian0[1] = weight * periodicDiffJ1.at(0);
82 jacobian1[1] = weight * periodicDiffJ1.at(1);
96 yawNext(yawNext), weight(weight)
100 mutable_parameter_block_sizes()->push_back(1);
101 mutable_parameter_block_sizes()->push_back(1);
108 double** jacobians)
const override
110 const double yawPre = parameters[0][0];
111 const double yaw = parameters[0][1];
119 if (jacobians ==
nullptr)
123 double* jacobian0 = jacobians[0];
124 if (jacobian0 ==
nullptr)
129 double* jacobian1 = jacobians[1];
130 if (jacobian1 ==
nullptr)
136 jacobian0[0] = weight * periodicDiffJ0.at(0);
140 jacobian1[0] = weight * periodicDiffJ0.at(1);
141 jacobian1[1] = weight * periodicDiffJ1.at(0);
147 const double yawNext;
155 prior(prior), weight(weight)
162 double** jacobians)
const override
164 const double yaw = parameters[0][0];
170 if (jacobians ==
nullptr)
174 double* jacobian = jacobians[0];
175 if (jacobian ==
nullptr)
181 jacobian[0] = weight * periodicDiffJ.at(1);
196 set_num_residuals(2);
198 mutable_parameter_block_sizes()->push_back(1);
199 mutable_parameter_block_sizes()->push_back(1);
200 mutable_parameter_block_sizes()->push_back(1);
206 double** jacobians)
const override
208 const double yawPrev = parameters[0][0];
209 const double yaw = parameters[0][1];
210 const double yawNext = parameters[0][2];
218 if (jacobians ==
nullptr)
223 double* jacobian0 = jacobians[0];
224 if (jacobian0 ==
nullptr)
229 double* jacobian1 = jacobians[1];
230 if (jacobian1 ==
nullptr)
235 double* jacobian2 = jacobians[2];
236 if (jacobian2 ==
nullptr)
242 jacobian0[0] = weight * periodicDiffJ0.at(0);
246 jacobian1[0] = weight * periodicDiffJ0.at(1);
247 jacobian1[1] = weight * periodicDiffJ1.at(0);
251 jacobian2[1] = weight * periodicDiffJ1.at(1);