com.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * The University of Tokyo
8  */
9 /*
10  * handle.cpp
11  * Create: Katsu Yamane, 03.07.10
12  */
13 
14 #include "ik.h"
15 
17 {
18  if(n_const == 0) return 0;
19  int n_dof = ik->NumDOF();
20  fMat Jtemp;
21  J.resize(n_const, n_dof);
22  Jtemp.resize(3, n_dof);
23  Jtemp.zero();
24  ik->ComJacobian(Jtemp, cur_com, charname);
25  int i, j, count = 0;
26  for(i=0; i<3; i++)
27  {
29  {
30  for(j=0; j<n_dof; j++)
31  J(count, j) = Jtemp(i, j);
32  count++;
33  }
34  }
35  return 0;
36 }
37 
39 {
40  int i, count = 0;
41  fVec3 dp;
42  dp.sub(des_com, cur_com);
43  dp *= gain;
44  for(i=0; i<3; i++)
45  {
47  {
48  fb(count) = dp(i);
49  count++;
50  }
51  }
52  return 0;
53 }
54 
i
png_uint_32 i
Definition: png.h:2732
fVec3
3-element vector class.
Definition: fMatrix3.h:206
IKConstraint::gain
double gain
priority
Definition: ik.h:396
IKCom::calc_feedback
int calc_feedback()
compute the feedback velocity
Definition: com.cpp:38
IKCom::const_index
IK::ConstIndex const_index[3]
which of three directions (x, y, z) are constrained
Definition: ik.h:703
IKCom::des_com
fVec3 des_com
desired COM position
Definition: ik.h:705
IKConstraint::n_const
int n_const
weight
Definition: ik.h:398
IKConstraint::J
fMat J
Definition: ik.h:402
Chain::NumDOF
int NumDOF()
Total degrees of freedom.
Definition: chain.h:343
IK::HAVE_CONSTRAINT
@ HAVE_CONSTRAINT
with constraint
Definition: ik.h:67
fMat
Matrix of generic size. The elements are stored in a one-dimensional array in row-major order.
Definition: fMatrix.h:46
fMat::resize
int resize(int i, int j)
Changes the matrix size.
Definition: fMatrix.h:133
fMat::zero
void zero()
Creates a zero matrix.
Definition: fMatrix.h:249
IKCom::calc_jacobian
int calc_jacobian()
Computes the constraint Jacobian.
Definition: com.cpp:16
Chain::ComJacobian
double ComJacobian(fMat &J, fVec3 &com, const char *chname=0)
Computes the com Jacobian.
Definition: jacobi.cpp:18
ik.h
Inverse kinematics (UTPoser) class.
fVec3::sub
void sub(const fVec3 &vec1, const fVec3 &vec2)
Definition: fMatrix3.cpp:902
IKCom::cur_com
fVec3 cur_com
current COM position
Definition: ik.h:706
IKCom::charname
char * charname
target character name
Definition: ik.h:704
IKConstraint::ik
IK * ik
Definition: ik.h:390
IKConstraint::fb
fVec fb
Jacobian matrix (n_const x total DOF)
Definition: ik.h:403


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:02