Skip to content

Add passive joint moments - #32

Merged
moorepants merged 6 commits into
masterfrom
add-passive-joint-moments
Apr 23, 2026
Merged

Add passive joint moments#32
moorepants merged 6 commits into
masterfrom
add-passive-joint-moments

Conversation

@tvdbogert

Copy link
Copy Markdown
Member

Ready for feedback

Comment thread pygait2d/segment.py
self.origin_joint = origin_joint
self.joint_description = joint_description
self.inertial_frame = inertial_frame
self.passive_torque = passive_torque;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
self.passive_torque = passive_torque;
self.passive_torque = passive_torque

Comment thread .gitignore Outdated
*.i*86
*.x86_64
*.hex
algait2de/gait2de.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I commited this on purpose because I don't have autolev to regenerate it. We shouldn't ignore it.

Comment thread pygait2d/derive.py

segment = segment_class(label, desc, parent_reference_frame,
origin_joint, joint_desc, ground)
origin_joint, joint_desc, ground, passive_torque)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
origin_joint, joint_desc, ground, passive_torque)
origin_joint, joint_desc, ground, passive_torque=passive_torque)

Comment thread pygait2d/derive.py
@moorepants

Copy link
Copy Markdown
Member

All looks good. I tested the forward sim and it runs.

You could add them to the predictive sim example also (if that makes sense).

I had .gitignored it, because its first line says "Generated by Cython 3.2.4".  So I assumed it was generated by pygait2d.

It does not look like it was generated by Autolev.
@tvdbogert

Copy link
Copy Markdown
Member Author

I have put gait2de.c back in the repository.

But can you please check where it came from? It first line says "Generated by Cython 3.2.4" and it does not look like anything generated by Autolev.

In my Autolev workflow, Autolev generates gait2de_al.c, which is then cleaned up by autolevclean.c, which creates gait2de.c, a callable function. That file then does not need to be in the repository.

I am still puzzled why the model with passive moments did not work for me yesterday. Maybe something from the cache was reused? It works now, and the code is still the same.

@moorepants

Copy link
Copy Markdown
Member

My apologies I was wrong and thought you were gitignoring the gait2de_al.c and forgot that Cython will generate the other C file. We do not need to commit the Cython generated C file (gait2de.c) and it can be gitignored.

I am still puzzled why the model with passive moments did not work for me yesterday. Maybe something from the cache was reused? It works now, and the code is still the same.

Not sure. I only have a cache on the opty code, not the forward simulation.

@moorepants
moorepants merged commit 1baad44 into master Apr 23, 2026
1 check passed
@tvdbogert
tvdbogert deleted the add-passive-joint-moments branch April 24, 2026 22:47
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