-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DO NOT MERGE] Control hub demo #83
Draft
LandryNorris
wants to merge
162
commits into
feature/control-hub
Choose a base branch
from
control-hub-demo
base: feature/control-hub
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 158 commits
Commits
Show all changes
162 commits
Select commit
Hold shift + click to select a range
adf1a10
Create control hub module
LandryNorris f151799
Merge in main
LandryNorris aa4125d
Try to connect to control hub
LandryNorris c923422
Try to connect to control hub
LandryNorris 4d227a2
Get module address of hub connected over wifi
LandryNorris f03cad7
Check version of RC app
LandryNorris eaa0ce6
Bump required RC version
LandryNorris 3d48a61
Change how semver requirement is declated
LandryNorris 5ce6863
Remove error output if no WiFi hub connected
LandryNorris 2b4d5ee
merge main
LandryNorris c0cb9a4
Detect USB control hubs
LandryNorris ce97332
Fix connection to USB expansion hubs
LandryNorris b4de2a4
Add explicit dependency on control-hub
LandryNorris 5ad4ef3
Restructure Control Hub module to export interface and implement with…
LandryNorris 41ae6a3
Show serial number for parent expansion hub
LandryNorris 27ffa13
Remove ParentControlHub, since control hubs will always be parents
LandryNorris a3712d3
Fix wording in package description
LandryNorris a91ee0f
Create core module
LandryNorris e8116ea
Move adbkit usage out of control hub module
LandryNorris f4a6585
Remove override of target
LandryNorris f4afa3c
Add note on dependencies in README
LandryNorris ab9b52a
loosen version requirement for get-port
LandryNorris ed8caaa
Send address in commands
LandryNorris 15f626f
Send commands when control hub methods called
LandryNorris d8250ca
merge in main
LandryNorris ad4b33f
Use control hubs for commands and fix incorrect key
LandryNorris e659ed4
apply changes to be compatible with new manual control changes
LandryNorris b0ed49b
add timeout to control hub websocket commands
LandryNorris 9999f8b
Add todo for closing (and resetting op mode) when websocket is closed
LandryNorris 5463565
Track whether the control hub is connected
LandryNorris 1598644
convert some methods to private
LandryNorris 344acf7
remove logs
LandryNorris dae4912
update servo command
LandryNorris 69d2a4a
make compatible with latest control hub changes
LandryNorris 0b8ac61
use new id system for control hubs
LandryNorris eb7a35a
update to latest changes in control hub
LandryNorris 1527056
Properly handle children hierarchy on Control Hub
LandryNorris a0f433e
connect to other expansion hubs
LandryNorris 7dff8a2
Allow user to specify a hub connected to a control hub
LandryNorris a9394d0
allow user to specify just control hub
LandryNorris 403a672
change names of some parameters
LandryNorris 7ac2749
handle specified parent
LandryNorris fc2ef25
Update motor power range and document motor power method
LandryNorris ad2b3f5
Add sample for setting target position
LandryNorris 314019e
Convert range of motor input to [-1,1]
LandryNorris 49d08c1
Add documentation
LandryNorris 397db54
Improve wording
LandryNorris 464a6b6
Reqire motor parameter for running motors
LandryNorris b78b182
Create MotorMode enum
LandryNorris 5bafeae
Add clarifying comment
LandryNorris a064659
Add motor commands
LandryNorris 011722b
Change order of command declaration
LandryNorris 3ddfe41
Document motor methods
LandryNorris 223a201
Improve wording
LandryNorris 1960f1d
Add documentation
LandryNorris 8d89d03
Add motor command to get the current encoder position
LandryNorris 5c1c347
Improve documentation
LandryNorris 4c09961
Create motor encoder reset command
LandryNorris 8d4e29e
move motor commands to 'command' folder for consistency
LandryNorris a76907e
Add continuous flag to motor encoder
LandryNorris 11ac986
Publish
LandryNorris 961dad4
Stop motors when sigint signal received
LandryNorris 9808e64
Rename motor modes to be more clear
LandryNorris 538e81e
Add motor position command
LandryNorris e5c59e3
Fix uninitialized motor error for position command
LandryNorris e85ae0b
Add documentation
LandryNorris 1f65dcf
apply latest changes to control hub
LandryNorris aa5b93f
Convert to commands for sample
LandryNorris ca78fdc
Add documentation
LandryNorris d95b002
Document getDigitalAllInputs
LandryNorris 660a0df
Fix missed merge conflict
LandryNorris f703a45
Create type for digital state
LandryNorris 64b740a
Make High and Low readonly
LandryNorris 949beb4
Create DigitalChannelDirection type
LandryNorris bac4567
Rename digital methods
LandryNorris aa4ad58
Error out if user provides anything other than high, low, 0, or 1
LandryNorris 4c1d692
Set direction correctly for write
LandryNorris 2c04732
Add continuous flag
LandryNorris 5d25f1c
depend on specific version of expansion hub
LandryNorris cb0beb5
Add documentation
LandryNorris 99a8f9d
Add module for distance sensor
LandryNorris 058da2d
Fix a few bugs in distance sensor setup
LandryNorris 1089257
Fix errors in setup. Sensor now runs continuously, but values not cor…
LandryNorris db87026
separate code into methods
LandryNorris 22738b1
Get distance sensor working
LandryNorris 31449cd
Increase duration of sample
LandryNorris 8fcb1c7
Add note about close method
LandryNorris 0f36047
Abstract away the driver, providing a lighter-weight DistanceSensor c…
LandryNorris 09f27db
Create interface for distance sensor
LandryNorris 6cd64b3
Add continuous flag to distance command
LandryNorris 7a5cbeb
Update module description
LandryNorris 9f79dca
depend on specific versions of other libraries
LandryNorris 2fe4774
higher-level I2C methods
LandryNorris eee9bba
Add i2c methods for distance sensor
LandryNorris 96316a7
update to work with latest control hub
LandryNorris 21c56d7
pass in hub for servo command
LandryNorris 12f920b
add bulk input command
LandryNorris fc8992b
refine LED commands
LandryNorris b6bfb6e
exit process when sigint
LandryNorris 4a7dd7b
apply latest control hub changes
LandryNorris b3cf1d0
setup rollup
LandryNorris 30f69c2
remove node-addon issues
LandryNorris 1477ba3
always use control hub
LandryNorris 9188411
Only allow Control Hub and its RS-485 children for demo purposes
NoahAndrews 0caca2a
Update some field and command names
NoahAndrews 2e8178c
Fix opening ExHubs connected to a CH via RS-485
NoahAndrews 64e777e
Fix listing ExHubs connected to a CH via RS-485
NoahAndrews ab05dfe
Don't list the Control Hub as its own child
NoahAndrews 37dfcdc
Fix motor in open loop mode connected to CH not stopping immediately
NoahAndrews f71f7b5
Fix motor in open loop mode connected to ExHub not stopping immediately
NoahAndrews 92ef94a
Add bug report in TODO
NoahAndrews 49534b8
Fix bulkInput command (old version was interpreted as needing an argu…
NoahAndrews 8996933
Fix program name for demo
NoahAndrews 0a96a07
Add missing space
NoahAndrews 0d2d6b8
Improve name of 5V rail command
NoahAndrews 46eb5dc
Fix TimeoutError when closing Control Hub
NoahAndrews f246567
Disable distance command for demo
NoahAndrews 9330e33
require user to specify led pattern steps
LandryNorris 4d24909
Fix distance command
LandryNorris cd6d1e7
Make bulk input continuous
LandryNorris e21fe2e
Add status updates
LandryNorris 3efe80b
Add log hint command
LandryNorris 73ff197
Add failsafe command
LandryNorris bfaaa7b
add query interface command
LandryNorris 86c8d63
Add setHubAddress command and refactor how hubs get closed
LandryNorris df8bdd2
run servo before failsafe for testing
LandryNorris 59611e9
Add version command
LandryNorris f706f14
return proper values for bulk input
LandryNorris 1db5045
Add logs using getters
LandryNorris cd2149b
Add motor pid and alert commands
LandryNorris a4ebe01
Add getters to servo command
LandryNorris c1bd420
Add commands for rest of analog inputs
LandryNorris 1b917be
Add commands for readall/writeall
LandryNorris 1ddb59d
use LED getters in commands
LandryNorris 7783da1
fix issues with status command
LandryNorris e49fdd8
Add debug level command
LandryNorris 0b12fb6
Remove methods that don't make sense for control hub
LandryNorris e522190
fix bugs
LandryNorris 37e7904
Parse readVersion
LandryNorris d21c1c9
rename ControlHubConnected
LandryNorris f1bff37
Add check for if a RevHub is a Control Hub
LandryNorris b391b5c
Clarify naming
LandryNorris 8ce1f90
fix copy/paste problems
LandryNorris 8ea5a8e
clarify valid values for loglevel
LandryNorris 2623e81
Document valid values for level
LandryNorris 82c4b23
merge in main
LandryNorris 3af96cb
merge in main
LandryNorris aa036c3
merge in feature/control-hub
LandryNorris 2b0d902
formatting in HubStringify and restore deleted method
LandryNorris 90cd653
merge in main
LandryNorris 15ba6d2
Don't add embedded as a child of control hub
LandryNorris 73f497f
properly close control hub
LandryNorris b0a91ff
fixes for adding children
LandryNorris d2f44d6
update commands to match latest spec
LandryNorris dcade5c
merge in main
LandryNorris 2f1b705
add IMU measurement
LandryNorris 88bcfa3
merge in control hub branch
LandryNorris 88c77b0
merge in control hub branch
LandryNorris cd1b443
Merge branch 'feature/control-hub' into control-hub-demo
LandryNorris acd1dcc
remove unused file
LandryNorris b5fc451
merge in control hub branch
LandryNorris bc1692d
merge in main
LandryNorris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
node.exe output.js %* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ControlHubInternal } from "./internal/ControlHub.js"; | ||
import { ControlHub, ExpansionHub } from "@rev-robotics/rev-hub-core"; | ||
|
||
export async function openConnectedControlHub(): Promise<ControlHub | undefined> { | ||
try { | ||
return await createWiFiControlHub(); | ||
} catch (e: any) { | ||
return undefined; | ||
} | ||
} | ||
|
||
async function createWiFiControlHub(): Promise<ControlHub> { | ||
let hub = new ControlHubInternal("Placeholder"); | ||
|
||
if (!(await hub.isWiFiConnected())) { | ||
throw new Error("Hub is not connected via WiFi"); | ||
} | ||
|
||
await hub.open("192.168.42.1", 8080); | ||
|
||
return hub; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to reduce the occurance of errors saying that 'node-addon-api' is not installed when running 'npm install'.