Skip to content

Accelerometer Implementation [AARD-1924] #1234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

ryanzhangofficial
Copy link
Member

Finish accelerometer implementation for code simulation.

Jira Ticket

Symptom

The accelerometer (ADXL362) for code simulation wasn't fully implemented last year. Using the built in WPILib accelerometer only returns static data.

Solution

Implemented Accel and ADXL362 classes using SimDevice.

Verification

Successfully read values by adding the below code to simulationPeriodic in the JavaSample Robot.java file. (Didn't add additional sample code, except modified imports, as part of PR though):
double accelX = m_Accel.getX(); double accelY = m_Accel.getY(); double accelZ = m_Accel.getZ(); System.out.println(String.format("Accelerometer - X: %.3f g, Y: %.3f g, Z: %.3f g", accelX, accelY, accelZ));


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@ryanzhangofficial ryanzhangofficial marked this pull request as ready for review July 23, 2025 21:51
@ryanzhangofficial ryanzhangofficial requested review from a team as code owners July 23, 2025 21:51
@AlexD717 AlexD717 added the codesim Code simulation related task. label Jul 23, 2025
Copy link
Collaborator

@Dhruv-0-Arora Dhruv-0-Arora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be still under development [build errors & biome checks]

@ryanzhangofficial ryanzhangofficial force-pushed the ryan/1924/accelerometer-implementation branch from 037a126 to 08dd270 Compare August 6, 2025 17:13
Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There looks to be a circular dependency issue between SimAI and SimInput - when I try to run the dev server I get this issue, and the page doesn't load:

SimAI.ts:62 Uncaught ReferenceError: Cannot access 'SimInput' before initialization
    at SimAI.ts:62:37
(anonymous) @ SimAI.ts:62
SimAI.ts:62 Uncaught (in promise) ReferenceError: Cannot access 'SimInput' before initialization
    at SimAI.ts:62:37
(anonymous) @ SimAI.ts:62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codesim Code simulation related task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants