Skip to content

Commit d2c2bec

Browse files
Update orocos_kdl/src/chainiksolvervel_pinv.cpp
formatting Co-authored-by: Matthijs van der Burgh <matthijs.vander.burgh@live.nl>
1 parent 867f30a commit d2c2bec

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

orocos_kdl/src/chainiksolvervel_pinv.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,25 +170,28 @@ namespace KDL
170170

171171
void ChainIkSolverVel_pinv::SortJntArrayMaxToMin(JntArray& Smaxtomin)
172172
{
173-
int n=Smaxtomin.rows();
174-
for (int i=0; i<n; i++){
173+
unsigned int n = Smaxtomin.rows();
174+
for (unsigned int i=0; i<n; ++i)
175+
{
175176
double S_max = Smaxtomin(i);
176-
int i_max = i;
177-
for (int j=i+1; j<n; j++){
177+
unsigned int i_max = i;
178+
for (unsigned int j=i+1; j<n; ++j)
179+
{
178180
double Sj = Smaxtomin(j);
179-
if (Sj > S_max){
181+
if (Sj > S_max)
182+
{
180183
S_max = Sj;
181184
i_max = j;
182185
}
183186
}
184-
if (i_max != i){
187+
if (i_max != i)
188+
{
185189
/* swap eigenvalues */
186190
double tmp = Smaxtomin(i);
187-
Smaxtomin(i)=Smaxtomin(i_max);
188-
Smaxtomin(i_max)=tmp;
191+
Smaxtomin(i) =Smaxtomin(i_max);
192+
Smaxtomin(i_max) = tmp;
189193
}
190194
}
191-
return;
192195
}
193196

194197
const char* ChainIkSolverVel_pinv::strError(const int error) const

0 commit comments

Comments
 (0)