Skip to content

Development - new features and changes over last months, mainly new TF training script#66

Open
marcinpaluch1994 wants to merge 129 commits intomasterfrom
Development
Open

Development - new features and changes over last months, mainly new TF training script#66
marcinpaluch1994 wants to merge 129 commits intomasterfrom
Development

Conversation

@marcinpaluch1994
Copy link
Copy Markdown
Collaborator

@marcinpaluch1994 marcinpaluch1994 commented Jun 27, 2025

Note

High Risk
High risk because it changes core CartPole dynamics/actuation plumbing (new neural-model stepping and acceleration modes, updated Q2u, renamed noise parameters) and adds a new ZeroMQ-based remote control path, all of which can materially alter simulation fidelity and runtime behavior.

Overview
Adds configurable dynamics execution paths to the simulator: CartPole can now advance state via next_step_mode (Euler vs neural net) and compute accelerations via second_derivatives_mode (ODE, neural-only, or ODE+NN residual), with updated Q2u(Q, u_max) usage throughout.

Reworks control disturbance injection by replacing add_control_noise/controlDisturbance* with a stateful ControlNoiseGenerator backed by a new time-step-invariant CorrelatedNoiseGenerator, and renames exported parameters to controlNoiseScale/Bias/Correlation/controlNoise_mode.

Introduces a new cartpole_ekf.py (EKF + adaptive Q/R tuner with YAML persistence + live reload), updates CSV logging/header metadata, tweaks MPC cost/optimizer configs, and adds an additional neural controller (controller_difflg) plus bundled model artifacts.

Modernizes the Gym env by decoupling physics from tasks and rendering: adds Task registry (tasks.py), a PygameViewer, a CartPoleSimulatorBase interface, replaces the legacy sensors sim with Cartpole_CustomSim, and adds Cartpole_Remote to run the environment against physical hardware over ZeroMQ.

Written by Cursor Bugbot for commit 95c12c2. This will update automatically on new commits. Configure here.

…iment_3_04_2025

# Conflicts:
#	others/prepare_standard_experiment_folder.py
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

high = np.array(
[
self.theta_threshold_radians * 2,
self.angle_limit * 2,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Undefined angle_limit attribute crashes Cartpole_OpenAI initialization

High Severity

Cartpole_OpenAI.__init__ references self.angle_limit to build the observation space, but this attribute is never defined on the class. The old self.theta_threshold_radians was removed without replacing it with a self.angle_limit assignment. This causes an AttributeError crash whenever Cartpole_OpenAI is instantiated (e.g., when cartpole_type="openai" is selected in CartPoleEnv).

Fix in Cursor Fix in Web

s[POSITION_IDX+1]= vel

self.steps_beyond_terminated = None
return super().init_state(rng)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

StabilizationOpenAI.init_state discards its constructed state

Medium Severity

StabilizationOpenAI.init_state carefully builds a near-upright state s with small angles and velocities (matching classic OpenAI CartPole specs), but then returns super().init_state(rng) which constructs and returns a different state with full-circle random angles. The locally built s is completely discarded, so episodes start with random angles instead of the intended near-upright configuration.

Fix in Cursor Fix in Web

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.

3 participants