-
Notifications
You must be signed in to change notification settings - Fork 7
Add Inverse dynamics class using TSID #68
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
Merged
Changes from all commits
Commits
Show all changes
134 commits
Select commit
Hold shift + click to select a range
a74aa8e
Remove deprecated qp solvers
EtienneAr 3be8eb2
Copy paste TSID implementation from go2_mpc-experiments
EtienneAr f1f7395
Move ID setting in nested class
EtienneAr aced2a6
Remove un-necessary members of ID
EtienneAr 99248f9
Minor change to remove hardcoded base name from go2
EtienneAr 7d2c35a
WiP: write ID test
EtienneAr 7da7d87
Test ID posture task
EtienneAr 1822f56
Enable base task
EtienneAr 71c6cbf
WiP: properly add foot contacts in tsid
EtienneAr 2d8dfd3
Add contacts and base costs
EtienneAr 8ab667a
Properly compute dry run data in ID
EtienneAr b96ddeb
Contact now equality constraint and not cost
EtienneAr 50ff095
Contact position computed with measured data, not target
EtienneAr 99808ba
Add tsid to package xml
EtienneAr 2072499
Minor test changes
EtienneAr 7836cca
Do not add tasks if weight is LE than 0.
EtienneAr 4ce49aa
Write ID contact test
EtienneAr 2ee11a9
Make contact task cost not constraint
EtienneAr 23fa376
Roughly tune contact weight in test
EtienneAr 81037cb
Port contact tunning in default settings
EtienneAr 7a3cc32
Skip first point in all tasks test
EtienneAr cd8cd5e
FIX QUATERNION CONVENTION for target state
EtienneAr 70c7633
Make propper q_start for ID tests
EtienneAr 57df367
Adjust default ID tuning and adjust tests
EtienneAr 397d10d
Fix test all tasks
EtienneAr f5d9bdd
Remove default values for ID gain and weights
EtienneAr e409e99
Add baseTask test
EtienneAr 8a73a0d
Add Pos Vel joint bounds
EtienneAr b221d1f
Add actuation limit task
EtienneAr 535ce08
Add test on ID limits
EtienneAr 14b6f9a
Test solver convergence with assert
EtienneAr 4d1f730
Minor change on velocity limits check
EtienneAr 68dc872
Fix joint limit test on tau
EtienneAr 33a1cdd
Remove pose_base_ member
EtienneAr 6832a1b
Propper use of tail and head for static size slices
EtienneAr 1e7d294
Use data handler to compute base pose
EtienneAr 38cd655
Use Eigen::Ref
EtienneAr a5b88cc
Split hpp and cpp thanks to eigen::ref
EtienneAr d737d79
Better type for f_target: using matrix N, 3 instead of flattened vect…
EtienneAr a86969c
ContactForce as matrix propagated in the mpc
EtienneAr 01b63f7
Bind getBaseFrameName in robot handler
EtienneAr c4448db
Bind retro-compatible version of updateInternalData in datahandler
EtienneAr 73dc091
Remove expose IDSolver that was deleted
EtienneAr f915d5d
Bind get[Ref]FootPose[ByName]
EtienneAr 2349903
Fix test getContactForces
EtienneAr bdb0f98
Expose inverse dynamics in bindings
EtienneAr 8354e63
Bind KinodynamicsIDSettings member var
EtienneAr 030b339
Bind getAccelerations
EtienneAr 4489a10
Remove qp from python examples
edantec f9e7997
Use kinoID class is go2_kino example
EtienneAr 425472b
Update kinodynamics examples
EtienneAr b3e583a
Add 6D foot in model handler
EtienneAr 5d1ce4a
Rename 6D foot into Quad
EtienneAr d6ebfb9
TargetContactForce now a list of vector instead of matrices
EtienneAr 1093b70
Add QuadFoot test on talos
EtienneAr d933260
Contact motion task can be set as equality from user
EtienneAr 793adba
Fix 6D foot contact point error
EtienneAr 2008767
Add tsid in pixi dependencies
EtienneAr ab1494e
Add tsid to readme
EtienneAr 3827939
Update lockfile
EtienneAr afd614d
FIX PACKAGE.XML FOR COLCON git add -p!
EtienneAr 962a2ad
Factorize tests
EtienneAr 0418e68
Minor change
EtienneAr 667dcc8
Fix test class
EtienneAr cbe8c03
Reduce posture task test length
EtienneAr f1b5346
Convert all test to new 'framework'
EtienneAr ea1b7f1
DataHandler fk using vel
EtienneAr 89b411d
6DFoot to QuadFoot
EtienneAr 145732f
Mega clean : RobotHandlers only deals with foot nb, names only used t…
EtienneAr ac5918e
Properly test contacts
EtienneAr 9d552e2
Remove print and useless code in tests
EtienneAr 765065f
Minor fix in contact tests
EtienneAr 422ec2e
Fix all tasks tests
EtienneAr 123ae2b
Minor fix go2 kino excample : change of api
EtienneAr bb7b21c
Move ID to separate folder
EtienneAr ed9f7ed
Use getFoobNb instead of calling size on various array
EtienneAr 9f01f91
Remove deprecated test
EtienneAr acd39ce
Add minor comments in KinoID
EtienneAr 758c3b5
Add assert on contact forces size
EtienneAr 8fae3cf
Find src reccursively
EtienneAr 5b02757
Minor changes in kinodynamics
EtienneAr c7cc3b4
Stop tracking pycache
EtienneAr 893aad4
Add centroidal ID class
EtienneAr 93bd597
Bond centroidal ID
EtienneAr 25b75f1
Update talos example
EtienneAr b234747
Forgot changes ?
EtienneAr 806c1a9
Initialize feet_tracked vector of bool properly
EtienneAr 7b27c34
Desembiguate binding proxy for kino and centroidal
EtienneAr e5527f8
Minor fix in centroidal example
EtienneAr 98acfac
Fixes in centroidal
EtienneAr b201f2c
Default set target run in centroidal constructor
EtienneAr f8f8afc
Bind missing member of KinodynamicsID::Settings contact_motion_equality
EtienneAr b38fedb
Fix getAccelerations
EtienneAr 30bd6fb
Set baseTask mask properly for centroidal
EtienneAr 912f3f0
Minor cleaning
EtienneAr 746d709
Minor update of default ID parameters
EtienneAr 6aab3e1
Add ID test in cmakelists
EtienneAr 662fb8b
Minor tuning in talos kino example
EtienneAr c27cacf
Homogenize centroidal and kino talos examples
EtienneAr 2059fab
Set of gains that works for STATIC centroidal
EtienneAr 092858d
Minor fix in talos centroidal example but overall still not working
EtienneAr d4aec23
copy paste kino test to centroidal
EtienneAr 5d3d789
remove easy initilization of ID Settings and make centroidal test com…
EtienneAr e161e2b
Make centroidal contact point tests pass by adding small com cost (to…
EtienneAr 489f4fb
Make centroidal baseTask test pass by adding small com task (to compe…
EtienneAr e364e33
Improve base orientation task test in centroidalID
EtienneAr 9b72b70
remove useless task in centroidal baseTask test
EtienneAr 756e40e
Add test on centroidalID com task
EtienneAr 3a04d4d
Add centroidal foot tracking test
EtienneAr 66b9301
Make setReferenceFootPlacement use foot index instead of name for coh…
EtienneAr d277faf
Fix benchmark compilation
EtienneAr 5677470
Rename parent frame ref for foot placement
EtienneAr 354c585
Fix default reference foot frame placement
EtienneAr 2e488fb
No need to set foot ref placement in examples & test, default one suf…
EtienneAr 05d0689
Use getFeetNb instead of doing len() by hand
EtienneAr 0982a50
Compatility with pinocchio 3
EtienneAr 4ba2990
Update tsid to have fix and proxqp flag by default
EtienneAr 1eb20ff
Use tsid latest build to actually have proxqp
EtienneAr d44dd93
Add TSID in conda deps
EtienneAr c1e0a38
Use interpolateState in examples when relevant
EtienneAr 6581e2f
Remove comments
EtienneAr 3a1cbda
Remove commented code on TargetContactForce
EtienneAr fc424cc
Minor typo
EtienneAr 0dd62ea
Resize samples instead of reallocating
EtienneAr 2d18953
Remove pointer to solver and directly have object in class
EtienneAr 6d2edb3
Make tsid task unique_pointer
EtienneAr d4d10e9
Rename id files
EtienneAr d879f1d
Ignore .vscode
EtienneAr 4694bcc
Minor comments
EtienneAr 8b7ec62
minor fix on renaming id headers
EtienneAr b7d18a1
Minor fix of sign ismatch warnings
EtienneAr e18daee
Fix some more signs & unused variables warnings
EtienneAr 9a45f4d
Add static cast to remove one warning
EtienneAr 555965a
Fix the last remaining warnings introduced in this PR
EtienneAr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,4 +33,9 @@ | |
|
|
||
| .cache/ | ||
| build*/ | ||
| /__pycache__/ | ||
| __pycache__/ | ||
|
|
||
|
|
||
| .vscode | ||
| CMakeFiles/ | ||
| CMakeCache.txt | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #include <eigenpy/eigenpy.hpp> | ||
|
|
||
| #include "simple-mpc/inverse-dynamics/centroidal-id.hpp" | ||
| #include "simple-mpc/inverse-dynamics/kinodynamics-id.hpp" | ||
|
|
||
| namespace simple_mpc | ||
| { | ||
| namespace python | ||
| { | ||
| namespace bp = boost::python; | ||
|
|
||
| Eigen::VectorXd solveKinoProxy( | ||
| KinodynamicsID & self, | ||
| const double t, | ||
| const Eigen::Ref<const Eigen::VectorXd> & q_meas, | ||
| const Eigen::Ref<const Eigen::VectorXd> & v_meas) | ||
| { | ||
| Eigen::VectorXd tau_res(self.model_handler_.getModel().nv - 6); | ||
| self.solve(t, q_meas, v_meas, tau_res); | ||
| return tau_res; | ||
| } | ||
|
|
||
| Eigen::VectorXd getAccelerationsKinoProxy(KinodynamicsID & self) | ||
| { | ||
| Eigen::VectorXd a(self.model_handler_.getModel().nv); | ||
| self.getAccelerations(a); | ||
| return a; | ||
| } | ||
|
|
||
| Eigen::VectorXd solveCentroidalProxy( | ||
| CentroidalID & self, | ||
| const double t, | ||
| const Eigen::Ref<const Eigen::VectorXd> & q_meas, | ||
| const Eigen::Ref<const Eigen::VectorXd> & v_meas) | ||
| { | ||
| Eigen::VectorXd tau_res(self.model_handler_.getModel().nv - 6); | ||
| self.solve(t, q_meas, v_meas, tau_res); | ||
| return tau_res; | ||
| } | ||
|
|
||
| Eigen::VectorXd getAccelerationsCentroidalProxy(CentroidalID & self) | ||
| { | ||
| Eigen::VectorXd a(self.model_handler_.getModel().nv); | ||
| self.getAccelerations(a); | ||
| return a; | ||
| } | ||
|
|
||
| void setTarget_CentroidalID( | ||
| CentroidalID & self, | ||
| const Eigen::Ref<const Eigen::Vector<double, 3>> & com_position, | ||
| const Eigen::Ref<const Eigen::Vector<double, 3>> & com_velocity, | ||
| const CentroidalID::FeetPoseVector & feet_pose, | ||
| const CentroidalID::FeetVelocityVector & feet_velocity, | ||
| const std::vector<bool> & contact_state_target, | ||
| const std::vector<CentroidalID::TargetContactForce> & f_target) | ||
| { | ||
| self.setTarget(com_position, com_velocity, feet_pose, feet_velocity, contact_state_target, f_target); | ||
| } | ||
|
|
||
| void exposeInverseDynamics() | ||
| { | ||
| bp::class_<KinodynamicsID::Settings>("KinodynamicsIDSettings", bp::init<>(bp::args("self"))) | ||
| .def_readwrite("friction_coefficient", &KinodynamicsID::Settings::friction_coefficient) | ||
| .def_readwrite("contact_weight_ratio_max", &KinodynamicsID::Settings::contact_weight_ratio_max) | ||
| .def_readwrite("contact_weight_ratio_min", &KinodynamicsID::Settings::contact_weight_ratio_min) | ||
| .def_readwrite("kp_base", &KinodynamicsID::Settings::kp_base) | ||
| .def_readwrite("kp_posture", &KinodynamicsID::Settings::kp_posture) | ||
| .def_readwrite("kp_contact", &KinodynamicsID::Settings::kp_contact) | ||
| .def_readwrite("w_base", &KinodynamicsID::Settings::w_base) | ||
| .def_readwrite("w_posture", &KinodynamicsID::Settings::w_posture) | ||
| .def_readwrite("w_contact_motion", &KinodynamicsID::Settings::w_contact_motion) | ||
| .def_readwrite("w_contact_force", &KinodynamicsID::Settings::w_contact_force) | ||
| .def_readwrite("contact_motion_equality", &KinodynamicsID::Settings::contact_motion_equality); | ||
|
|
||
| bp::class_<KinodynamicsID, boost::noncopyable>( | ||
| "KinodynamicsID", bp::init<const simple_mpc::RobotModelHandler &, double, const KinodynamicsID::Settings>( | ||
| bp::args("self", "model_handler", "control_dt", "settings"))) | ||
| .def("setTarget", &KinodynamicsID::setTarget) | ||
| .def("solve", &solveKinoProxy) | ||
| .def("getAccelerations", &getAccelerationsKinoProxy); | ||
|
|
||
| bp::class_<CentroidalID::Settings, bp::bases<KinodynamicsID::Settings>>( | ||
| "CentroidalIDSettings", bp::init<>(bp::args("self"))) | ||
| .def_readwrite("kp_com", &CentroidalID::Settings::kp_com) | ||
| .def_readwrite("kp_feet_tracking", &CentroidalID::Settings::kp_feet_tracking) | ||
| .def_readwrite("w_com", &CentroidalID::Settings::w_com) | ||
| .def_readwrite("w_feet_tracking", &CentroidalID::Settings::w_feet_tracking); | ||
|
|
||
| bp::class_<CentroidalID, boost::noncopyable>( | ||
| "CentroidalID", bp::init<const simple_mpc::RobotModelHandler &, double, const CentroidalID::Settings>( | ||
| bp::args("self", "model_handler", "control_dt", "settings"))) | ||
| .def("setTarget", &setTarget_CentroidalID) | ||
| .def("solve", &solveCentroidalProxy) | ||
| .def("getAccelerations", &getAccelerationsCentroidalProxy); | ||
| } | ||
| } // namespace python | ||
| } // namespace simple_mpc | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.