Skip to content
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

Add spec for commands #61

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

LandryNorris
Copy link
Contributor

No description provided.

@@ -2,31 +2,1081 @@

## Implementation Note

We don't want to fight with a user Op Mode over control of the hardware; that would be a recipe for trouble. Instead, my idea is to work within the Op Mode system. I would add a built-in, hidden Manual Control Op Mode (MCOM) that would provide hardware access to the WebSocket API. Using the API would auto-start the MCOM, and the user could go back to normal operation by stopping the MCOM from the Driver Station, like any other Op Mode. If a different Op Mode is already running, an error will be reported via the manual control API, and the original Op Mode will keep running.
We don't want to fight with a user Op Mode over control of the hardware; that would be a recipe for trouble. Instead, my idea is to work within the Op Mode system. I would add a built-in, hidden Manual Control Op Mode (MC) that would provide hardware access to the WebSocket API. Using the API would auto-start the MC, and the user could go back to normal operation by stopping the MC from the Driver Station, like any other Op Mode. If a different Op Mode is already running, an error will be reported via the manual control API, and the original Op Mode will keep running.

Choose a reason for hiding this comment

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

The Manual Control Op Mode is still abbreviated MCOM, if it's abbreviated. MC is just the namespace name, and an abbreviation for the concept of Manual Control, which can apply to both the Manual Control [Web Socket] API and the Manual Control Op Mode.

Comment on lines 9 to +30
1. **Command: Get connected USB devices**

Sending this command starts the MCOM, which does a USB scan, so that all connected REV modules can be controlled, even if they aren't included in the current configuration file. The response also includes modules that are configured, but not currently attached. The attachment and configuration state of each device is specified in the response. The response also includes an API version number.
Sending this command starts the MC, which does a USB scan, so that all connected REV modules can be controlled, even if they aren't included in the current configuration file. The response also includes modules that are configured, but not currently attached. The attachment and configuration state of each device is specified in the response. The response also includes an API version number.

3. **Notification: MCOM stopped**
2. **Notification: MC stopped**

The API client needs to know when the MCOM is stopped, and it has lost control of the hardware. It can recover from this by sending the command to get connected devices again.
The API client needs to know when the MC is stopped, and it has lost control of the hardware. It can recover from this by sending the command to get connected devices again.

4. **Command: Stop MCOM**
3. **Command: Stop MC**

The API client needs the ability to specify when it is done performing manual control.

5. **Command: Discover child modules**
4. **Command: Discover child modules**

Performs Discovery for all specified serial numbers
Performs Discovery for all specified serial numbers

6. **Command: Start sending IMU data**

Starts sending the IMU data notification at a specified frequency. Returns an error if the device is not a Control Hub.
5. **Command: Start sending IMU data**

7. **Notification: IMU data**
Contains the latest IMU data from the Control Hub
Starts sending the IMU data notification at a specified frequency. Returns an error if the device is not a Control Hub.

6. **Notification: IMU data**
Contains the latest IMU data from the Control Hub

Choose a reason for hiding this comment

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

This is all pretty out of date, non-specific, and isn't formatted like the rest. All of the information here should be moved to the next part of the spec.

Obviously, the IMU part of the spec doesn't yet exist, so just add a TODO for that.

@LandryNorris LandryNorris marked this pull request as draft July 11, 2023 20:14
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.

2 participants