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

A few tweaks to MocoExpressionBasedParameterGoal #3893

Merged
merged 6 commits into from
Aug 29, 2024

Conversation

nickbianco
Copy link
Member

@nickbianco nickbianco commented Aug 26, 2024

Brief summary of changes

A handful of changes made to some aspects of MocoExpressionBasedParameterGoal that I noticed while using this as a reference for ExpressionBasedFunction. I've also opted to change the property variable_names to simply variables.

Testing I've completed

Ran the existing tests in testMocoGoals.cpp.

Looking for feedback on...

CHANGELOG.md (choose one)

  • no need to update because...tweaks to existing goal.

This change is Reviewable

Copy link
Member

@AllisonJohn AllisonJohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @nickbianco)


OpenSim/Moco/MocoGoal/MocoExpressionBasedParameterGoal.h line 79 at r1 (raw file):

    }

    /** Set the mathematical expression to minimize or constraint. Variable 

constraint -> constrain
Maybe it should say arithmetic instead of mathematical too

Copy link
Member Author

@nickbianco nickbianco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @AllisonJohn)


OpenSim/Moco/MocoGoal/MocoExpressionBasedParameterGoal.h line 79 at r1 (raw file):

Previously, AllisonJohn wrote…

constraint -> constrain
Maybe it should say arithmetic instead of mathematical too

Done.

Copy link
Member

@AllisonJohn AllisonJohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @nickbianco)


OpenSim/Moco/MocoGoal/MocoExpressionBasedParameterGoal.cpp line 78 at r2 (raw file):

    } catch (Lepton::Exception& ex) {
        const std::string msg = ex.what();
        std::string undefinedVar = msg.substr(32, msg.size() - 32);

The reason I had the if statement before is that I thought there could be other types of errors that are not for undefined variables? So I think this change could make it seem like there was an undefined variable when there really isn't.

@AllisonJohn AllisonJohn self-requested a review August 28, 2024 21:46
Copy link
Member

@AllisonJohn AllisonJohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @nickbianco)


OpenSim/Moco/MocoGoal/MocoExpressionBasedParameterGoal.cpp line 78 at r2 (raw file):

Previously, AllisonJohn wrote…

The reason I had the if statement before is that I thought there could be other types of errors that are not for undefined variables? So I think this change could make it seem like there was an undefined variable when there really isn't.

oops I didn't mean to approve

Copy link
Member Author

@nickbianco nickbianco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @AllisonJohn)


OpenSim/Moco/MocoGoal/MocoExpressionBasedParameterGoal.cpp line 78 at r2 (raw file):

Previously, AllisonJohn wrote…

oops I didn't mean to approve

Ah, good point. I've added it back and also added a similar if-statement to ExpressionBasedFunction while I was at it.

Copy link
Member

@AllisonJohn AllisonJohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @nickbianco)

@nickbianco
Copy link
Member Author

Windows failure is unrelated, merging.

Thanks @AllisonJohn!

@nickbianco nickbianco merged commit 38fed30 into main Aug 29, 2024
11 of 12 checks passed
@nickbianco nickbianco deleted the expression_based_parameter_goal_tweaks branch August 29, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants