Skip to content

Commit

Permalink
Standardize robot.py styling for copyright header
Browse files Browse the repository at this point in the history
  • Loading branch information
fletch3555 committed Dec 7, 2023
1 parent 411d9b0 commit 7ce3328
Show file tree
Hide file tree
Showing 38 changed files with 271 additions and 95 deletions.
7 changes: 7 additions & 0 deletions addressableled/robot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib

kLEDBuffer = 60
Expand Down
14 changes: 10 additions & 4 deletions arcade-drive-xbox-controller/robot.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env python3
"""
This is a demo program showing the use of the DifferentialDrive class.
Runs the motors with split arcade steering and an Xbox controller.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpilib.drive


class MyRobot(wpilib.TimedRobot):
"""
This is a demo program showing the use of the DifferentialDrive class.
Runs the motors with split arcade steering and an Xbox controller.
"""

def robotInit(self):
"""Robot initialization function"""

Expand Down
14 changes: 10 additions & 4 deletions arcade-drive/robot.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env python3
"""
This is a demo program showing the use of the DifferentialDrive class.
Runs the motors with arcade steering.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpilib.drive


class MyRobot(wpilib.TimedRobot):
"""
This is a demo program showing the use of the DifferentialDrive class.
Runs the motors with arcade steering.
"""

def robotInit(self):
"""Robot initialization function"""

Expand Down
1 change: 1 addition & 0 deletions arm-simulation/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib

Expand Down
5 changes: 3 additions & 2 deletions armbot/robot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!usr/bin/env python3

#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import commands2
Expand Down
5 changes: 3 additions & 2 deletions armbotoffboard/robot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!usr/bin/env python3

#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import commands2
Expand Down
16 changes: 11 additions & 5 deletions canpdp/robot.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#!/usr/bin/env python3
"""
This is a sample program showing how to retrieve information from the Power
Distribution Panel via CAN. The information will be displayed under variables
through the SmartDashboard.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpilib.drive


class MyRobot(wpilib.TimedRobot):
"""
This is a sample program showing how to retrieve information from the Power
Distribution Panel via CAN. The information will be displayed under variables
through the SmartDashboard.
"""

def robotInit(self):
"""Robot initialization function"""

Expand Down
12 changes: 9 additions & 3 deletions cscore-intermediate-vision/robot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/env python3
"""
This is a good foundation to build your robot code on
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib


class MyRobot(wpilib.TimedRobot):
"""
This is a good foundation to build your robot code on
"""

def robotInit(self):
wpilib.CameraServer.launch("vision.py:main")

Expand Down
12 changes: 9 additions & 3 deletions cscore-quick-vision/robot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/env python3
"""
This is a good foundation to build your robot code on
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib


class MyRobot(wpilib.TimedRobot):
"""
This is a good foundation to build your robot code on
"""

def robotInit(self):
wpilib.CameraServer.launch()

Expand Down
5 changes: 5 additions & 0 deletions differential-drive-bot/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpilib.drive
Expand Down
7 changes: 7 additions & 0 deletions elevator-profiled-pid/robot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpimath.controller
import wpimath.trajectory
Expand Down
1 change: 1 addition & 0 deletions elevator-simulation/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import math
import wpilib
Expand Down
17 changes: 12 additions & 5 deletions game-data/robot.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/usr/bin/env python3
"""
Example file showing how to get game-data from your driver station / FMS
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import ntcore

PNUE_MOD_TYPE = wpilib.PneumaticsModuleType.CTREPCM


class GameDataRobot(wpilib.TimedRobot):
class MyRobot(wpilib.TimedRobot):
"""
Example file showing how to get game-data from your driver station / FMS
"""

def robotInit(self):
# A way of demonstrating the difference between the game data strings
self.blue = wpilib.Solenoid(PNUE_MOD_TYPE, 0)
Expand All @@ -35,4 +42,4 @@ def teleopPeriodic(self):


if __name__ == "__main__":
wpilib.run(GameDataRobot)
wpilib.run(MyRobot)
5 changes: 5 additions & 0 deletions hatchbot-inlined/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import typing
import wpilib
Expand Down
5 changes: 5 additions & 0 deletions hatchbot/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import typing
import wpilib
Expand Down
14 changes: 10 additions & 4 deletions i2c-communication/robot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/usr/bin/env python3
"""
This is a sample program demonstrating how to communicate to a light controller from the robot
code using the roboRIO's I2C port.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib


class MyRobot(wpilib.TimedRobot):
"""
This is a sample program demonstrating how to communicate to a light controller from the robot
code using the roboRIO's I2C port.
"""

PORT = wpilib.I2C.Port.kOnboard
DEVICE_ADDRESS = 4

Expand Down
5 changes: 5 additions & 0 deletions magicbot-simple/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
from magicbot import MagicRobot
Expand Down
14 changes: 10 additions & 4 deletions mecanum-drive/robot.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env python3
"""
This is a demo program showing how to use Mecanum control with the
MecanumDrive class.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpilib.drive


class MyRobot(wpilib.TimedRobot):
"""
This is a demo program showing how to use Mecanum control with the
MecanumDrive class.
"""

# Channels on the roboRIO that the motor controllers are plugged in to
kFrontLeftChannel = 2
kRearLeftChannel = 3
Expand Down
14 changes: 10 additions & 4 deletions mecanum-driveXbox/robot.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env python3
"""
This is a demo program showing how to use Mecanum control with the
MecanumDrive class.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
from wpilib.drive import MecanumDrive


class MyRobot(wpilib.TimedRobot):
"""
This is a demo program showing how to use Mecanum control with the
MecanumDrive class.
"""

# Channels on the roboRIO that the motor controllers are plugged in to
frontLeftChannel = 2
rearLeftChannel = 3
Expand Down
20 changes: 13 additions & 7 deletions mechanism2d/robot.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/usr/bin/env python3
"""
This sample program shows how to use Mechanism2d - a visual representation of arms, elevators,
and other mechanisms on dashboards; driven by a node-based API.
Ligaments are based on other ligaments or roots, and roots are contained in the base
Mechanism2d object.
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib


class MyRobot(wpilib.TimedRobot):
"""
This sample program shows how to use Mechanism2d - a visual representation of arms, elevators,
and other mechanisms on dashboards; driven by a node-based API.
Ligaments are based on other ligaments or roots, and roots are contained in the base
Mechanism2d object.
"""

kMetersPerPulse = 0.01
kElevatorMinimumLength = 0.5

Expand Down
18 changes: 12 additions & 6 deletions motor-control/robot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env python3
"""
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib


class MyRobot(wpilib.TimedRobot):
"""
This sample program shows how to control a motor using a joystick. In the
operator control part of the program, the joystick is read and the value
is written to the motor.
Expand All @@ -9,12 +19,8 @@
a short time in the loop to allow other threads to run. This is generally
a good idea, especially since the joystick values are only transmitted
from the Driver Station once every 20ms.
"""
"""

import wpilib


class MyRobot(wpilib.TimedRobot):
#: update every 0.005 seconds/5 milliseconds (200Hz)
kUpdatePeriod = 0.005

Expand Down
5 changes: 5 additions & 0 deletions physics-4wheel/src/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env python3
#
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
#

import wpilib
import wpilib.drive
Expand Down
Loading

0 comments on commit 7ce3328

Please sign in to comment.