/*****************************************************************************/ /*****************************************************************************/ /* How many things can we have in the simulator? */ #define MAX_N_ARMS 1 #define MAX_N_BLOCKS 10 /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ typedef struct simulator { float time; /* seconds */ float time_step; /* seconds */ float gravity; float cart_mass; float pole_mass; float total_mass; float pole_I; float pole_length; float pole_cm; float pole_I_base; float cart_damping; float pole_damping; float force_magnitude; float cart_x; float cart_y; float pole_angle; float cart_xd; float pole_angled; float cart_xdd; float pole_angledd; float cart_force; float pole_torque; float cart_x_desired; float pole_angle_desired; float k_cart; float b_cart; float k_pole; float b_pole; float sin_pole_angle; float cos_pole_angle; float min_x_display; float min_y_display; float max_x_display; float max_y_display; float cart_xd_next; float pole_angled_next; float ke_translation; float ke_rotation; float pe_gravity; float pe_spring; float energy; float max_excursion; /* How far does cart go before we give up. */ float max_angle; /* How far is pole tipped over before we give up. */ } Simulator, *pSimulator; /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ typedef struct communication_buffer { int playing; float time; pSimulator ps; } Communication_Buffer; /*****************************************************************************/ /*****************************************************************************/