Skip to content

Conversation

@Anri-Lombard
Copy link

Summary

  • Fix two algebraic errors in cartpole physics (issue Incorrect cartpole dynamics #447)
  • polemass_length was total_mass + pole_mass, should be pole_mass * pole_length
  • thetaacc denominator used total_mass where it should use pole_mass

Reference

Florian's cart-pole dynamics paper (equations 23 and 24)

Test plan

  • Verified fixed equations match Gymnasium's CartPole implementation
  • Simulated 100 steps with identical parameters: 0.00 difference in pole angle

Two algebraic errors in the physics:
1. polemass_length was total_mass + pole_mass, should be pole_mass * pole_length
2. thetaacc denominator used total_mass where it should use pole_mass

Reference: Florian's cart-pole dynamics (equations 23 and 24)
Fixes PufferAI#447
@elevatorguy
Copy link

41e66 doesn't have c_render; there is an error, though - cartpole.
— Jason Garner (April 23, 2025)

We not puttin' the cart back into cartpole?
— Jason Garner (May 19, 2025)

Was not aware of #447 at time of writing.

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