BOW Logo
Docs

BOW Client | C++

bow_sdk namespace

Summary

MembersDescriptions
class bow_sdk::bow_robotThe Robot class.
class bow_sdk::client_sdk

bow_sdk::bow_robot class

The Robot class.

Each instance represents a robot connection. You can have multiple robots connected, each with their own class, to allow for synchronised control of multiple robots.

Summary

MembersDescriptions
public char * robot_id
public bow::robot::Robot * robot_details
public inline bow_robot(bow::robot::Robot * chosen_robot)The Robot class constructor.
public inline bow_robot()The Robot class constructor.
public bow::common::Error * Connect()Starts a connection with the robot.
public bow::common::Error * OpenModality(std::string modality_name)Opens a channel for the given modality.
public bow::common::Error * SetModality(std::string modality_name,int dtype,google::protobuf::Message * sample)Sends data on an open modality channel.
public bow::sdk::GetModalityProto * GetModality(std::string modality_name,bool blocking)Reads data from an open modality channel.
public bow::common::Error * CloseModality(std::string modality_name)Closes an open modality channel.
public bow::common::Error * Disconnect()Close the connection to the robot.

Members

public char * robot_id

public bow::robot::Robot * robot_details

public inline bow_robot(bow::robot::Robot * chosen_robot)

The Robot class constructor.

This constructor accepts the robot details obtained from client_sdk::GetRobots()

Parameters

  • chosen_robot bow::robot::Robot*:The chosen robot selected from the array of robots returned when running client_sdk::GetRobots().

public inline bow_robot()

The Robot class constructor.

This is an empty constructor designed to be populated when passed in as a parameter to client_sdk::QuickConnect

public bow::common::Error * Connect()

Starts a connection with the robot.

This method starts a peer to peer connection with the robot using the robot details previously passed in to the constructor.

Returns

*bow::common::Error **: Where error.Success is a boolean, True indicates a successful connection. If error.Success is False you can inspect error.Description for more information.

public bow::common::Error * OpenModality(std::string modality_name)

Opens a channel for the given modality.

Opens a channel between the robot and client, over which data for the chosen modality is transmitted.

Parameters

  • modality_name std::string: The name of the modality channel you wish to open. Available options are specific to the robot but can be vision, audition, proprioception, motor, voice, speech or tactile.

Returns

*bow::common::Error **: Where error.Success is a boolean, True indicates a successful open. If error.Success is False you can inspect error.Description for more information.

public bow::common::Error * SetModality(std::string modality_name,int dtype,google::protobuf::Message * sample)

Sends data on an open modality channel.

This sends a sample of data of the correct type over the open modality channel to the robot.

Parameters

  • modality_name std::string: The name of the modality channel you wish to send data on.

  • sample google::protobuf::Message*: The protobuf message you want to send on this modality. This can be bow::data::MotorSample (motor modality), bow::data::StringSample (speech modality) or bow::data::AudioSamples (voice modality)

Returns

bow::common::Error: Where error.Success is a boolean, True indicates a successful send. If error.Success is False you can inspect error.Description for more information.

public bow::sdk::GetModalityProto * GetModality(std::string modality_name,bool blocking)

Reads data from an open modality channel.

This reads a data sample from the robot on the named open modality channel.

Parameters

  • modality_name std::string: The name of the modality channel you are requesting data from.

  • blocking bool: if set to True, this function will block until data is received from the robot.

Returns

bow::sdk::GetModalityProto: This contains an Error component and a Data component which is populated only if Error.Success = True

public bow::common::Error * CloseModality(std::string modality_name)

Closes an open modality channel.

This closes the named open modality channel.

Parameters

  • modality_name std::string: The name of the modality channel you wish to close.

Returns

bow::common::Error: Where error.Success is a boolean, True indicates a successful closure. If error.Success is False you can inspect error.Description for more information.

public bow::common::Error * Disconnect()

Close the connection to the robot.

This closes the peer to peer connection between client and robot.

Returns

bow::common::Error: Where error.Success is a boolean, True indicates a successful disconnection. If error.Success is False you can inspect error.Description for more information.

bow_sdk::client_sdk class

Summary

MembersDescriptions
public static char * Version()Gets the SDK version information.
public static bow::common::Error * QuickConnect(bow_robot * robot,std::string log_dir,std::vector< std::string > modalities,bool verbose)Quick connect function to simplify process of connecting to a robot and opening modalities.
public static bow::common::Error * Setup(std::string log_dir,bool log_latency)Configures variables required for a BOW client.
public static bow::common::Error * Setup(bow::structs::AudioParams * aparams,std::string log_dir,bool log_latency)Configures variables required for a BOW client.
public static bow::common::Error * Login()Login to your BOW account.
public static bow::common::Error * Login(std::string username,std::string password)
public static bow::sdk::GetRobotsProtoReply * GetRobots(bool get_local,bool get_remote,bool get_systray_robot)
public static void CloseClientInterface()

Members

public static char * Version()

Gets the SDK version information.

Gets the version of the bow client and animus core libraries.

Returns

char*: A version string in the form:

BOW Client version v3.2.1.1683 \nBOW Core version v3.2.1.1201\nBuilt with BowMessages v0.10.31 on 2023-08-24-14:13:43-UTC \nCopyright (C) 2023 Bettering Our Worlds (BOW) Ltd. - All Rights Reserved\n'

public static bow::common::Error * QuickConnect(bow_robot * robot,std::string log_dir,std::vector< std::string > modalities,bool verbose)

Quick connect function to simplify process of connecting to a robot and opening modalities.

This function communicates with BOW Hub to automatically perform the tasks of logging in, getting the chosen robot from the BOW Hub, connecting to it and opening the requested modalities

Parameters

  • robot bow_robot*: A pointer to a robot class created by calling bow_robot(). Can be empty and will be populated with details by quick connect

  • audio_params bow_utils.AudioParams : Optional parameter, an Audio parameters object which allows you to specify audio settings other than those used by default.

  • modalities * std::vector<std::string>: A list of the modalities you wish to open on the robot. Modalities are specific to the robot but can be vision, audition, proprioception, motor, voice, speech and tactile.

Returns

Robot: Returns an instance of the Robot class, which represents the connected robot. Returns None if no connection made.

Returns

bow_utils.Error: Where error.Success is a boolean, True indicates a successful connection. If error.Success is False you can inspect error.Description for more information.

public static bow::common::Error * Setup(std::string log_dir,bool log_latency)

Configures variables required for a BOW client.

This function sets the folder name for the log files and otherwise initialises all the variables required for a BOW client.

Parameters

  • logdir str: Name of the desired directory for logs. Should take logging.Logger.name.

  • loglatency bool: Determines whether the latency of messages are reported in the log.

Returns

bow_utils.Error: Where error.Success is a boolean, True indicates a successful setup. If error.Success is False you can inspect error.Description for more information.

public static bow::common::Error * Setup(bow::structs::AudioParams * aparams,std::string log_dir,bool log_latency)

Configures variables required for a BOW client.

This function sets up custom audio sampling and playback settings, sets the folder name for the log files and otherwise initialises all the variables required for a BOW client.

Parameters

  • audio_params bow_utils.AudioParams: Configures the settings for the audio streams. Use None for default settings.

  • logdir str: Name of the desired directory for logs. Should take logging.Logger.name.

  • loglatency bool: Determines whether the latency of messages are reported in the log.

Returns

bow_utils.Error: Where error.Success is a boolean, True indicates a successful setup. If error.Success is False you can inspect error.Description for more information.

public static bow::common::Error * Login()

Login to your BOW account.

Login with your BOW username and password to initialise communication session and therefore communicate with robots associated with your account.

This function takes no parameters because it uses BOW hub to carry out the login process

Returns

bow_utils.Error: Where error.Success is a boolean, True indicates a successful setup. If error.Success is False you can inspect error.Description for more information.

public static bow::common::Error * Login(std::string username,std::string password)

public static bow::sdk::GetRobotsProtoReply * GetRobots(bool get_local,bool get_remote,bool get_systray_robot)

public static void CloseClientInterface()

Generated by Moxygen

On this page