Skip to content

Conversation

@aidnem
Copy link
Contributor

@aidnem aidnem commented Jan 22, 2026

Adds:

  • Hood subsystem with hood constants, test modes, etc
  • DependencyOrderedExecutor to schedule tasks in periodic
  • DirectedAcyclicGraph implementation to support DOE
  • clamps to shot calculator to more accurately reflect capabilities
  • Shot calculator sends goal angles to turret and hood and reads actual position from turret and hood for shot projection

Closes #33

@aidnem aidnem linked an issue Jan 22, 2026 that may be closed by this pull request
2 tasks
@godmar
Copy link
Contributor

godmar commented Jan 23, 2026

This is not how you implement Kahn's. Your implementation is $O(n^2)$ if I see this correctly. It can be done in $O(n + m)$.
Basically, the graph representation should use adjacency lists in the forward direction. That is, if $a \rightarrow b$ and $a \rightarrow c$ are dependencies, you'd have $a \rightarrow [b, c]$. This will allow you to implement the part where a node's successors are found using a simple loop over the successors.

For the incoming part, like I said, don't actually remove edges. Simply keep a count incomingCount in a Map that you initialize with the number of incoming edges (can be done in $O(n + m)$ ), and then decrement the count until it reaches zero. This incomingCount map will be temporary to the routine that computes the top sort.

@aidnem
Copy link
Contributor Author

aidnem commented Jan 23, 2026

I've reimplemented it as you described. Thanks for letting me know.

@aidnem
Copy link
Contributor Author

aidnem commented Jan 25, 2026

Verification:

image

Here's the mechanism position (blue) following the reference setpoint (gold) as it follows my commanded input (tan).

@aidnem aidnem marked this pull request as ready for review January 25, 2026 17:29
@aidnem aidnem requested a review from godmar January 25, 2026 17:29
Copy link
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

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

I just made a brief run through, will look at it more closely later.

@aidnem
Copy link
Contributor Author

aidnem commented Jan 26, 2026

I have fixes for all comments done but my wifi is out so I cannot push changes until it comes back.

@aidnem aidnem requested a review from godmar January 27, 2026 02:13
@aidnem
Copy link
Contributor Author

aidnem commented Jan 27, 2026

@godmar would you mind looking over some of the architecture changes I made and seeing if you find them to be cleaner than before?

@godmar
Copy link
Contributor

godmar commented Jan 27, 2026

@godmar would you mind looking over some of the architecture changes I made and seeing if you find them to be cleaner than before?

I'm looking at it. Who is going to resolve all these conversation above? I understood that it would be your responsibility?

Copy link
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

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

please check the math in controlToGoalHeading

@godmar
Copy link
Contributor

godmar commented Jan 27, 2026

Side note: with the new test mode manager where each subsystem has its own, the isSubsystemInTestMode functions could be simplified by adding a method to the TestModeManager that returns whether it's in the None state or not (all others would then be presumed to be testing states).

(Implemented here in Theta's branch.)

@aidnem
Copy link
Contributor Author

aidnem commented Jan 27, 2026

Who is going to resolve all these conversation above? I understood that it would be your responsibility?
Yes, sorry I missed a couple when I was resolving them. I left the ones where you asked questions open so that you could resolve if satisfied by the answers or respond if you wanted more clarification/a different decision.

I have to add field locations and then fix the turret math. Those will be my next 2 tasks.

@aidnem
Copy link
Contributor Author

aidnem commented Jan 28, 2026

As a little extra verification of our dependency ordered executor:

Here is the graph with all subsystems enabled:

image

Here are some graphs after disabling 1 subsystem at a time:

  • No homing switch:

    image
  • No turret:

    image
  • No hood:

    image

Now missing 2 systems:

  • No homing switch nor turret:

    image
  • No homing switch nor hood:

image
  • Homing switch but no turret nor hood:

    image

All of these seem to make sense to me. Please let me know if you think any of them are wrong.

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.

Begin adding FieldConstants to manage field locations via JSON Program hood

3 participants