<s> from pyfrc . physics import drivetrains <EOL> class PhysicsEngine ( object ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , physics_controller ) : <EOL> '''<STR_LIT>''' <EOL> self . physics_controller = physics_controller <EOL> self . physics_controller . add_analog_gyro_channel ( <NUM_LIT:1> ) <EOL> def update_sim ( self , hal_data , now , tm_diff ) : <EOL> '''<STR_LIT>''' <EOL> lr_motor = - hal_data [ '<STR_LIT>' ] [ <NUM_LIT:1> ] [ '<STR_LIT:value>' ] <EOL> rr_motor = hal_data [ '<STR_LIT>' ] [ <NUM_LIT:2> ] [ '<STR_LIT:value>' ] <EOL> lf_motor = - hal_data [ '<STR_LIT>' ] [ <NUM_LIT:3> ] [ '<STR_LIT:value>' ] <EOL> rf_motor = hal_data [ '<STR_LIT>' ] [ <NUM_LIT:4> ] [ '<STR_LIT:value>' ] <EOL> vx , vy , vw = drivetrains . mecanum_drivetrain ( lr_motor , rr_motor , lf_motor , rf_motor ) <EOL> self . physics_controller . vector_drive ( vx , vy , vw , tm_diff ) </s>
