old_contents: import logging
  
  from networktables import NetworkTables
  from wpilib.command import Command
  
  import robotmap
  import subsystems
  from inputs import oi
  from rectifieddrive import RectifiedDrive
  
  logging.basicConfig(level=logging.INFO)
  
  
  class FollowJoystick(Command):
      """
      This command will read the joysticks' y-axes and uses tank drive.
      """
  
      def __init__(self):
          super().__init__('Follow Joystick')
  
          self.requires(subsystems.motors)
  
          self.sd = NetworkTables.getTable("SmartDashboard")
  
          self.logger = logging.getLogger("robot")
  
          self.drive = RectifiedDrive(100, period=0.02)
  
      def execute(self):
          # tank drive
          # subsystems.motors.robot_drive.tankDrive(oi.joystick, robotmap.joystick.left_port, oi.joystick,
          #                                         robotmap.joystick.right_port, True)
  
          # arcade drive
          # subsystems.motors.robot_drive.arcadeDrive(oi.joystick)
  
          # rectified arcade drive
          power = oi.joystick.getRawAxis(robotmap.joystick.forwardAxis)
          angular_vel = -oi.joystick.getRawAxis(robotmap.joystick.steeringAxis)
          self.logger.info("{}\t{}".format(angular_vel, power))
          self.drive.rectified_drive(power, angular_vel)
  
new_contents: import logging
  
  from networktables import NetworkTables
  from wpilib.command import Command
  
  import robotmap
  import subsystems
  from inputs import oi
  from rectifieddrive import RectifiedDrive
  
  logging.basicConfig(level=logging.INFO)
  
  
  class FollowJoystick(Command):
      """
      This command will read the joysticks' y-axes and uses tank drive.
      """
  
      def __init__(self):
          super().__init__('Follow Joystick')
  
          self.requires(subsystems.motors)
  
          self.sd = NetworkTables.getTable("SmartDashboard")
  
          self.logger = logging.getLogger("robot")
  
          self.drive = RectifiedDrive(100, period=0.02)
  
      def execute(self):
          # tank drive
          # subsystems.motors.robot_drive.tankDrive(oi.joystick, robotmap.joystick.left_port, oi.joystick,
          #                                         robotmap.joystick.right_port, True)
  
          # arcade drive
          # subsystems.motors.robot_drive.arcadeDrive(oi.joystick)
  
          # rectified arcade drive
          power = oi.joystick.getRawAxis(robotmap.joystick.forwardAxis)
          angular_vel = -oi.joystick.getRawAxis(robotmap.joystick.steeringAxis)
          if power > 0:  # if moving backwards, negate angular velocity
              angular_vel *= -1
          self.logger.info("{}\t{}".format(angular_vel, power))
          self.drive.rectified_drive(power, angular_vel)
  
subject: fix rectified drive steering when moving backwards