Routed Network module

rapyuta.io implements various features for automatically linking different deployments, and hence, aid software composition. It implements a dedicated communication plane for ROS.

Routed network is a rapyuta.io resource to enable ROS communication between different ROS package deployments. Binding a routed network resource to your deployment will enable other deployments on the same routed network to consume ROS topics/services/actions as defined in the package. Data flow occurs only when another package chooses to subscribe to a topic, call a service or call an action.

Client Module

class Client(auth_token, project=None)

Client class provides access to device, package, volume and deployment classes.

__init__(auth_token, project=None)

Get new client object

Parameters
  • auth_token (string) – Authentication token

  • project (string) – project_guid of the user

create_cloud_routed_network(name, ros_distro, shared, parameters=None)

Create a routed network

Parameters
  • name (str) – Name of the routed network.

  • ros_distro (enum ROSDistro) – ros ditro of the runtime.

  • shared (bool) – Whether the network should be shared.

  • parameters (Parameters) – parameters of the routed network

Returns

Instance of RoutedNetwork class.

Following example demonstrates how to create a routed network.

>>> from rapyuta_io import Client
>>> from rapyuta_io.clients.package import ROSDistro
>>> from rapyuta_io.clients.routed_network import Parameters, RoutedNetworkLimits
>>> client = Client(auth_token='auth_token', project='project_guid')
>>> parameters = Parameters(RoutedNetworkLimits.SMALL)
>>> routed_network = client.create_cloud_routed_network('network_name', ROSDistro.KINETIC, True,
...                                                        parameters=parameters)
create_device_routed_network(name, ros_distro, shared, device, network_interface, restart_policy=<RestartPolicy.Always: 'always'>)

Create a routed network

Parameters
  • name (str) – Name of the routed network.

  • ros_distro (enum ROSDistro) – ros ditro of the runtime.

  • shared (bool) – Whether the network should be shared.

  • device (Instance of Device class.) – device on which the routed network is deployed.

  • network_interface (str) – network interface to which routed network is binded.

  • restart_policy (enum RestartPolicy) – restart policy of routed network.

Returns

Instance of RoutedNetwork class.

Following example demonstrates how to create a routed network.

>>> from rapyuta_io import Client
>>> from rapyuta_io.clients.package import ROSDistro
>>> client = Client(auth_token='auth_token', project='project_guid')
>>> routed_network = client.create_device_routed_network('network_name',
>>>                                                      ROSDistro.KINETIC, True)
get_all_routed_networks()

List routed network

Returns

List instance of RoutedNetwork class.

get_routed_network(network_guid)

Get routed network for the guid

Parameters

network_guid (str) – guid of routed network

Returns

Instance of RoutedNetwork class.

>>> from rapyuta_io import Client
>>> client = Client(auth_token='auth_token', project='project_guid')
>>> routed_network = client.get_routed_network(network_guid)

Routed Network Module

class Parameters(limits)

Parameters represents Routed Network Parameters

Variables

limits (RoutedNetworkLimits) – Values corresponding to limits of the parameters

Parameters

limits (RoutedNetworkLimits) – Values corresponding to limits of the parameters

class RoutedNetwork(*args, **kwargs)

RoutedNetwork represents Routed Network

Variables
  • name – Name of RoutedNetwork.

  • runtime – Runtime of RoutedNetwork enum Runtime.

  • rosDistro – ROSDistro of RoutedNetwork enum ROSDistro.

  • shared – Whether the network can be shared (bool).

  • parameters – parameters of the routed network Parameters

  • phase – Deployment phase DeploymentPhaseConstants

  • status – Deployment status DeploymentStatus

  • error_code – Deployment errors

class RoutedNetworkLimits

RoutedNetworkLimits may be one of:

RoutedNetworkLimits.SMALL (cpu: 1core, memory: 4GB)

RoutedNetworkLimits.MEDIUM (cpu: 2cores, memory: 8GB)

RoutedNetworkLimits.LARGE (cpu: 4cores, memory: 16GB)