API Reference

Jeff Rousseau edited this page Jan 12, 2017 · 14 revisions
Clone this wiki locally

on(event, callback)

Attach an event handler function for a given event.

Parameters:

  • event: the event to trigger callback on (see event list below)
  • callback: function to call once event occurs

off(event)

Tells the Create to stop listening for a particular event

Parameters:

  • event: the event to suppress callbacks on (see event list below)

Event list:

ready

The ready event is triggered once the Create has started up and is ready to accept further commands.

Data passed to callback: None

bump

A bump event is triggered when one of the Create's 3 bumper is hit.

Data passed to callback: Object with 'which' property with possible values of 'left', 'right' or 'forward'

wheeldrop

A wheeldrop event is triggered when one of the Create's wheels can no longer can sense the ground.

Data passed to callback: None

directDrive(leftWheel, rightWheel)

Sends individual velocity commands to each Create wheel.

Parameters:

  • leftWheel: velocity in mm/s
  • rightWheel: velocity in mm/s

drive(forwardVelocity, radius)

Sends the Create forward at the given forward velocity and radius.

Parameters:

  • forwardVelocity: velocity in mm/s
  • radius: radius of arc to perform in mm

rotate(rotationalVelocity)

Sends the Create rotating at the given velocity in mm/s

Parameters:

  • rotationalVelocity: velocity in mm/s