Class CommandSocket

Inheritance Relationships

Base Type

Class Documentation

class CommandSocket : public BaseSocket

Socket class that handles the communication of commands to the tello.

Public Functions

CommandSocket(asio::io_service &io_service, const std::string &drone_ip, const std::string &drone_port, const std::string &local_port, int n_retries_allowed = 1, int timeout = 7)

Constructor.

Return
none
Parameters
  • io_service: io_service object used to handle all socket communication
  • drone_ip: ip address of drone
  • drone_port: port number on the drone
  • local_port: port on the local machine used to communicate with the drone port mentioned above
  • n_retries_allowed: numebr of retries allowed if a response is not received from the drone before sending the next command in the execution queue
  • timeout: number of seconds after which a command is said to have failed to be sent

void executeQueue()

Starts execution of the command queue.

Return
void

void addCommandToQueue(const std::string &cmd)

Adds the command to the execution queue.

Return
void
Parameters
  • cmd: command to be added to the end of the execution queue

void addCommandToFrontOfQueue(const std::string &cmd)

Adds the command to the front of the execution queue.

Return
void
Parameters
  • cmd: command to be added to the end of the execution queue

void clearQueue()

clears the execution queue

Return
void

void stopQueueExecution()

stop the queue execution

Return
void

void removeNextFromQueue()

remove the command at the front of the execution queue

Return
void

void doNotAutoLand()

will set the bool value that prevents automatic landing due to no commands sent timeout

Return
void

void allowAutoLand()

will unset the bool value that prevents automatic landing due to no commands sent timeout

Return
void

void emergency()

sends the “emergency” command to the drone that will cause the motors to stop immediately and stops queue exection as well

Return
void

void stop()

sends the “stop” command to the drone ad stops queue execution

Return
void

bool isExecutingQueue()

queries whether queue execution is enabled.

Return
bool whether queue execution is enabled

void land()

Enables autoland and sends the command “land” to the drone.

Return
void

~CommandSocket()

Destructor.

Return
none