示例#1
0
  /**
   * Disable controller data streaming for a Robot
   *
   * @param robot the Robot to stream data from
   */
  public void disableControllerStreaming(Robot robot) {
    // Turn on stabilization and turn off back LED
    StabilizationCommand.sendCommand(robot, true);
    BackLEDOutputCommand.sendCommand(robot, 0.0f);

    // Disable data streaming and delete profile
    SetDataStreamingCommand.sendCommand(robot, 0, 0, 0, 0);
    DeviceMessenger.getInstance().removeAsyncDataListener(robot, mDataListener);
  }
示例#2
0
  /**
   * Enable controller data streaming with infinite packets
   *
   * @param robot the Robot to stream data from
   * @param divisor Divisor of the maximum sensor sampling rate (400 Hz)
   * @param packetFrames Number of samples created on the device before it sends a packet to the
   *     phone with samples
   * @param sensorMask Bitwise selector of data sources to stream
   */
  public void enableControllerStreaming(
      Robot robot, int divisor, int packetFrames, long sensorMask) {
    // Turn off stabilization and turn on back LED
    StabilizationCommand.sendCommand(robot, false);
    BackLEDOutputCommand.sendCommand(robot, 1.0f);

    // Request data streaming
    this.setDataStreaming(robot, divisor, packetFrames, sensorMask, 0);
  }