@@ -36,15 +36,16 @@ namespace loik
3636 {
3737 if (nj_ != nb_ + 1 )
3838 {
39- throw (std::runtime_error (" [IkProblemFormulation::IkProblemFormulation]: nb does not equal "
40- " to nj - 1, robot model not supported !!!" ));
39+ throw (std::runtime_error (
40+ " [IkProblemFormulation::IkProblemFormulation]: nb does not equal "
41+ " to nj - 1, robot model not supported !!!" ));
4142 }
4243
4344 if (eq_c_dim != 6 )
4445 {
45- throw (
46- std::runtime_error ( " [IkProblemFormulation::IkProblemFormulation]: equality constraint "
47- " dimension is not 6, problem formulation not supported !!!" ));
46+ throw (std::runtime_error (
47+ " [IkProblemFormulation::IkProblemFormulation]: equality constraint "
48+ " dimension is not 6, problem formulation not supported !!!" ));
4849 }
4950
5051 H_refs_.reserve (static_cast <std::size_t >(nj));
@@ -103,8 +104,9 @@ namespace loik
103104 H_refs.size () != static_cast <std::size_t >(nj_)
104105 || v_refs.size () != static_cast <std::size_t >(nj_))
105106 {
106- throw (std::runtime_error (" [IkProblemFormulation::UpdateReferences]: input arguments "
107- " 'H_refs', 'v_refs' have wrong size!!" ));
107+ throw (std::runtime_error (
108+ " [IkProblemFormulation::UpdateReferences]: input arguments "
109+ " 'H_refs', 'v_refs' have wrong size!!" ));
108110 }
109111 H_refs_ = H_refs;
110112 v_refs_ = v_refs;
@@ -122,8 +124,9 @@ namespace loik
122124 // check constraint specification is consistant
123125 if (!((active_task_constraint_ids.size () == Ais.size ()) && ((Ais.size () == bis.size ()))))
124126 {
125- throw (std::runtime_error (" [IkProblemFormulation::UpdateEqConstraints]: "
126- " task_constraint_ids, Ais, and bis have different size !!!" ));
127+ throw (std::runtime_error (
128+ " [IkProblemFormulation::UpdateEqConstraints]: "
129+ " task_constraint_ids, Ais, and bis have different size !!!" ));
127130 }
128131
129132 // check constraint dimension is consistent between input arguments!
@@ -136,16 +139,18 @@ namespace loik
136139 // check if number of equality constraints has changed
137140 if (active_task_constraint_ids.size () != static_cast <std::size_t >(nc_eq_))
138141 {
139- throw (std::runtime_error (" [IkProblemFormulation::UpdateEqConstraints]: number of equality "
140- " constraints doesn't match initialization!!!" ));
142+ throw (std::runtime_error (
143+ " [IkProblemFormulation::UpdateEqConstraints]: number of equality "
144+ " constraints doesn't match initialization!!!" ));
141145 }
142146
143147 // check if equality constraint dim has changed
144148 if (Ais[0 ].rows () != eq_c_dim_)
145149 {
146150 // TODO: need to check constraint dimension for each Ai and bi, not just the first ones
147- throw (std::runtime_error (" [IkProblemFormulation::UpdateEqConstraints]: equality constraint "
148- " dimension has changed!!! Updating constraint dimension" ));
151+ throw (std::runtime_error (
152+ " [IkProblemFormulation::UpdateEqConstraints]: equality constraint "
153+ " dimension has changed!!! Updating constraint dimension" ));
149154 }
150155
151156 active_task_constraint_ids_ = active_task_constraint_ids;
@@ -167,8 +172,9 @@ namespace loik
167172 // if 'c_id' not present in 'active_task_constraint_ids_', invoke 'AddEqConstraint()'
168173 if (found_it == active_task_constraint_ids_.end ())
169174 {
170- throw (std::runtime_error (" [IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
171- " yet exist at link 'c_id' !!! " ));
175+ throw (std::runtime_error (
176+ " [IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
177+ " yet exist at link 'c_id' !!! " ));
172178 }
173179
174180 // check if constraint dimension is consistent
@@ -185,9 +191,9 @@ namespace loik
185191 // if 'c_id' appear more than once, then something went wrong, throw.
186192 if (c_id_count > 1 )
187193 {
188- throw (
189- std::runtime_error ( " [IkProblemFormulation::UpdateEqConstraint]: multiple constraint "
190- " specification for the same link id, not supported, terminating !!!" ));
194+ throw (std::runtime_error (
195+ " [IkProblemFormulation::UpdateEqConstraint]: multiple constraint "
196+ " specification for the same link id, not supported, terminating !!!" ));
191197 }
192198
193199 // get index of 'c_id' in 'active_task_constraint_ids_'
@@ -212,8 +218,9 @@ namespace loik
212218 // if 'c_id' not present in 'active_task_constraint_ids_', then throw
213219 if (found_it == active_task_constraint_ids_.end ())
214220 {
215- throw (std::runtime_error (" [IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
216- " yet exist at link 'c_id' !!! " ));
221+ throw (std::runtime_error (
222+ " [IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
223+ " yet exist at link 'c_id' !!! " ));
217224 }
218225
219226 // get index of 'c_id' in 'active_task_constraint_ids_'
@@ -244,14 +251,16 @@ namespace loik
244251 // check constraint dimension
245252 if (Ai.rows () != bi.rows ())
246253 {
247- throw (std::runtime_error (" [IkProblemFormulation::AddEqConstraint]: input arguments "
248- " constraint dimension inconsistent !!!" ));
254+ throw (std::runtime_error (
255+ " [IkProblemFormulation::AddEqConstraint]: input arguments "
256+ " constraint dimension inconsistent !!!" ));
249257 }
250258
251259 if (Ai.rows () != static_cast <std::size_t >(eq_c_dim_))
252260 {
253- throw (std::runtime_error (" [IkProblemFormulation::AddEqConstraint]: input constraint "
254- " dimension differ from existing constriant dimension!!!" ));
261+ throw (std::runtime_error (
262+ " [IkProblemFormulation::AddEqConstraint]: input constraint "
263+ " dimension differ from existing constriant dimension!!!" ));
255264 }
256265
257266 active_task_constraint_ids_.push_back (c_id);
@@ -297,16 +306,17 @@ namespace loik
297306 // check arguments have some dimension
298307 if (lb.size () != ub.size ())
299308 {
300- throw (std::runtime_error (" [IkProblemFormulation::UpdateIneqConstraints]: lower bound and "
301- " upper bound have different dimensions!!!" ));
309+ throw (std::runtime_error (
310+ " [IkProblemFormulation::UpdateIneqConstraints]: lower bound and "
311+ " upper bound have different dimensions!!!" ));
302312 }
303313
304314 // check is inequality constraint dimension has changed
305315 if (lb.size () != ineq_c_dim_)
306316 {
307- throw (
308- std::runtime_error ( " IkProblemFormulation::UpdateIneqConstraints]: inequality constraint "
309- " dimension has changed, this is not supported currently!!!" ));
317+ throw (std::runtime_error (
318+ " IkProblemFormulation::UpdateIneqConstraints]: inequality constraint "
319+ " dimension has changed, this is not supported currently!!!" ));
310320 }
311321
312322 lb_ = lb;
@@ -521,8 +531,9 @@ namespace loik
521531 }
522532 else
523533 {
524- throw (std::runtime_error (" [IkProblemStandardQPFormulation::UpdateQPADMMSolveInit]: "
525- " parent id < 0, this can't happen !!!" ));
534+ throw (std::runtime_error (
535+ " [IkProblemStandardQPFormulation::UpdateQPADMMSolveInit]: "
536+ " parent id < 0, this can't happen !!!" ));
526537 }
527538 }
528539
0 commit comments