Robot Not a Dev? Pre-order Now
Not a Dev?

Tutorial | Using Sensors, WebSockets, and Locomotion


Tutorial | Using Sensors, WebSockets, and Locomotion :steam_locomotive:

In this tutorial, we write a program that commands Misty to drive in a straight line for a designated period of time and stop if she encounters an object in her path. We do this by combining Misty’s DriveTime locomotion command with information received from the TimeOfFlight and LocomotionCommand WebSocket connections. In this tutorial, you’ll learn:

  • How to subscribe to data from Misty’s WebSocket connections
  • How to use the lightSocket.js helper tool
  • How to write callbacks that use data from WebSocket connections to allow Misty to make decisions about what to do in different situations

Grab the code from GitHub!


Great stuff! This sample nicely builds on the first, LED sample. It’s that next step after “Hello, World!” that gets you used to handling WebSocket data.