Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import math
from pyfrc.physics import motor_cfgs, tankmodel
from pyfrc.physics.units import units
class PhysicsEngine(object):
"""
Simulates a 4-wheel robot using Tank Drive joystick control
"""
WHEEL_DIAMETER = 6 * units.inch
ENCODER_PULSE_PER_REV = 4096
ENCODER_SCALE = units.foot.m_from(WHEEL_DIAMETER) * math.pi / ENCODER_PULSE_PER_REV
def __init__(self, physics_controller):
"""
:param physics_controller: `pyfrc.physics.core.Physics` object
to communicate simulation effects to
"""
self.physics_controller = physics_controller
#
# Two ways of initializing the realistic physics -- either use the
# ka/kv that you computed for your robot, or use the theoretical model
#
# Change these parameters to fit your robot!
# -> these parameters are for the test robot mentioned in the paper
import math
from pyfrc.physics import motor_cfgs, tankmodel
from pyfrc.physics.units import units
class PhysicsEngine(object):
"""
Simulates a 4-wheel robot using Tank Drive joystick control
"""
WHEEL_DIAMETER = 6 * units.inch
ENCODER_PULSE_PER_REV = 360
ENCODER_SCALE = units.foot.m_from(WHEEL_DIAMETER) * math.pi / 360
def __init__(self, physics_controller):
"""
:param physics_controller: `pyfrc.physics.core.Physics` object
to communicate simulation effects to
"""
self.physics_controller = physics_controller
#
# Two ways of initializing the realistic physics -- either use the
# ka/kv that you computed for your robot, or use the theoretical model
#
# Change these parameters to fit your robot!
# -> these parameters are for the test robot mentioned in the paper