-
Notifications
You must be signed in to change notification settings - Fork 174
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
Fixed terminal computation in model classes derivated in Python #1204
Merged
cmastalli
merged 7 commits into
loco-3d:devel
from
cmastalli:topic/fix-terminal-computation-python
Dec 30, 2023
Merged
Fixed terminal computation in model classes derivated in Python #1204
cmastalli
merged 7 commits into
loco-3d:devel
from
cmastalli:topic/fix-terminal-computation-python
Dec 30, 2023
Conversation
This file contains 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
nim65s
added a commit
to nim65s/robotpkg
that referenced
this pull request
May 31, 2024
Changed in v2.1.0: * Updated black + isort + flake8 to ruff in loco-3d/crocoddyl#1256 * Exported version for Python in loco-3d/crocoddyl#1254 * Added pinocchio 3 preliminary support in loco-3d/crocoddyl#1253 * Updated CMake packaging in loco-3d/crocoddyl#1249 * Fixed ruff reported error in loco-3d/crocoddyl#1248 * Fixed yapf reported errors in loco-3d/crocoddyl#1238 * Tested Python stubs in Conda CI in loco-3d/crocoddyl#1228 * Fixed Rviz display in loco-3d/crocoddyl#1227 * Improved CI, updated cmake and fixed launch file in loco-3d/crocoddyl#1220 * Introduced a Rviz display in loco-3d/crocoddyl#1216 * Enabled display of thrust and simplied displayers code in loco-3d/crocoddyl#1215 * Introduced floating base thruster actuation model in loco-3d/crocoddyl#1213 * Fixed quadruped and biped examples in loco-3d/crocoddyl#1208 * Fixed terminal computation in Python models in loco-3d/crocoddyl#1204 * Fixed handling of unbounded values for `ActivationBounds` in loco-3d/crocoddyl#1191
nim65s
added a commit
to nim65s/robotpkg
that referenced
this pull request
Jun 20, 2024
Changed in v2.1.0: * Updated black + isort + flake8 to ruff in loco-3d/crocoddyl#1256 * Exported version for Python in loco-3d/crocoddyl#1254 * Added pinocchio 3 preliminary support in loco-3d/crocoddyl#1253 * Updated CMake packaging in loco-3d/crocoddyl#1249 * Fixed ruff reported error in loco-3d/crocoddyl#1248 * Fixed yapf reported errors in loco-3d/crocoddyl#1238 * Tested Python stubs in Conda CI in loco-3d/crocoddyl#1228 * Fixed Rviz display in loco-3d/crocoddyl#1227 * Improved CI, updated cmake and fixed launch file in loco-3d/crocoddyl#1220 * Introduced a Rviz display in loco-3d/crocoddyl#1216 * Enabled display of thrust and simplied displayers code in loco-3d/crocoddyl#1215 * Introduced floating base thruster actuation model in loco-3d/crocoddyl#1213 * Fixed quadruped and biped examples in loco-3d/crocoddyl#1208 * Fixed terminal computation in Python models in loco-3d/crocoddyl#1204 * Fixed handling of unbounded values for `ActivationBounds` in loco-3d/crocoddyl#1191
nim65s
added a commit
to nim65s/robotpkg
that referenced
this pull request
Jul 1, 2024
Changed in v2.1.0: * Updated black + isort + flake8 to ruff in loco-3d/crocoddyl#1256 * Exported version for Python in loco-3d/crocoddyl#1254 * Added pinocchio 3 preliminary support in loco-3d/crocoddyl#1253 * Updated CMake packaging in loco-3d/crocoddyl#1249 * Fixed ruff reported error in loco-3d/crocoddyl#1248 * Fixed yapf reported errors in loco-3d/crocoddyl#1238 * Tested Python stubs in Conda CI in loco-3d/crocoddyl#1228 * Fixed Rviz display in loco-3d/crocoddyl#1227 * Improved CI, updated cmake and fixed launch file in loco-3d/crocoddyl#1220 * Introduced a Rviz display in loco-3d/crocoddyl#1216 * Enabled display of thrust and simplied displayers code in loco-3d/crocoddyl#1215 * Introduced floating base thruster actuation model in loco-3d/crocoddyl#1213 * Fixed quadruped and biped examples in loco-3d/crocoddyl#1208 * Fixed terminal computation in Python models in loco-3d/crocoddyl#1204 * Fixed handling of unbounded values for `ActivationBounds` in loco-3d/crocoddyl#1191
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a C++ implementation performs a terminal computation in a Python-derivated code, we pass
u=0
instead of callingcalc(data, x)
orcalcDiff(data, x)
. This behaviour in Python doesn't replicate our C++ code. Moreover, this creates bug in Python developers that are hard to track.This PR solves the issue above-mentioned by calling the right function. To do so, the trick is to define
unone_ = NAN
for Python code and call the expected virtual function implemented in Python. This problem is fixed in all the classes, i.e.,To be clear, when we wish to run a terminal computation in Python, then we pass
u=None
. This is how users are expected to implement their classes, e.g.,Additionally, the PR extends Python-derived classes used for examples and unit testing. Finally, the PR extends the Python bindings test for the action, differential action and cost models.