@Override
    public void driveCommand(short velocity, short radius)
            throws RoombaIFException {
        checkIsOpened("driveCommand");
        if (velocity > 500) {
            velocity = 500;
        } else if (velocity < -500) {
            velocity = -500;
        }
        if ((radius > 2000) & (radius != 32767)) {
            radius = 2000;
        }
        if ((radius < -2000) & (radius != -32768)) {
            radius = -2000;
        }
        byte[] c = {DRIVE_COMMAND, highByte(velocity), lowByte(velocity),
            highByte(radius), lowByte(radius)};
        writeBytes(c);
    }