Skip to main content

Connect to services exposed by assets

This guide documents how to connect from an Asset e.g. a Skill to a gRPC service exposed by various Assets, such as robot controllers, within the Intrinsic platform.

It requires that you have a working development environment.

Clients connect to services using ConnectionParams.

Resources

Resources are part of the Asset model used by Intrinsic. Robots, cameras and grippers are all examples of resources.

The ConnectionParams object takes three parameters.

  1. The address parameter is in the form of hostname:port. This is typically the ingress endpoint.
  2. The instance_name parameter is the name of your Asset (e.g. "robot").
  3. The header parameter is used for routing. Use 'x-resource-instance-name'.

Ingress service

The connection is typically routed via an ingress service on the cluster that your solution is deployed on.

By default Assets and skills are running inside the cluster and use the internal ingress.

It is however possible to use the external ingress when connecting via the local network, e.g. for debugging and testing.

Some robot specific connection examples:

Skills and Services typically get their connection parameters from the Equipment. Check the example skill for more details.

from intrinsic.icon.equipment import equipment_utils
from intrinsic.icon.python import icon_api
from intrinsic.skills.proto import equipment_pb2

ROBOT_EQUIPMENT_SLOT: str = "robot" # The key used for the equipment in the skill manifest.
...

# Get equipment

icon_equipment: equipment_pb2.EquipmentHandle = (

context.resource_handles[ROBOT_EQUIPMENT_SLOT]
)
icon_client = equipment_utils.init_icon_client(icon_equipment)

When not using equipment_utils, use the internal ingress address istio-ingressgateway.app-ingress.svc.cluster.local:80.