Skip to content

SimDevice Types for CAN Wrapping HALSIM Library #6917

Closed Answered by azaleacolburn
azaleacolburn asked this question in Q&A
Discussion options

You must be logged in to vote

So it turns out that WPILib gets the type and id (which is sent over the WebSocket connection as the device field) by splitting the name you pass in when constructing the SimDevice by the delimiter ":". So all we need to do is adhere to the particular naming convention of "[DeviceType]:[DeviceName]" and then the DeviceId gets tacked on there as well by WPILib. For example: "CANMotor:CANSparkMax[1]"

Function found here
We couldn't find this anywhere in documentation, it was discovered by @HunterBarclay while he was perusing the WPILib codebase.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@PeterJohnson
Comment options

Answer selected by azaleacolburn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants