Package me.autobot.lib.hardware.ws
Class WSSensorConnection
java.lang.Object
me.autobot.lib.hardware.Connection
me.autobot.lib.hardware.ws.WSSensorConnection
- Direct Known Subclasses:
LIDAR.WSLidarSensorConnection
A sensor connection to a websocket.
This means that another program is sending data to this program through a websocket.
This is useful for sensors that are not directly connected to the robot, or require an external program to run.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class me.autobot.lib.hardware.Connection
write
-
Constructor Details
-
WSSensorConnection
public WSSensorConnection()Creates a new websocket sensor connection.
-
-
Method Details
-
onUpdate
public void onUpdate(int[] data) Called when the websocket connection is updated.- Parameters:
data
- The data from the websocket connection. Array of integers from 0 to 255.
-
getId
public int getId()Gets the WS ID of the sensor connection.- Returns:
- The WS ID of the sensor connection
-