Skip to content

Commit fd32d61

Browse files
authored
Merge pull request #12 from Simple-Robotics/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 45c8907 + dc7b569 commit fd32d61

File tree

4 files changed

+85
-63
lines changed

4 files changed

+85
-63
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44
autoupdate_schedule: quarterly
55
repos:
66
- repo: https://github.com/pre-commit/mirrors-clang-format
7-
rev: v19.1.6
7+
rev: v20.1.0
88
hooks:
99
- id: clang-format
1010
types_or: []

include/loik/ik-id-description-optimized.hpp

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ namespace loik
3737
{
3838
if (nj_ != nb_ + 1)
3939
{
40-
throw(std::runtime_error("[IkProblemFormulation::IkProblemFormulation]: nb does not equal "
41-
"to nj - 1, robot model not supported !!!"));
40+
throw(std::runtime_error(
41+
"[IkProblemFormulation::IkProblemFormulation]: nb does not equal "
42+
"to nj - 1, robot model not supported !!!"));
4243
}
4344

4445
if (eq_c_dim != 6)
4546
{
46-
throw(
47-
std::runtime_error("[IkProblemFormulation::IkProblemFormulation]: equality constraint "
48-
"dimension is not 6, problem formulation not supported !!!"));
47+
throw(std::runtime_error(
48+
"[IkProblemFormulation::IkProblemFormulation]: equality constraint "
49+
"dimension is not 6, problem formulation not supported !!!"));
4950
}
5051

5152
H_refs_.reserve(static_cast<std::size_t>(nj));
@@ -112,8 +113,9 @@ namespace loik
112113
H_refs.size() != static_cast<std::size_t>(nj_)
113114
|| v_refs.size() != static_cast<std::size_t>(nj_))
114115
{
115-
throw(std::runtime_error("[IkProblemFormulation::UpdateReferences]: input arguments "
116-
"'H_refs', 'v_refs' have wrong size!!"));
116+
throw(std::runtime_error(
117+
"[IkProblemFormulation::UpdateReferences]: input arguments "
118+
"'H_refs', 'v_refs' have wrong size!!"));
117119
}
118120
H_refs_ = H_refs;
119121
v_refs_ = v_refs;
@@ -144,8 +146,9 @@ namespace loik
144146
// check constraint specification is consistant
145147
if (!((active_task_constraint_ids.size() == Ais.size()) && ((Ais.size() == bis.size()))))
146148
{
147-
throw(std::runtime_error("[IkProblemFormulation::UpdateEqConstraints]: "
148-
"task_constraint_ids, Ais, and bis have different size !!!"));
149+
throw(std::runtime_error(
150+
"[IkProblemFormulation::UpdateEqConstraints]: "
151+
"task_constraint_ids, Ais, and bis have different size !!!"));
149152
}
150153

151154
// check constraint dimension is consistent between input arguments!
@@ -158,16 +161,18 @@ namespace loik
158161
// check if number of equality constraints has changed
159162
if (active_task_constraint_ids.size() != static_cast<std::size_t>(nc_eq_))
160163
{
161-
throw(std::runtime_error("[IkProblemFormulation::UpdateEqConstraints]: number of equality "
162-
"constraints doesn't match initialization!!!"));
164+
throw(std::runtime_error(
165+
"[IkProblemFormulation::UpdateEqConstraints]: number of equality "
166+
"constraints doesn't match initialization!!!"));
163167
}
164168

165169
// check if equality constraint dim has changed
166170
if (Ais[0].rows() != eq_c_dim_)
167171
{
168172
// TODO: need to check constraint dimension for each Ai and bi, not just the first ones
169-
throw(std::runtime_error("[IkProblemFormulation::UpdateEqConstraints]: equality constraint "
170-
"dimension has changed!!! Updating constraint dimension"));
173+
throw(std::runtime_error(
174+
"[IkProblemFormulation::UpdateEqConstraints]: equality constraint "
175+
"dimension has changed!!! Updating constraint dimension"));
171176
}
172177

173178
active_task_constraint_ids_ = active_task_constraint_ids;
@@ -206,8 +211,9 @@ namespace loik
206211
// if 'c_id' not present in 'active_task_constraint_ids_', invoke 'AddEqConstraint()'
207212
if (found_it == active_task_constraint_ids_.end())
208213
{
209-
throw(std::runtime_error("[IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
210-
"yet exist at link 'c_id' !!! "));
214+
throw(std::runtime_error(
215+
"[IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
216+
"yet exist at link 'c_id' !!! "));
211217
}
212218

213219
// check if constraint dimension is consistent
@@ -224,9 +230,9 @@ namespace loik
224230
// if 'c_id' appear more than once, then something went wrong, throw.
225231
if (c_id_count > 1)
226232
{
227-
throw(
228-
std::runtime_error("[IkProblemFormulation::UpdateEqConstraint]: multiple constraint "
229-
"specification for the same link id, not supported, terminating !!!"));
233+
throw(std::runtime_error(
234+
"[IkProblemFormulation::UpdateEqConstraint]: multiple constraint "
235+
"specification for the same link id, not supported, terminating !!!"));
230236
}
231237

232238
// get index of 'c_id' in 'active_task_constraint_ids_'
@@ -261,8 +267,9 @@ namespace loik
261267
// if 'c_id' not present in 'active_task_constraint_ids_', then throw
262268
if (found_it == active_task_constraint_ids_.end())
263269
{
264-
throw(std::runtime_error("[IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
265-
"yet exist at link 'c_id' !!! "));
270+
throw(std::runtime_error(
271+
"[IkProblemFormulation::UpdateEqConstraint]: constraint doesn't "
272+
"yet exist at link 'c_id' !!! "));
266273
}
267274

268275
// get index of 'c_id' in 'active_task_constraint_ids_'
@@ -293,14 +300,16 @@ namespace loik
293300
// check constraint dimension
294301
if (Ai.rows() != bi.rows())
295302
{
296-
throw(std::runtime_error("[IkProblemFormulation::AddEqConstraint]: input arguments "
297-
"constraint dimension inconsistent !!!"));
303+
throw(std::runtime_error(
304+
"[IkProblemFormulation::AddEqConstraint]: input arguments "
305+
"constraint dimension inconsistent !!!"));
298306
}
299307

300308
if (Ai.rows() != static_cast<std::size_t>(eq_c_dim_))
301309
{
302-
throw(std::runtime_error("[IkProblemFormulation::AddEqConstraint]: input constraint "
303-
"dimension differ from existing constriant dimension!!!"));
310+
throw(std::runtime_error(
311+
"[IkProblemFormulation::AddEqConstraint]: input constraint "
312+
"dimension differ from existing constriant dimension!!!"));
304313
}
305314

306315
active_task_constraint_ids_.push_back(c_id);
@@ -370,16 +379,17 @@ namespace loik
370379
// check arguments have some dimension
371380
if (lb.size() != ub.size())
372381
{
373-
throw(std::runtime_error("[IkProblemFormulation::UpdateIneqConstraints]: lower bound and "
374-
"upper bound have different dimensions!!!"));
382+
throw(std::runtime_error(
383+
"[IkProblemFormulation::UpdateIneqConstraints]: lower bound and "
384+
"upper bound have different dimensions!!!"));
375385
}
376386

377387
// check is inequality constraint dimension has changed
378388
if (lb.size() != ineq_c_dim_)
379389
{
380-
throw(
381-
std::runtime_error("IkProblemFormulation::UpdateIneqConstraints]: inequality constraint "
382-
"dimension has changed, this is not supported currently!!!"));
390+
throw(std::runtime_error(
391+
"IkProblemFormulation::UpdateIneqConstraints]: inequality constraint "
392+
"dimension has changed, this is not supported currently!!!"));
383393
}
384394

385395
lb_ = lb;

include/loik/ik-id-description.hpp

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -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

include/loik/loik-loid-optimized.hxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,9 @@ namespace loik
693693
else if (this->mu_update_strat_ == ADMMPenaltyUpdateStrat::MAXEIGENVALUE)
694694
{
695695
// use max eigen value strategy
696-
throw(std::runtime_error("[FirstOrderLoikOptimizedTpl::UpdateMu]: mu update strategy "
697-
"MAXEIGENVALUE not yet implemented"));
696+
throw(std::runtime_error(
697+
"[FirstOrderLoikOptimizedTpl::UpdateMu]: mu update strategy "
698+
"MAXEIGENVALUE not yet implemented"));
698699
}
699700
else
700701
{

0 commit comments

Comments
 (0)