Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog
## [1.0.1] - 2025-10-14
### Changes and Fixes
- Internal: replaced custom vexEnum with Pythons Enum; no user-facing API changes.
- Internal: replaced custom vexEnum with Python's Enum; no user-facing API changes.
- Removed vexnumber; affected APIs now accept float.
- Moved sleep and wait to a new module vex_util (removed from vex_types).
- Color class updated to accept web color strings.
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/emoji_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
------------------------------------------------------------------------------------

Project: Emoji Reaction
Description: This project displays a happy emoji when the robots angle is stable
Description: This project displays a happy emoji when the robot's angle is stable
and a surprised emoji when tilted.

------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/timing_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Project: Timing Events
Description: This project starts driving forward but stops automatically once five
seconds have elapsed, then displays Times up! on the screen.
seconds have elapsed, then displays "Time's up!" on the screen.

------------------------------------------------------------------------------------
"""
Expand Down
38 changes: 19 additions & 19 deletions vex/aim.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def spin_wheels(self, velocity1: int, velocity2: int, velocity3: int):
self.robot_send(message.to_json())

def set_xy_position(self, x, y):
"""sets the robots current position to the specified values"""
"""sets the robot's current position to the specified values"""
offset_radians = -math.radians(self.inertial.heading_offset)
origin_x = x * math.cos(offset_radians) - y * math.sin(offset_radians)
origin_y = y * math.cos(offset_radians) + x * math.sin(offset_radians)
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def calibrate(self):
#endregion Inertial - Action
#region Inertial - Mutators
def set_heading(self, heading):
"""sets the robots heading to a specified value"""
"""sets the robot's heading to a specified value"""
raw_heading = self.get_heading_raw()
# print("reset heading to %f, get_heading_raw(): %f" %(heading, raw_heading))
self.heading_offset = raw_heading - heading
Expand All @@ -1130,12 +1130,12 @@ def reset_heading(self):
self.set_heading(0)

def set_rotation(self, rotation):
"""sets the robots rotation to a specified value"""
"""sets the robot's rotation to a specified value"""
raw_rotation = self.get_rotation_raw()
self.rotation_offset = raw_rotation - rotation

def reset_rotation(self):
"""resets the robots rotation to 0"""
"""resets the robot's rotation to 0"""
self.set_rotation(0)

def set_crash_sensitivity(self, sensitivity=vex.SensitivityType.LOW):
Expand All @@ -1145,7 +1145,7 @@ def set_crash_sensitivity(self, sensitivity=vex.SensitivityType.LOW):
#endregion Inertial - Mutators
#region Inertial - Getters
def get_heading(self):
"""reports the robots heading angle. This returns a float in the range 0 to 359.99 degrees"""
"""reports the robot's heading angle. This returns a float in the range 0 to 359.99 degrees"""
raw_heading = self.get_heading_raw()
heading = math.fmod(raw_heading - self.heading_offset, 360)
#round to 2 decimal places
Expand All @@ -1162,7 +1162,7 @@ def get_heading_raw(self):
return raw_heading

def get_rotation(self):
"""returns the robots total rotation in degrees as a float.
"""returns the robot's total rotation in degrees as a float.
This measures how much the robot has rotated relative to its last reset point"""
raw_rotation = self.get_rotation_raw()
rotation = raw_rotation - self.rotation_offset
Expand All @@ -1178,7 +1178,7 @@ def get_rotation_raw(self):
return raw_rotation

def get_acceleration(self, axis: Union[vex.AxisType, vex.AccelerationType]):
""" returns the robots acceleration for a given axis."""
""" returns the robot's acceleration for a given axis."""
if axis in [vex.AxisType.X_AXIS, vex.AccelerationType.FORWARD]:
value = self.robot_instance._ws_status_thread.current_status["robot"]["acceleration"]["x"]
elif axis in [vex.AxisType.Y_AXIS, vex.AccelerationType.RIGHTWARD]:
Expand All @@ -1190,7 +1190,7 @@ def get_acceleration(self, axis: Union[vex.AxisType, vex.AccelerationType]):
return value

def get_turn_rate(self, axis: Union[vex.AxisType, vex.OrientationType]):
"""returns the robots gyro rate for a given axis in degrees per second (DPS). It returns a float from –1000.00 to 1000.00 degrees per second"""
"""returns the robot's gyro rate for a given axis in degrees per second (DPS). It returns a float from –1000.00 to 1000.00 degrees per second"""
if axis in [vex.AxisType.X_AXIS, vex.OrientationType.ROLL]:
value = self.robot_instance._ws_status_thread.current_status["robot"]["gyro_rate"]["x"]
elif axis in [vex.AxisType.Y_AXIS, vex.OrientationType.PITCH]:
Expand All @@ -1202,7 +1202,7 @@ def get_turn_rate(self, axis: Union[vex.AxisType, vex.OrientationType]):
return value

def get_roll(self):
"""returns the robots roll angle in the range –180.00 to 180.00 degrees as a float"""
"""returns the robot's roll angle in the range –180.00 to 180.00 degrees as a float"""
value = self.robot_instance.status["robot"]["roll"]
if type(value) == str:
value = float(value)
Expand All @@ -1211,7 +1211,7 @@ def get_roll(self):
return value

def get_pitch(self):
"""returns the robots pitch angle in the range –90.00 to 90.00 degrees as a float"""
"""returns the robot's pitch angle in the range –90.00 to 90.00 degrees as a float"""
value = self.robot_instance.status["robot"]["pitch"]
if type(value) == str:
value = float(value)
Expand All @@ -1220,7 +1220,7 @@ def get_pitch(self):
return value

def get_yaw(self):
"""returns the robots yaw angle in the range –180.00 to 180.00 degrees as a float"""
"""returns the robot's yaw angle in the range –180.00 to 180.00 degrees as a float"""
value = self.robot_instance.status["robot"]["yaw"]
if type(value) == str:
value = float(value)
Expand Down Expand Up @@ -1276,7 +1276,7 @@ def _return_transparency(self, color):
#region Screen - Cursor Print

def print(self, *args, **kwargs):
"""displays text on the robots screen at the current cursor position and font"""
"""displays text on the robot's screen at the current cursor position and font"""
try:
out=io.StringIO()
if 'end' not in kwargs:
Expand All @@ -1291,7 +1291,7 @@ def print(self, *args, **kwargs):
print(f"Error displaying text on screen: {e}")

def set_cursor(self, row, column):
"""sets the cursors (row, column) screen position"""
"""sets the cursor's (row, column) screen position"""
message = commands.ScreenSetCursor(row, column)
self.robot_instance.robot_send(message.to_json())

Expand Down Expand Up @@ -1323,7 +1323,7 @@ def get_column(self):
#endregion Screen - Cursor Print
#region Screen - XY Print
def print_at(self, *args, x=0, y=0, **kwargs):
"""displays text on the robots screen at a specified (x, y) screen coordinate. This method disregards the current cursor position"""
"""displays text on the robot's screen at a specified (x, y) screen coordinate. This method disregards the current cursor position"""
out=io.StringIO()
if 'end' not in kwargs:
kwargs['end'] = ""
Expand All @@ -1342,13 +1342,13 @@ def set_origin(self, x, y):
#region Screen - Mutators

def clear_screen(self, color=vex.Color.BLUE):
"""clears the robots screen of all drawings and text"""
"""clears the robot's screen of all drawings and text"""
r,g,b = self._return_rgb(color)
message = commands.ScreenClear(r, g, b)
self.robot_instance.robot_send(message.to_json())

def set_font(self, fontname: vex.FontType):
"""sets the font used for displaying text on the robots screen"""
"""sets the font used for displaying text on the robot's screen"""
message = commands.ScreenSetFont(fontname.lower())
self.robot_instance.robot_send(message.to_json())

Expand Down Expand Up @@ -1416,7 +1416,7 @@ def draw_circle(self, x: int, y: int, radius: int, color=None):
self.robot_instance.robot_send(message.to_json())

def show_file(self, filename: str, x: int, y: int):
"""draws a custom user-uploaded image on the robots screen at the specified (x, y) screen coordinate"""
"""draws a custom user-uploaded image on the robot's screen at the specified (x, y) screen coordinate"""
#TODO: alowed extensions are correct?
if filename[-3:] not in ("bmp", "png"):
raise InvalidImageFileException(f"extension is {filename[-3:]}; expected extension to be bmp or png")
Expand Down Expand Up @@ -1564,7 +1564,7 @@ def __set_sound_active(self):
self.robot_instance._ws_status_thread.sound_playing_flag_needs_setting = True # have it be set again after next status message

def play(self, sound: vex.SoundType, volume = 50):
"""plays one of the robots built-in sounds at a specified volume percentage.
"""plays one of the robot's built-in sounds at a specified volume percentage.
Since this is a non-waiting method, the robot plays the built-in sound and moves to
the next command without waiting for it to finish"""
message = commands.SoundPlay(sound.lower(), volume)
Expand Down Expand Up @@ -1885,7 +1885,7 @@ def get_data(self, type, count=8):
The AI Vision Sensor can detect signatures that include pre-trained objects, AprilTags, or configured Colors and Color Codes.

Color Signatures and Color Codes must be configured first in the AI Vision Utility in VEXcode before they can be used with this method.
The tuple stores objects ordered from largest to smallest by width, starting at index 0. Each objects properties can be accessed using its index.
The tuple stores objects ordered from largest to smallest by width, starting at index 0. Each object's properties can be accessed using its index.
An empty tuple is returned if no matching objects are detected.

#### Arguments:
Expand Down