Skip to content

Conversation

Copy link

Copilot AI commented Sep 24, 2025

Problem

The Chassis object was being instantiated as a single, unreadable line with 9 parameters, making it difficult to understand what each parameter represents and hard to modify individual values:

Chassis *chassis = new Chassis(PORT19, PORT14, PORT13, Left, Right, ((M_PI * 1.98298) / 360.0), -0.640625, 1.625, true);

Solution

Reorganized the Chassis constructor call into a multi-line format with descriptive comments for each parameter:

// Create chassis object with sensor ports and configuration
Chassis *chassis = new Chassis(
  PORT19,                           // Inertial sensor port
  PORT14,                           // Forward tracking wheel port 
  PORT13,                           // Sideways tracking wheel port
  Left,                             // Left motor group (FrontLeft, MiddleLeft, BackLeft)
  Right,                            // Right motor group (FrontRight, MiddleRight, BackRight)
  ((M_PI * 1.98298) / 360.0),      // Inches to degrees conversion ratio for tracking wheels
  -0.640625,                        // Forward tracking wheel distance from center (inches)
  1.625,                            // Sideways tracking wheel distance from center (inches)
  true                              // Enable debug logging
);

Benefits

  • Improved Readability: Each parameter is clearly documented with its purpose and units
  • Easy Modification: Individual parameters can be changed without affecting the entire line
  • Self-Documenting: Comments explain hardware connections and calibration values
  • Maintainable: Follows VEX robotics coding best practices for robot configuration

This change makes the robot configuration much more accessible to team members and easier to tune for different robot builds.

Fixes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Organize the method when creating a new Chassis object.</issue_title>
<issue_description>Currently the Chassis object is being instantiated as such:

Chassis *chassis = new Chassis(PORT19, PORT14, PORT13, Left, Right, ((M_PI * 1.98298) / 360.0), -0.640625, 1.625, true);

Add in comments and separate everything out to individual lines to make it easier to modify it.</issue_description>

<agent_instructions>Refer to the JAR Template repository for the comments and how it should be strucuted as this is fairly similar to that.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

---- **Additional instructions:**

Refer to the JAR Template repository for the comments and how it should be strucuted as this is fairly similar to that.

Fixes #15


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 24, 2025 23:00
Co-authored-by: Github11200 <78944617+Github11200@users.noreply.github.com>
Co-authored-by: Github11200 <78944617+Github11200@users.noreply.github.com>
Copilot AI changed the title [WIP] Organize the method when creating a new Chassis object. Organize Chassis object instantiation with comments and separate lines Sep 24, 2025
Copilot AI requested a review from Github11200 September 24, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organize the method when creating a new Chassis object.

2 participants