Skip to content

Commit 4a48866

Browse files
authored
Merge pull request #349 from pariterre/master
Added bunch of accessor so Casadi is not so slow!
2 parents 474a155 + 1e19411 commit 4a48866

32 files changed

+1733
-923
lines changed

binding/python3/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
44
else()
55
project(${BIORBD_NAME})
66
endif()
7+
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27")
8+
cmake_policy(SET CMP0148 OLD)
9+
endif()
710

811
# Windows needs a bigobj option
912
if(MSVC)

include/InternalForces/Geometry.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,36 +62,38 @@ class BIORBD_API Geometry
6262

6363
///
6464
/// \brief Updates the position and dynamic elements of the muscles.
65-
/// \param model The joint model
65+
/// \param updatedModel The joint model updated to the proper kinematics level
6666
/// \param Q The generalized coordinates of the joints (not needed if updateKin is less than 2)
6767
/// \param Qdot The generalized velocities of the joints (not needed if updateKin is less than 2)
68-
/// \param updateKin Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])
6968
///
7069
/// updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot
70+
///
71+
/// WARNING If one used updateKinematics providing the jacobian, using updateKinematics overrides
72+
/// this previously sent position and jacobian
7173
///
7274
void updateKinematics(
73-
rigidbody::Joints &model,
75+
rigidbody::Joints &updatedModel,
7476
const rigidbody::GeneralizedCoordinates* Q = nullptr,
75-
const rigidbody::GeneralizedVelocity* Qdot = nullptr,
76-
int updateKin = 2);
77+
const rigidbody::GeneralizedVelocity* Qdot = nullptr);
7778

7879
///
7980
/// \brief Updates the position and dynamic elements of the muscles.
80-
/// \param model The joint model
81+
/// \param updatedModel The joint model updated to the proper kinematics level
8182
/// \param characteristics The muscle characteristics
8283
/// \param pathModifiers The path modifiers
8384
/// \param Q The generalized coordinates of the joints (not needed if updateKin is less than 2)
8485
/// \param Qdot The generalized velocities of the joints (not needed if updateKin is less than 2)
85-
/// \param updateKin Update kinematics (0: don't update, 1:only muscles, [2: both kinematics and muscles])
8686
///
8787
/// updateKinematics MUST be called before retreiving data that are dependent on Q and/or Qdot
88+
///
89+
/// WARNING If one used updateKinematics providing the jacobian, using updateKinematics overrides
90+
/// this previously sent position and jacobian
8891
///
8992
void updateKinematics(
90-
rigidbody::Joints &model,
93+
rigidbody::Joints &updatedModel,
9194
internal_forces::PathModifiers& pathModifiers,
9295
const rigidbody::GeneralizedCoordinates* Q = nullptr,
93-
const rigidbody::GeneralizedVelocity* Qdot = nullptr,
94-
int updateKin = 2);
96+
const rigidbody::GeneralizedVelocity* Qdot = nullptr);
9597

9698
///
9799
/// \brief Updates the position and dynamic elements of the muscles by hand.

include/InternalForces/Ligaments/Ligament.h

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -90,53 +90,49 @@ class BIORBD_API Ligament : public Compound
9090

9191
///
9292
/// \brief Get the length of the ligament
93-
/// \param model The joint model
93+
/// \param updatedModel The joint model updated to the proper kinematic level
9494
/// \param Q The generalized coordinates
95-
/// \param updateKin Update kinematics (0: don't update, 1:only ligaments, [2: both kinematics and ligaments])
95+
/// \param updateLigamentKinematics If the kinematic parameters of the ligament should be updated
9696
/// \return The length of the ligament
9797
///
9898
const utils::Scalar& length(
99-
rigidbody::Joints& model,
99+
rigidbody::Joints& updatedModel,
100100
const rigidbody::GeneralizedCoordinates& Q,
101-
int updateKin = 2);
101+
bool updateLigamentKinematics = true);
102102

103103
///
104104
/// \brief Return the velocity of the ligament
105-
/// \param model The joint model
105+
/// \param updatedModel The joint model
106106
/// \param Q The generalized coordinates
107107
/// \param Qdot The generalized velocities
108-
/// \param updateKin Update kinematics (0: don't update, 1:only ligaments, [2: both kinematics and ligaments])
108+
/// \param updateLigamentKinematics If the kinematic parameters of the ligament should be updated
109109
//// \return The velocity of the ligament
110110
///
111111
const utils::Scalar& velocity(
112-
rigidbody::Joints& model,
112+
rigidbody::Joints& updatedModel,
113113
const rigidbody::GeneralizedCoordinates& Q,
114114
const rigidbody::GeneralizedVelocity& Qdot,
115-
bool updateKin = true);
115+
bool updateLigamentKinematics = true);
116116

117117
///
118118
/// \brief Update the position of the origin and insertion positions of the ligament
119-
/// \param model The joint model
119+
/// \param updatedModel The joint model updated to the proper kinematic level
120120
/// \param Q The generalized coordinates
121-
/// \param updateKin Update kinematics (0: don't update, 1:only ligaments, [2: both kinematics and ligaments])
122121
///
123122
void updateOrientations(
124-
rigidbody::Joints &model,
125-
const rigidbody::GeneralizedCoordinates &Q,
126-
int updateKin = 2);
123+
rigidbody::Joints &updatedModel,
124+
const rigidbody::GeneralizedCoordinates &Q);
127125

128126
///
129127
/// \brief Update the position of the origin and insertion nodes of the ligament
130-
/// \param model The joint model
128+
/// \param updatedModel The joint model updated to the proper kinematic level
131129
/// \param Q The generalized coordinates
132130
/// \param Qdot The generalized velocities
133-
/// \param updateKin Update kinematics (0: don't update, 1:only ligaments, [2: both kinematics and ligaments])
134131
///
135132
void updateOrientations(
136-
rigidbody::Joints &model,
133+
rigidbody::Joints &updatedModel,
137134
const rigidbody::GeneralizedCoordinates &Q,
138-
const rigidbody::GeneralizedVelocity &Qdot,
139-
int updateKin = 2);
135+
const rigidbody::GeneralizedVelocity &Qdot);
140136

141137
///
142138
/// \brief Update by hand the position of the origin and insertion nodes of the ligament
@@ -186,13 +182,15 @@ class BIORBD_API Ligament : public Compound
186182

187183
///
188184
/// \brief Return the ligament points in global reference frame
189-
/// \param model The joint model
185+
/// \param updatedModel The joint model updated to the proper kinematic level
190186
/// \param Q The generalized coordinates
187+
/// \param updateLigamentKinematics If the kinematic parameters of the ligament should be updated
191188
/// \return The ligament points in global reference frame
192189
///
193190
const std::vector<utils::Vector3d>& ligamentsPointsInGlobal(
194-
rigidbody::Joints &model,
195-
const rigidbody::GeneralizedCoordinates &Q);
191+
rigidbody::Joints &updatedModel,
192+
const rigidbody::GeneralizedCoordinates &Q,
193+
bool updateLigamentKinematics = true);
196194

197195
///
198196
/// \brief Return the previously computed ligament points in global reference frame
@@ -202,29 +200,29 @@ class BIORBD_API Ligament : public Compound
202200

203201
///
204202
/// \brief Return the computed force norm
205-
/// \param model The joints model
203+
/// \param updatedModel The joints model
206204
/// \param Q The generalized coordinates of the model
207205
/// \param Qdot The generalized velocities of the model
208-
/// \param updateKin Update kinematics (0: don't update, 1:only ligaments, [2: both kinematics and ligaments])
206+
/// \param updateLigamentKinematics If the kinematic parameters of the ligament should be updated
209207
/// \return The computed force
210208
///
211209
virtual const utils::Scalar& force(
212-
rigidbody::Joints& model,
210+
rigidbody::Joints& updatedModel,
213211
const rigidbody::GeneralizedCoordinates& Q,
214212
const rigidbody::GeneralizedVelocity& Qdot,
215-
int updateKin = 2);
213+
bool updateLigamentKinematics = true);
216214

217215
///
218216
/// \brief Return the computed force norm
219-
/// \param model The joints model
217+
/// \param updatedModel The joint model updated to the proper kinematic level
220218
/// \param Q The generalized coordinates of the model
221-
/// \param updateKin Update kinematics (0: don't update, 1:only ligaments, [2: both kinematics and ligaments])
219+
/// \param updateLigamentKinematics If the kinematic parameters of the ligament should be updated
222220
/// \return The computed force
223221
///
224222
virtual const utils::Scalar& force(
225-
rigidbody::Joints& model,
223+
rigidbody::Joints& updatedModel,
226224
const rigidbody::GeneralizedCoordinates& Q,
227-
int updateKin = 2);
225+
bool updateLigamentKinematics = true);
228226

229227
///
230228
/// \brief Return the computed force norm. The ligament orientation had to be computed before calling this function.

0 commit comments

Comments
 (0)