public abstract class TelloDrone extends Object implements AutoCloseable
WifiDroneFactory).| Constructor and Description |
|---|
TelloDrone() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStateListener(StateListener listener)
Adds a
StateListener to this drone, which can then receive new TelloDroneStates from this drone |
void |
addVideoListener(VideoListener listener)
Adds a
VideoListener to this drone, which can then receive new TelloVideoFrames from this drone |
void |
backward(int cm)
Instructs this drone to move backward a certain amount of centimeters.
|
void |
close()
Disconnects and frees the resources of this tello drone.
|
abstract void |
connect()
Estabilishes a connection with the tello drone.
|
abstract void |
curve(int x1,
int y1,
int z1,
int x2,
int y2,
int z2,
int speed)
Instructs this drone to fly a curve via one relative point to another
|
abstract void |
disconnect()
Disconnects from this tello drone.
|
void |
down(int cm)
Instructs this drone to move down a certain amount of centimeters.
|
abstract void |
emergency()
Instructs this drone to turn off all motors.
|
abstract double[] |
fetchAcceleration()
Fetch the current acceleration force of this drone.
|
abstract int[] |
fetchAttitude()
Fetches the current attitude of this drone.
|
abstract double |
fetchBarometer()
Fetch the barometer value of this drone.
|
abstract int |
fetchBattery()
Fetch the current battery level of this drone.
|
abstract int |
fetchHeight()
Fetch the current altitude of this drone.
|
abstract int |
fetchMotorTime()
Fetch the current running duration of the motors/airborne time.
|
abstract double |
fetchSpeed()
Fetch the current speed setting of this drone.
|
abstract int |
fetchTemperature()
Fetch the current temperature of this drone (own temperature, not outside temperature).
|
abstract int |
fetchTOFDistance()
Fetch the distance ahead using the time-of-flight sensor.
|
abstract int |
fetchWifiSnr()
Fetch the wifi signal-noise-ratio from this drones perspective.
|
abstract void |
flip(FlipDirection direction)
Instructs this drone to perform a flip in the direction you specify
|
void |
forward(int cm)
Instructs this drone to move forward a certain amount of centimeters.
|
TelloDroneState |
getCachedState()
Fetches the last received
TelloDroneState of this drone |
List<StateListener> |
getStateListeners()
Lists all
StateListeners currently attached to this drone |
TelloVideoExportType |
getVideoExportType()
Retrieves the current
TelloVideoExportType for this drone |
List<VideoListener> |
getVideoListeners()
Lists all
VideoListeners currently attached to this drone |
abstract boolean |
isConnected()
Retrieves the connection state of this drone.
|
abstract boolean |
isStreaming()
Fetches whether streaming is currently enabled on this drone
|
abstract void |
land()
Instructs this drone to land.
|
void |
left(int cm)
Instructs this drone to move to the left a certain amount of centimeters.
|
abstract void |
move(int x,
int y,
int z,
int speed)
Instructs this drone to move to a relative position (x, y, z) with a set speed
|
abstract void |
moveDirection(MovementDirection direction,
int cm)
Instructs this drone to move a certain amount of centimeters in one direction.
|
boolean |
removeStateListener(StateListener listener)
Removes a
StateListener from this drone, which will no longer receive TelloDroneStates |
boolean |
removeVideoListener(VideoListener listener)
Removes a
VideoListener from this drone, which will no longer receive TelloVideoFrames |
void |
right(int cm)
Instructs this drone to move to the right a certain amount of centimeters.
|
abstract void |
sendRemoteControlInputs(int lr,
int fb,
int ud,
int yaw)
Send remote control input to this drone
|
void |
setCachedState(TelloDroneState cachedState)
Set the last received
TelloDroneState of this drone |
abstract void |
setSpeed(int speed)
Sets the flying speed of this drone
|
abstract void |
setStreaming(boolean stream)
Instruct this drone to enable/disable streaming.
|
void |
setVideoExportType(TelloVideoExportType videoExportType)
Sets the current
TelloVideoExportType for this drone. |
abstract void |
setWifiSSIDAndPassword(String ssid,
String password)
Changes your tello wifi name (ssid) and password.
|
abstract void |
takeoff()
Instructs this drone to take off.
|
abstract void |
turn(TurnDirection direction,
int degrees)
Instructs this drone to turn a certain amount of degrees in one direction
|
void |
turnLeft(int degrees)
Instructs this drone to turn left a certain amount of degrees
|
void |
turnRight(int degrees)
Instructs this drone to turn right a certain amount of degrees
|
void |
up(int cm)
Instructs this drone to move up a certain amount of centimeters.
|
public void close()
close in interface AutoCloseablepublic abstract void connect()
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If communication with the tello drone produced invalid input or
the wifi network was set up incorrectly. Also thrown if you called
connect() twice.TelloCommandTimedOutException - If the tello drone did not answer in time.TelloCustomCommandException - If the tello drone answered with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the tello drone answered with an unspecified error (possibly battery too low).public abstract void disconnect()
public abstract boolean isConnected()
public abstract void takeoff()
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error (possibly battery too low).public abstract void land()
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract boolean isStreaming()
public abstract void setStreaming(boolean stream)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
VideoListener
using addVideoListener(VideoListener).stream - true: drone should start streaming, false: drone should stop streaming.TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract void emergency()
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract void moveDirection(MovementDirection direction, int cm) throws TelloNetworkException, TelloCommandTimedOutException, TelloCustomCommandException, TelloNoValidIMUException, TelloGeneralCommandException
direction - The direction the drone should move incm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public abstract void turn(TurnDirection direction, int degrees) throws TelloNetworkException, TelloCommandTimedOutException, TelloCustomCommandException, TelloNoValidIMUException, TelloGeneralCommandException
direction - The direction to turn the dronedegrees - The amount of degrees to turnTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public abstract void flip(FlipDirection direction) throws TelloNetworkException, TelloCommandTimedOutException, TelloCustomCommandException, TelloNoValidIMUException, TelloGeneralCommandException
direction - The direction to perform the flip toTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error (possibly battery too low).TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public abstract void move(int x,
int y,
int z,
int speed)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
x - Amount of centimeters to move on the x-Axis (left/right)y - Amount of centimeters to move on the y-Axis (forward/backward)z - Amount of centimeters to move on the z-Axis (up/down)speed - Flying speedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public abstract void curve(int x1,
int y1,
int z1,
int x2,
int y2,
int z2,
int speed)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
x1 - Amount of centimeters to the first point on the x-Axis (left/right)y1 - Amount of centimeters to the first point on the y-Axis (forward/backward)z1 - Amount of centimeters to the first point on the z-Axis (up/down)x2 - Amount of centimeters to the second point on the x-Axis (left/right)y2 - Amount of centimeters to the second point on the y-Axis (forward/backward)z2 - Amount of centimeters to the second point on the z-Axis (up/down)speed - Flying speedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public abstract void setSpeed(int speed)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
speed - Flying speedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract void sendRemoteControlInputs(int lr,
int fb,
int ud,
int yaw)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloGeneralCommandException
lr - Left/right inputfb - Forward/Backward inputud - Up/Down inputyaw - Rotation inputTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract void setWifiSSIDAndPassword(String ssid, String password) throws TelloNetworkException, TelloCommandTimedOutException, TelloCustomCommandException, TelloGeneralCommandException
ssid - New wifi ssidpassword - New wifi passwordTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract double fetchSpeed()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int fetchBattery()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int fetchMotorTime()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int fetchHeight()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int fetchTemperature()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int[] fetchAttitude()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract double fetchBarometer()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract double[] fetchAcceleration()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int fetchTOFDistance()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public abstract int fetchWifiSnr()
throws TelloCommandTimedOutException,
TelloNetworkException,
TelloCustomCommandException,
TelloGeneralCommandException
TelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.public void up(int cm)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
cm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void down(int cm)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
cm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void left(int cm)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
cm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void right(int cm)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
cm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void forward(int cm)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
cm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void backward(int cm)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
cm - The amount in centimeters to be movedTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void turnLeft(int degrees)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
degrees - The amount of degrees to turnTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void turnRight(int degrees)
throws TelloNetworkException,
TelloCommandTimedOutException,
TelloCustomCommandException,
TelloNoValidIMUException,
TelloGeneralCommandException
degrees - The amount of degrees to turnTelloNetworkException - If there was an error sending the command or receiving the result.TelloCommandTimedOutException - If the drone does not answer.TelloCustomCommandException - If the drone responds with a custom error message.
Use TelloCustomCommandException.getReason() to fetch the custom error message.TelloGeneralCommandException - If the drone responds with an unspecified error.TelloNoValidIMUException - If the IMU is not correctly calibrated or the ground beneath the drone does.
not provide enough textual features.public void addVideoListener(VideoListener listener)
VideoListener to this drone, which can then receive new TelloVideoFrames from this dronelistener - The listener to be addedpublic boolean removeVideoListener(VideoListener listener)
VideoListener from this drone, which will no longer receive TelloVideoFrameslistener - The listener to be removedpublic List<VideoListener> getVideoListeners()
VideoListeners currently attached to this droneVideoListenerspublic void addStateListener(StateListener listener)
StateListener to this drone, which can then receive new TelloDroneStates from this dronelistener - The listener to be addedpublic boolean removeStateListener(StateListener listener)
StateListener from this drone, which will no longer receive TelloDroneStateslistener - The listener to be removedpublic List<StateListener> getStateListeners()
StateListeners currently attached to this droneStateListenerspublic TelloDroneState getCachedState()
TelloDroneState of this droneTelloDroneStatepublic void setCachedState(TelloDroneState cachedState)
TelloDroneState of this dronecachedState - A new TelloDroneState to be cached for this dronepublic TelloVideoExportType getVideoExportType()
TelloVideoExportType for this dronepublic void setVideoExportType(TelloVideoExportType videoExportType)
TelloVideoExportType for this drone. Please note that it may take a few seconds for the
new type to be applied.videoExportType - The new video export typeCopyright © 2020. All rights reserved.