Skip to content

Commit 126e0a4

Browse files
committed
Rename 'ctre' package to 'phoenix5'
- Will be more consistent for users in the future
1 parent 082fe2a commit 126e0a4

File tree

34 files changed

+98
-98
lines changed

34 files changed

+98
-98
lines changed

.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ __pycache__/
4343
*$py.class
4444

4545
# C extensions
46-
/ctre/_init_ctre.py
47-
/ctre/pkgcfg.py
48-
/ctre/rpy-include
49-
/ctre/version.py
50-
/ctre/py.typed
51-
52-
/ctre/_*/_init_*.py
53-
/ctre/_*/pkgcfg.py
54-
/ctre/_*/include
46+
/phoenix5/_init_ctre.py
47+
/phoenix5/pkgcfg.py
48+
/phoenix5/rpy-include
49+
/phoenix5/version.py
50+
/phoenix5/py.typed
51+
52+
/phoenix5/_*/_init_*.py
53+
/phoenix5/_*/pkgcfg.py
54+
/phoenix5/_*/include
5555

5656

5757
# Distribution / packaging

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
robotpy-ctre
22
============
33

4-
This is a python wrapper around the CTRE Phoenix library. The RobotPy project
4+
This is a python wrapper around the CTRE Phoenix v5 API. The RobotPy project
55
is not associated with or endorsed by Cross The Road Electronics.
66

77
**NOTE**: CTRE only supports simulation for the following platforms:

docs/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ and we'll try to address the problem.
1717

1818
.. toctree::
1919

20-
ctre
21-
ctre.led
22-
ctre.sensors
20+
phoenix5
21+
phoenix5.led
22+
phoenix5.sensors

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from os.path import abspath, join, dirname
88

9-
import ctre
9+
import phoenix5
1010

1111
# -- RTD configuration ------------------------------------------------
1212

@@ -136,6 +136,6 @@
136136

137137
root = abspath(dirname(__file__))
138138

139-
gen_package(root, "ctre")
140-
gen_package(root, "ctre.led")
141-
gen_package(root, "ctre.sensors")
139+
gen_package(root, "phoenix5")
140+
gen_package(root, "phoenix5.led")
141+
gen_package(root, "phoenix5.sensors")

examples/basic/robot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
import wpilib
4-
import ctre
4+
import phoenix5
55

66

77
class MyRobot(wpilib.TimedRobot):
@@ -11,7 +11,7 @@ class MyRobot(wpilib.TimedRobot):
1111
"""
1212

1313
def robotInit(self):
14-
self.motor = ctre.WPI_TalonSRX(1) # Initialize the TalonSRX on device 1.
14+
self.motor = phoenix5.WPI_TalonSRX(1) # Initialize the TalonSRX on device 1.
1515

1616
def disabledPeriodic(self):
1717
self.motor.disable()

examples/getting-started/robot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import wpilib
99
import wpilib.drive
10-
import ctre
10+
import phoenix5
1111

1212

1313
class MyRobot(wpilib.TimedRobot):
@@ -16,8 +16,8 @@ def robotInit(self):
1616
This function is called upon program startup and
1717
should be used for any initialization code.
1818
"""
19-
self.leftDrive = ctre.WPI_TalonFX(1)
20-
self.rightDrive = ctre.WPI_TalonFX(2)
19+
self.leftDrive = phoenix5.WPI_TalonFX(1)
20+
self.rightDrive = phoenix5.WPI_TalonFX(2)
2121
self.robotDrive = wpilib.drive.DifferentialDrive(
2222
self.leftDrive, self.rightDrive
2323
)

examples/motion_magic/robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* use button1 to motion-magic servo to target position specified by the gamepad stick.
2020
"""
2121

22-
from ctre import WPI_TalonSRX
22+
from phoenix5 import WPI_TalonSRX
2323
import wpilib
2424

2525

examples/position_closed_loop/robot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Tweak the PID gains accordingly.
1919
"""
2020

21-
import ctre
21+
import phoenix5
2222
import wpilib
2323

2424

@@ -37,7 +37,7 @@ class Robot(wpilib.TimedRobot):
3737
kTimeoutMs = 10
3838

3939
def robotInit(self):
40-
self.talon = ctre.WPI_TalonSRX(3)
40+
self.talon = phoenix5.WPI_TalonSRX(3)
4141
self.joy = wpilib.Joystick(0)
4242

4343
self.loops = 0
@@ -46,7 +46,7 @@ def robotInit(self):
4646

4747
# choose the sensor and sensor direction
4848
self.talon.configSelectedFeedbackSensor(
49-
ctre.FeedbackDevice.CTRE_MagEncoder_Relative,
49+
phoenix5.FeedbackDevice.CTRE_MagEncoder_Relative,
5050
self.kPIDLoopIdx,
5151
self.kTimeoutMs,
5252
)
@@ -106,14 +106,14 @@ def teleopPeriodic(self):
106106

107107
# 10 Rotations * 4096 u/rev in either direction
108108
self.targetPos = leftYstick * 4096 * 10.0
109-
self.talon.set(ctre.ControlMode.Position, self.targetPos)
109+
self.talon.set(phoenix5.ControlMode.Position, self.targetPos)
110110

111111
# on button2 just straight drive
112112
if button2:
113113
# Percent voltage mode
114-
self.talon.set(ctre.ControlMode.PercentOutput, leftYstick)
114+
self.talon.set(phoenix5.ControlMode.PercentOutput, leftYstick)
115115

116-
if self.talon.getControlMode() == ctre.ControlMode.Position:
116+
if self.talon.getControlMode() == phoenix5.ControlMode.Position:
117117
# append more signals to print when in speed mode.
118118
sb.append("\terr: %s" % self.talon.getClosedLoopError(self.kPIDLoopIdx))
119119
sb.append("\ttrg: %.3f" % self.targetPos)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)