Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing mx_reduced by creating "biorbd wrapper" #881

Merged
merged 109 commits into from
Nov 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
26b9e0b
initial thoughts
EveCharbie Jun 21, 2024
a05e823
made the changes to the biorbd_model
EveCharbie Jun 21, 2024
f24034e
just adding todos
pariterre Sep 23, 2024
c8b1752
removed some MX
EveCharbie Sep 18, 2024
ad48e26
some more
EveCharbie Sep 19, 2024
c63ca11
typos
EveCharbie Sep 19, 2024
21bc253
self.external_forces, -translational_forces, protocol
EveCharbie Sep 19, 2024
8b9cc78
fixed some tests
EveCharbie Sep 19, 2024
14020d4
JCS
EveCharbie Sep 19, 2024
f638af0
blacked
EveCharbie Sep 19, 2024
420d5d1
fixed some dynamics
EveCharbie Sep 20, 2024
55ee414
test_dynamics
EveCharbie Sep 20, 2024
7952c05
blacked
EveCharbie Sep 20, 2024
e62002c
multi_model
EveCharbie Sep 20, 2024
f36058c
fixed parameters
EveCharbie Sep 20, 2024
b1edf72
youpsi
EveCharbie Sep 20, 2024
04ac46c
blacked
EveCharbie Sep 20, 2024
c022af5
rocking those parameters!
EveCharbie Sep 21, 2024
55e8983
blacked
EveCharbie Sep 21, 2024
7eefd9b
removed .mx from optimization_variables (seems to work)
EveCharbie Sep 21, 2024
d58bf8f
time consuming time parameter --'
EveCharbie Sep 21, 2024
5e5e551
blacked
EveCharbie Sep 21, 2024
5656f86
woups
EveCharbie Sep 23, 2024
b4d7185
tests start to look good
EveCharbie Sep 23, 2024
9d7e8d3
blacked
EveCharbie Sep 23, 2024
dd18390
SOCP tests
EveCharbie Sep 23, 2024
bfdb781
completely removed mx
EveCharbie Sep 23, 2024
c78098e
blacked
EveCharbie Sep 23, 2024
f275729
ok
EveCharbie Sep 23, 2024
133dd74
made requested changes except f_ext
EveCharbie Sep 23, 2024
80cdbee
blacked
EveCharbie Sep 23, 2024
9d40d5c
Added a TODO
pariterre Sep 25, 2024
e05d6d5
translational_forces and muscles
EveCharbie Sep 26, 2024
7eae07a
consequences for being lazy ))))))))
EveCharbie Sep 26, 2024
72c6cfc
Fixed tests (few remaining)
EveCharbie Sep 27, 2024
073cdf3
blacked
EveCharbie Sep 27, 2024
7673fa0
named the in and out in Function
EveCharbie Sep 27, 2024
4e1c11a
Fixed the last tests I could
EveCharbie Sep 27, 2024
00deadf
with pariterre
EveCharbie Oct 1, 2024
ea8ffb2
Started to move towards translations
pariterre Oct 1, 2024
0fd6336
continued + removed self.translation...
EveCharbie Oct 5, 2024
c56e79c
fixed dynamics except DAE_INVERSE
EveCharbie Oct 5, 2024
8f720e4
blacked
EveCharbie Oct 5, 2024
91bc961
fixed the alg_states missing tests
EveCharbie Oct 7, 2024
07e8b6e
fixed some tests
EveCharbie Oct 7, 2024
dcb89cb
temporary commit for ipuch
EveCharbie Oct 11, 2024
7d7f7c9
fixed holonomic (@ipuch, could you please check carefully this commit?)
EveCharbie Oct 23, 2024
80a9829
first idea of an external_force interface
EveCharbie Oct 23, 2024
a7f5583
test external forces work
EveCharbie Oct 24, 2024
e49f1d5
added tests
EveCharbie Oct 24, 2024
7fd0713
blacked
EveCharbie Oct 24, 2024
113ad54
removed DAE (RigidBodyDynamics)
EveCharbie Oct 24, 2024
4ee879c
fixed external_forces in tests/examples
EveCharbie Oct 24, 2024
ef9638d
blacked
EveCharbie Oct 24, 2024
84f5287
gitignore
EveCharbie Oct 24, 2024
39c21bc
shard 1 (-acados, -vector_orientation)
EveCharbie Oct 24, 2024
e9b7afd
shard 3 (changed values because implicit)
EveCharbie Oct 24, 2024
0570dc8
shard 4 (-soft contacts)
EveCharbie Oct 24, 2024
fc2f800
shard 6 (removing explicit formulation)
EveCharbie Oct 24, 2024
02a7066
blacked
EveCharbie Oct 24, 2024
ed23461
forgot to remove implicit
EveCharbie Oct 24, 2024
1517dbe
some changes requested by ipuch
EveCharbie Oct 28, 2024
978c2d2
blacked
EveCharbie Oct 28, 2024
fb25101
Holonomic ok
EveCharbie Oct 29, 2024
d71cb9a
important typo
EveCharbie Oct 29, 2024
46ee47f
blacked
EveCharbie Oct 29, 2024
8bb744b
fixed some tests
EveCharbie Oct 29, 2024
f145d20
deg fix
EveCharbie Oct 29, 2024
687c0e2
deleted track_vector_orientation
EveCharbie Oct 29, 2024
2317196
removed commented lines
EveCharbie Oct 29, 2024
12a35d8
comment
EveCharbie Oct 29, 2024
5a3fcf5
blacked
EveCharbie Oct 29, 2024
e1ba6c6
made changes requested by pariterre
EveCharbie Oct 30, 2024
d052ac8
fixed the symbolic problem
EveCharbie Oct 30, 2024
2f42904
blacked
EveCharbie Oct 30, 2024
ac9a691
first example external_force rolls
Ipuch Oct 30, 2024
b771b59
refactor : more tests to pass
Ipuch Oct 30, 2024
d65c63a
fix: model external force set
Ipuch Oct 30, 2024
d1ab3c3
early tests changes not there yet
Ipuch Oct 30, 2024
d699a84
made changes requested by pariterre
EveCharbie Oct 30, 2024
dc3b4cc
fixed the symbolic problem
EveCharbie Oct 30, 2024
31c9e17
blacked
EveCharbie Oct 30, 2024
207d9d4
fix: multiple force
Ipuch Oct 30, 2024
36729ba
docs
Ipuch Oct 30, 2024
651f2d3
tests: failed but rolled
Ipuch Oct 30, 2024
bd2ea77
fix: segmentation faults, but rolling on a complete test
Ipuch Oct 31, 2024
9d320bc
tests : extra_test for the class itself
Ipuch Oct 31, 2024
3efdc48
retrieve the force mx otherwise, sothiing is applied.
Ipuch Oct 31, 2024
cd2ca84
test: delete test but not values
Ipuch Oct 31, 2024
cdf22eb
tests : no working yet
Ipuch Oct 31, 2024
9d51c88
fix: for sure
Ipuch Oct 31, 2024
7676f72
fix:
Ipuch Oct 31, 2024
6780f0c
clean: polish exemple
Ipuch Oct 31, 2024
7e4a91a
fix: see you tomorrow
Ipuch Oct 31, 2024
41f17b5
test together are separate does the same.
Ipuch Nov 1, 2024
2fc1928
docs and fix: point application in local
Ipuch Nov 1, 2024
d2edb7f
tests: make them all pass !
Ipuch Nov 1, 2024
0313d4a
clean and fix
Ipuch Nov 1, 2024
1d75f71
feat: marker assignement works fine
Ipuch Nov 1, 2024
5785807
refactor: force_dispatch
Ipuch Nov 1, 2024
79cfcb8
refactor: spring mass
Ipuch Nov 1, 2024
49969a3
refactor: slight displacing variable in a method
Ipuch Nov 1, 2024
9091a67
Merge branch 'removing_mx_reduced' into charbiebranch
Ipuch Nov 1, 2024
7812c0a
Auto stash before checking out "HEAD"
Ipuch Nov 1, 2024
bb1dfe7
refactor: example
Ipuch Nov 1, 2024
f429573
docs: viewer tracked markers
Ipuch Nov 5, 2024
959c700
clean: dead comment
Ipuch Nov 8, 2024
0064c2a
refactor: defects = None root dynamics
Ipuch Nov 8, 2024
1cdaf8e
refactor: -= instead of +=-
Ipuch Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs and fix: point application in local
Ipuch committed Nov 1, 2024
commit 2fc1928897256a39ea5319be2475882baa20442c
3 changes: 3 additions & 0 deletions bioptim/models/biorbd/biorbd_model.py
Original file line number Diff line number Diff line change
@@ -524,6 +524,9 @@ def forward_dynamics(self, with_contact: bool = False) -> Function:

def inverse_dynamics(self, with_contact: bool = False) -> Function:

if with_contact:
raise NotImplementedError("Inverse dynamics with contact is not implemented yet")

q_biorbd = GeneralizedCoordinates(self.q)
qdot_biorbd = GeneralizedVelocity(self.qdot)
qddot_biorbd = GeneralizedAcceleration(self.qddot)
16 changes: 14 additions & 2 deletions bioptim/models/biorbd/external_forces.py
Original file line number Diff line number Diff line change
@@ -102,15 +102,27 @@ def add_translational_force(
def add_in_segment_frame(
self, segment: str, values: np.ndarray, point_of_application_in_local: np.ndarray | str = None
):
"""
Add external forces in the segment frame.

Parameters
----------
segment: str
The name of the segment.
values: np.ndarray
The external forces (torques, forces) in the segment frame.
point_of_application_in_local
The point of application of the external forces in the segment frame.
"""
self._check_if_can_be_modified()
if values.shape[0] != 6:
raise ValueError(f"External forces must have 6 rows, got {values.shape[0]}")
self._check_values_frame_shape(values)

point_of_application = (
point_of_application_in_local = (
np.zeros((3, self._nb_frames)) if point_of_application_in_local is None else point_of_application_in_local
)
self._check_point_of_application(point_of_application)
self._check_point_of_application(point_of_application_in_local)
self.in_local = ensure_list(self.in_local, segment)
self.in_local[segment].append({"values": values, "point_of_application": point_of_application_in_local})