diff --git a/Driver/CartPoleSimulation b/Driver/CartPoleSimulation index 6d8b1f8a..fed3f3bd 160000 --- a/Driver/CartPoleSimulation +++ b/Driver/CartPoleSimulation @@ -1 +1 @@ -Subproject commit 6d8b1f8ac351938530650a373cecbd0128fa861d +Subproject commit fed3f3bd314c9f36b62b8083c6a114775f827e5c diff --git a/Driver/DriverFunctions/cartpole_simulator_batched.py b/Driver/DriverFunctions/cartpole_simulator_batched.py index 228131bd..c22938ed 100644 --- a/Driver/DriverFunctions/cartpole_simulator_batched.py +++ b/Driver/DriverFunctions/cartpole_simulator_batched.py @@ -24,7 +24,7 @@ class cartpole_simulator_batched(EnvironmentBatched, CartPoleEnv_LTC): num_states = 6 def __init__( - self, batch_size=1, computation_lib=NumpyLibrary, render_mode="human", **kwargs + self, batch_size=1, computation_lib=NumpyLibrary(), render_mode="human", **kwargs ): self._batch_size = batch_size self._actuator_noise = np.array(kwargs["actuator_noise"], dtype=np.float32) diff --git a/Driver/DriverFunctions/main_logging_manager.py b/Driver/DriverFunctions/main_logging_manager.py index ab4c6ba3..532a879f 100644 --- a/Driver/DriverFunctions/main_logging_manager.py +++ b/Driver/DriverFunctions/main_logging_manager.py @@ -6,8 +6,8 @@ from CartPoleSimulation.CartPole.state_utilities import ANGLE_IDX, ANGLE_COS_IDX, ANGLE_SIN_IDX, ANGLED_IDX, \ POSITION_IDX, POSITIOND_IDX -from CartPoleSimulation.CartPole.data_manager import DataManager -from CartPoleSimulation.CartPole.csv_logger import create_csv_file_name +from SI_Toolkit.General.data_manager import DataManager +from CartPoleSimulation.CartPole.csv_logger import create_csv_file_name, create_csv_file from DriverFunctions.csv_helpers import create_csv_header, create_csv_title from globals import ( @@ -67,7 +67,7 @@ def __init__(self, driver): self.data_to_save_measurement = {} self.data_to_save_controller = {} - self.data_manager = DataManager() + self.data_manager = DataManager(create_csv_file) self.csv_name = None self.recording_length = np.inf diff --git a/Driver/globals.py b/Driver/globals.py index e96823ad..a5121b57 100644 --- a/Driver/globals.py +++ b/Driver/globals.py @@ -35,13 +35,13 @@ # The other two shift (additive) to account for friction indep. of speed (separate for pos and neg Q) # Only applied if CORRECT_MOTOR_DYNAMICS is True MOTOR_CORRECTION_ORIGINAL = (0.63855139, 0.11653139, 0.11653139) - MOTOR_CORRECTION_POLOLU = (0.595228, 0.0323188, 0.0385016) + MOTOR_CORRECTION_POLOLU = (0.5733488, 0.0257380, 0.0258429) # The 12-bit ADC has a range of 4096 units # However due to potentiometer dead angle these 4096 units are mapped on less than full circle # The full circle in adc units was determined # by readout difference between up and down position on the side not including dead angle ANGLE_360_DEG_IN_ADC_UNITS = 4271.34 - ANGLE_HANGING_POLOLU = 1028.579 # Value from sensor when pendulum is at stable equilibrium point + ANGLE_HANGING_POLOLU = 1000 # Value from sensor when pendulum is at stable equilibrium point ANGLE_HANGING_ORIGINAL = 910.0 # Value from sensor when pendulum is at stable equilibrium point POSITION_ENCODER_RANGE = 4164 # This is an empirical approximation elif CHIP == 'ZYNQ':