### Cyberwave SDK Quick Start Example Source: https://docs.cyberwave.com/sdks/python-sdk A quick start example demonstrating how to initialize the Cyberwave SDK, create a digital twin, position, rotate, scale it, and control its joints. ```python from cyberwave import Cyberwave import math, asyncio cw = Cyberwave(api_key="your_api_key_here") # ────────────────────────────────────────────── # 1. Create a digital twin from the asset catalog # ────────────────────────────────────────────── robot = cw.twin("the-robot-studio/so101") # Target a specific environment (optional) # robot = cw.twin("the-robot-studio/so101", environment_id="ENV_UUID") # ────────────────────────────────────────────── # 2. Position, rotate, and scale the twin # ────────────────────────────────────────────── robot.edit_position(x=1.0, y=0.0, z=0.5) robot.edit_rotation(yaw=90) robot.edit_scale(x=1.5, y=1.5, z=1.5) # ────────────────────────────────────────────── # 3. Control joints (degrees or radians) # ────────────────────────────────────────────── robot.joints.set("shoulder_joint", 45, degrees=True) robot.joints.set("elbow_joint", math.pi / 4, degrees=False) angle = robot.joints.get("shoulder_joint") all_joints = robot.joints.get_all() print(f"Joint names: {robot.joints.list()}") # ────────────────────────────────────────────── # 4. Capture a camera frame (no streaming setup needed) ``` -------------------------------- ### Install Cyberwave CLI and Edge Core Source: https://docs.cyberwave.com/edge/overview Install the Cyberwave CLI and then run the edge installer interactively on your edge device. The CLI installation is a one-time setup. ```bash # Install the Cyberwave CLI (one-time setup) curl -fsSL https://cyberwave.com/install.sh | bash # Run the edge installer (interactive) sudo cyberwave edge install ``` -------------------------------- ### Cyberwave SDK Quick Start Source: https://docs.cyberwave.com/sdks/python-sdk#affect-simulation-vs-live-environment A comprehensive quick start guide demonstrating core functionalities of the Cyberwave Python SDK, including digital twin management, joint control, frame capture, asset catalog search, workspace management, workflow triggering, and alert management. ```python from cyberwave import Cyberwave import math, asyncio cw = Cyberwave(api_key="your_api_key_here") # ────────────────────────────────────────────── # 1. Create a digital twin from the asset catalog # ────────────────────────────────────────────── robot = cw.twin("the-robot-studio/so101") # Target a specific environment (optional) # robot = cw.twin("the-robot-studio/so101", environment_id="ENV_UUID") # ────────────────────────────────────────────── # 2. Position, rotate, and scale the twin # ────────────────────────────────────────────── robot.edit_position(x=1.0, y=0.0, z=0.5) robot.edit_rotation(yaw=90) robot.edit_scale(x=1.5, y=1.5, z=1.5) # ────────────────────────────────────────────── # 3. Control joints (degrees or radians) # ────────────────────────────────────────────── robot.joints.set("shoulder_joint", 45, degrees=True) robot.joints.set("elbow_joint", math.pi / 4, degrees=False) angle = robot.joints.get("shoulder_joint") all_joints = robot.joints.get_all() print(f"Joint names: {robot.joints.list()}") # ────────────────────────────────────────────── # 4. Capture a camera frame (no streaming setup needed) # ────────────────────────────────────────────── path = robot.capture_frame() # save temp JPEG, returns path frame = robot.capture_frame("numpy") # numpy BGR array image = robot.capture_frame("pil") # PIL.Image object # ────────────────────────────────────────────── # 5. Search the asset catalog # ────────────────────────────────────────────── for asset in cw.assets.search("unitree"): print(f"{asset.registry_id}: {asset.name}") # ────────────────────────────────────────────── # 6. Manage workspaces, projects, and environments # ────────────────────────────────────────────── workspaces = cw.workspaces.list() project = cw.projects.create(name="My Project", description="Quickstart project", workspace_id=workspaces[0].uuid) env = cw.environments.create(name="Lab Setup", description="Test environment", project_id=project.uuid) # ────────────────────────────────────────────── # 7. Trigger a workflow and wait for completion # ────────────────────────────────────────────── run = cw.workflows.trigger("workflow-uuid", inputs={"speed": 0.5}) run.wait(timeout=60) print(f"Workflow finished: {run.status}") # ────────────────────────────────────────────── # 8. Create and manage alerts on a twin # ────────────────────────────────────────────── alert = robot.alerts.create( name="Calibration needed", description="Joint 3 drifting beyond tolerance", severity="warning", alert_type="calibration_needed", ) alert.acknowledge() alert.resolve() # ────────────────────────────────────────────── # 9. Stream live video (async) ``` -------------------------------- ### Create Project using Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi This example demonstrates how to create a new project using the Cyberwave API. It includes API key authentication setup and error handling. ```python import cyberwave.rest from cyberwave.rest.models.project_create_schema import ProjectCreateSchema from cyberwave.rest.models.project_schema import ProjectSchema from cyberwave.rest.rest import ApiException from pprint import pprint configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) project_create_schema = cyberwave.rest.ProjectCreateSchema() try: api_response = api_instance.src_app_api_projects_create_project(project_create_schema) print("The response of DefaultApi->src_app_api_projects_create_project:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_projects_create_project: %s\n" % e) ``` -------------------------------- ### Get Twin Joints Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_assets_complete_large_glb_upload Retrieves a list of all twin joints for a given UUID. This example demonstrates API key authentication setup. ```python import cyberwave.rest from cyberwave.rest.models.joint_schema import JointSchema from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. ``` -------------------------------- ### Quick Start: Record and Replay Samples Source: https://docs.cyberwave.com/edge/drivers/data-record-replay This snippet demonstrates the basic usage of `record()` to capture live samples and `replay()` to play them back. Ensure the necessary imports are included. ```python from cyberwave.data import get_backend from cyberwave.data.recording import record, replay backend = get_backend() # Record live samples with record(backend, ["frames/default", "depth"], "/tmp/session1"): # ... samples flow through the backend while this block runs pass # Replay recorded samples result = replay(backend, "/tmp/session1", speed=1.0) print(f"Replayed {result.samples_published} samples") ``` -------------------------------- ### Get Environment Simulations Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#authorization-10 Placeholder for code to retrieve environment simulations. This snippet shows the initial setup for API client configuration and authentication, similar to other examples. ```python import cyberwave.rest from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' ``` -------------------------------- ### Get Workflow Node by UUIDs Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_assets_get_asset_kinematics Retrieves a specific node within a workflow using both the workflow UUID and the node UUID. This example demonstrates basic API client setup and authentication. ```python import cyberwave.rest from cyberwave.rest.models.workflow_node_schema import WorkflowNodeSchema from cyberwave.rest.rest import ApiException from pprint import pprint configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) # workflow_uuid and node_uuid would be defined here ``` -------------------------------- ### Copy and Edit .env Example Source: https://docs.cyberwave.com/tutorials/edge-to-cloud-vlm#architecture Copy the example .env file and open it in nano for configuration. Ensure all required variables are set. ```bash cp .env.example .env nano .env ``` -------------------------------- ### Get Workflow Execution by Execution UUID with Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#src-app-api-environments-delete-environment-for-project Fetch details of a specific workflow execution using its execution UUID. This example demonstrates the initial setup for authentication and client instantiation. ```python configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) # execution_uuid = 'execution_uuid_example' # str | # try: # api_response = api_instance.src_app_api_workflows_get_workflow_execution(execution_uuid) # print("The response of DefaultApi->src_app_api_workflows_get_workflow_execution:\n") # pprint(api_response) # except Exception as e: # print("Exception when calling DefaultApi->src_app_api_workflows_get_workflow_execution: %s\n" % e) ``` -------------------------------- ### Full cyberwave.yml Configuration Example Source: https://docs.cyberwave.com/sdks/cloud-node#cancelling-workloads This example shows all available fields in the `cyberwave.yml` file, including optional settings for MQTT host and port, and command templates. ```yaml cyberwave-cloud-node: install_script: ./install.sh # runs once on startup inference: python ./inference.py --params {body} simulate: python ./simulate.py --params {body} training: python ./training.py --params {body} profile_slug: gpu-a100 # default: "default" heartbeat_interval: 30 # seconds, default: 30 mqtt_host: mqtt.cyberwave.com # default: mqtt.cyberwave.com mqtt_port: 1883 # default: 1883 ``` -------------------------------- ### Get Workflow Node using Cyberwave REST API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#return-type-101 This example shows how to fetch a specific node within a workflow using its workflow and node UUIDs. It includes API key authentication setup. ```python import cyberwave.rest from cyberwave.rest.models.workflow_node_schema import WorkflowNodeSchema from cyberwave.rest.rest import ApiException from pprint import pprint import os configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) workflow_uuid = 'workflow_uuid_example' # str | node_uuid = 'node_uuid_example' # str | try: api_response = api_instance.src_app_api_workflows_get_workflow_node(workflow_uuid, node_uuid) print("The response of DefaultApi->src_app_api_workflows_get_workflow_node:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_workflows_get_workflow_node: %s\n" % e) ``` -------------------------------- ### Start Cyberwave Cloud Node with Custom Options Source: https://docs.cyberwave.com/sdks/cloud-node#cancelling-workloads Demonstrates various command-line options for starting the Cyberwave Cloud Node, including specifying a slug hint, custom configuration file, overriding the profile, and setting a custom MQTT broker. ```bash # Start with defaults (reads cyberwave.yml) cyberwave-cloud-node start # With a slug hint (backend may assign a different one) cyberwave-cloud-node start --slug my-gpu-node # Custom config file cyberwave-cloud-node start --config ./path/to/cyberwave.yml # Override profile cyberwave-cloud-node start --profile gpu-a100 # Custom MQTT broker cyberwave-cloud-node start --mqtt-host localhost --mqtt-port 1883 ``` -------------------------------- ### Get Workflow Node using Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_edges_get_edges Fetch details for a specific node within a workflow using both workflow and node UUIDs. This example demonstrates client setup and API call for retrieving node information. ```python import cyberwave.rest from cyberwave.rest.models.workflow_node_schema import WorkflowNodeSchema from cyberwave.rest.rest import ApiException from pprint import pprint configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) # workflow_uuid and node_uuid would be defined here ``` -------------------------------- ### Get Workflow Node Details with Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_attachments_create_attachment Fetch details for a specific node within a workflow. This requires both the workflow UUID and the node UUID. The example shows basic client setup and API call structure. ```python import cyberwave.rest from cyberwave.rest.models.workflow_node_schema import WorkflowNodeSchema from cyberwave.rest.rest import ApiException from pprint import pprint configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) workflow_uuid = 'workflow_uuid_example' # str | node_uuid = 'node_uuid_example' # str | try: # Get Workflow Node api_response = api_instance.src_app_api_workflows_get_workflow_node(workflow_uuid, node_uuid) print("The response of DefaultApi->src_app_api_workflows_get_workflow_node:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_workflows_get_workflow_node: %s\n" % e) ``` -------------------------------- ### Quick Start: Start the Node Source: https://docs.cyberwave.com/sdks/cloud-node Execute this command to start the Cyberwave Cloud Node after configuration. The node will then register with the backend, connect to MQTT, and begin accepting commands. ```bash cyberwave-cloud-node start ``` -------------------------------- ### Initialize Cloud Node from Configuration File Source: https://docs.cyberwave.com/sdks/cloud-node#cancelling-workloads Recommended way to initialize the Cloud Node using a configuration file. A slug hint can be provided. ```python from cyberwave_cloud_node import CloudNode, CloudNodeConfig # From config file (recommended) node = CloudNode.from_config_file() node.run() # With a slug hint node = CloudNode.from_config_file(slug="my-gpu-node") node.run() ``` -------------------------------- ### Manage Workspaces, Projects, and Environments Source: https://docs.cyberwave.com/sdks/python-sdk Demonstrates creating a new project within the first available workspace and setting up a development environment for that project. ```python cw = Cyberwave() workspaces = cw.workspaces.list() print(f"Found {len(workspaces)} workspaces") project = cw.projects.create( name="My Robotics Project", description="Main robotics project", workspace_id=workspaces[0].uuid ) environment = cw.environments.create( name="Development", description="Dev environment for testing", project_id=project.uuid ) ``` -------------------------------- ### Start Cyberwave Cloud Node with Custom MQTT Broker Source: https://docs.cyberwave.com/sdks/cloud-node Starts the Cyberwave Cloud Node, specifying a custom MQTT broker host and port. Useful for local development or custom broker setups. ```bash cyberwave-cloud-node start --mqtt-host localhost --mqtt-port 1883 ``` -------------------------------- ### Initialize and Start Zenoh-MQTT Bridge Source: https://docs.cyberwave.com/sdks/zenoh-mqtt-bridge Instantiate the ZenohMqttBridge with configuration for twin UUIDs and outbound channels, then start the bridge. Ensure MQTT host, port, and credentials are correctly provided. ```python from cyberwave.zenoh_mqtt import ZenohMqttBridge, BridgeConfig bridge = ZenohMqttBridge( config=BridgeConfig( twin_uuids=[""], outbound_channels=["model_output", "event", "model_health"], ), mqtt_host="", mqtt_port=8883, mqtt_password="", ) bridge.start() ``` -------------------------------- ### Create Environment Preview Source: https://docs.cyberwave.com/sdks/python-sdk#authentication Render a static PNG snapshot of an environment by calling the `create_preview` method. The result includes the URL of the generated image. ```python preview = cw.environments.create_preview("ENVIRONMENT_UUID") print(preview.file_url) ``` -------------------------------- ### Execute Workflow Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#parameters-23 Manually trigger a workflow execution. This example shows the setup for API key authentication and client instantiation. ```python import cyberwave.rest from cyberwave.rest.models.workflow_execute_schema import WorkflowExecuteSchema from cyberwave.rest.models.workflow_execution_schema import WorkflowExecutionSchema from cyberwave.rest.rest import ApiException configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) workflow_uuid = 'workflow_uuid_example' workflow_execute_schema = WorkflowExecuteSchema() try: api_instance.src_app_api_workflows_execute_workflow(workflow_uuid, workflow_execute_schema) except Exception as e: print("Exception when calling DefaultApi->src_app_api_workflows_execute_workflow: %s\n" % e) ``` -------------------------------- ### Initialize API Client and Configuration Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#http-response-details-8 Sets up the API client configuration, including the host and API key authentication. This is a prerequisite for making API calls. ```python import cyberwave.rest from cyberwave.rest.models.environment_schema import EnvironmentSchema from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) ``` -------------------------------- ### Get Environment Twins Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_environments_get_environment_invitations Retrieves twin configurations for an environment using its UUID. This example demonstrates setting up the API client and authentication. ```python # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: # Get Environment Twins api_response = api_instance.src_app_api_environments_get_environment_twins(uuid) print("The response of DefaultApi->src_app_api_environments_get_environment_twins:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_environments_get_environment_twins: %s\n" % e) ``` -------------------------------- ### Configuration: Detailed cyberwave.yml options Source: https://docs.cyberwave.com/sdks/cloud-node This `cyberwave.yml` example shows detailed configuration options for the Cloud Node, including paths for scripts, workload commands, profile slugs, heartbeat intervals, and MQTT connection details. Defaults are provided for most options. ```yaml cyberwave-cloud-node: install_script: ./install.sh # runs once on startup inference: python ./inference.py --params {body} simulate: python ./simulate.py --params {body} training: python ./training.py --params {body} profile_slug: gpu-a100 # default: "default" heartbeat_interval: 30 # seconds, default: 30 mqtt_host: mqtt.cyberwave.com # default: mqtt.cyberwave.com mqtt_port: 1883 # default: 1883 ``` -------------------------------- ### Get Attachment using Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#authorization-100 Retrieve an attachment by its UUID. This example demonstrates API key authentication and printing the response. ```python import cyberwave.rest from cyberwave.rest.models.attachment_schema import AttachmentSchema from cyberwave.rest.rest import ApiException from pprint import pprint configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' try: api_response = api_instance.src_app_api_attachments_get_attachment(uuid) print("The response of DefaultApi->src_app_api_attachments_get_attachment:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_attachments_get_attachment: %s\n" % e) ``` -------------------------------- ### Get Environment Twins Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_edges_update_edge Retrieves a list of twins associated with a specific environment UUID. This example demonstrates setting up the API client with CustomTokenAuthentication. ```python # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. ``` -------------------------------- ### Example .env File Configuration Source: https://docs.cyberwave.com/use-cyberwave/setup-cyberwave#content-area An example of how to configure environment variables in a .env file for use with the Cyberwave SDK. ```dotenv CYBERWAVE_API_KEY=cw_a1b2c3d4e5f6... CYBERWAVE_ENVIRONMENT_ID=1e48b1a5-ff2b-45ba-a854-a2c2df561852 ``` -------------------------------- ### Start Cyberwave Cloud Node with Slug Hint Source: https://docs.cyberwave.com/sdks/cloud-node Starts the Cyberwave Cloud Node, providing a slug hint for the backend. The backend may assign a different slug. ```bash cyberwave-cloud-node start --slug my-gpu-node ``` -------------------------------- ### Get Twin Joints Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_assets_initiate_large_glb_upload Retrieves a list of all twin joints for a given UUID. This example demonstrates setting up the API client configuration and authentication. ```python import cyberwave.rest from cyberwave.rest.models.joint_schema import JointSchema from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: # Get Twin Joints api_response = api_instance.src_app_api_urdf_get_twin_joints(uuid) print("The response of DefaultApi->src_app_api_urdf_get_twin_joints:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_urdf_get_twin_joints: %s\n" % e) ``` -------------------------------- ### Activate Workflow Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_assets_create_asset Activates a specified workflow using its unique identifier. This example demonstrates the initial setup for API client configuration and authentication. ```python import cyberwave.rest from cyberwave.rest.models.workflow_schema import WorkflowSchema from cyberwave.rest.rest import ApiException from pprint import pprint configuration = cyberwave.rest.Configuration( host = "http://localhost" ) ``` -------------------------------- ### Install Cyberwave Cloud Node with apt Source: https://docs.cyberwave.com/sdks/cloud-node#cancelling-workloads Execute this command to add the Cyberwave APT repository and install the compiled binary of the Cloud Node. ```bash curl -fsSL https://cyberwave.com/install-cloud-node.sh | sudo bash ``` -------------------------------- ### Safe Manipulation Prompt Example Source: https://docs.cyberwave.com/sdks/mcp-server#environment-&-twin-creation The `safe_manipulation` prompt guides agents to inspect, preview changes with `execute=false`, and then commit with `execute=true` for joint manipulation. ```python # Agent using safe_manipulation prompt would follow these steps: # 1. Inspect twin schema and joint states # 2. Call cw_set_joint(..., execute=False) # 3. Verify the preview # 4. Call cw_set_joint(..., execute=True) ``` -------------------------------- ### Programmatic Cloud Node Initialization in Python Source: https://docs.cyberwave.com/sdks/cloud-node#authentication Demonstrates various ways to initialize and run a CloudNode instance using the Python SDK. Configuration can be loaded from a file, environment variables, or defined programmatically. ```python from cyberwave_cloud_node import CloudNode, CloudNodeConfig # From config file (recommended) node = CloudNode.from_config_file() node.run() ``` ```python # With a slug hint node = CloudNode.from_config_file(slug="my-gpu-node") node.run() ``` ```python # From environment variables node = CloudNode.from_env() node.run() ``` ```python # Fully programmatic config = CloudNodeConfig( install_script="./install.sh", inference="python inference.py --params {body}", training="python train.py --params {body}", profile_slug="gpu-a100", heartbeat_interval=30, mqtt_host="mqtt.cyberwave.com", mqtt_port=1883, ) node = CloudNode(config=config, slug="my-gpu-node") node.run() ``` -------------------------------- ### Get Environment Simulations Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_assets_upload_glb Fetches simulation data for a specified environment UUID. This example demonstrates API key authentication using an environment variable. ```python # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: # Get Environment Simulations api_response = api_instance.src_app_api_environments_get_environment_simulations(uuid) print("The response of DefaultApi->src_app_api_environments_get_environment_simulations:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_environments_get_environment_simulations: %s\n" % e) ``` -------------------------------- ### Install Cyberwave SDK with Camera Extras Source: https://docs.cyberwave.com/sdks/python-sdk Install the Cyberwave Python SDK with optional extras for camera streaming using OpenCV. ```bash pip install cyberwave[camera] ``` -------------------------------- ### Get Environment Twins Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi.md#src_app_api_assets_complete_large_glb_upload Retrieves a list of twins associated with a specific environment UUID. This example demonstrates setting up the API client configuration and authentication. ```python # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. ``` -------------------------------- ### Get Asset using Python Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi Use this snippet to retrieve a specific asset by its UUID. Ensure the cyberwave library is installed and configured with the correct host. ```python import cyberwave.rest from cyberwave.rest.models.asset_schema import AssetSchema from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: # Get Asset api_response = api_instance.src_app_api_assets_get_asset(uuid) print("The response of DefaultApi->src_app_api_assets_get_asset:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_assets_get_asset: %s\n" % e) ``` -------------------------------- ### Start the Cyberwave Cloud Node Source: https://docs.cyberwave.com/sdks/cloud-node#cancelling-workloads Run this command to start the Cyberwave Cloud Node. It will automatically register, connect to MQTT, and begin executing workloads based on your configuration. ```bash cyberwave-cloud-node start ``` -------------------------------- ### Get Attachment using DefaultApi Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#authorization-11 Retrieve an attachment by its UUID. This example shows how to configure the API client with API key authentication and handle the response. ```python import cyberwave.rest from cyberwave.rest.models.attachment_schema import AttachmentSchema from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: # Get Attachment api_response = api_instance.src_app_api_attachments_get_attachment(uuid) print("The response of DefaultApi->src_app_api_attachments_get_attachment:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_attachments_get_attachment: %s\n" % e) ``` -------------------------------- ### Configure Edge Environment (.env) Source: https://docs.cyberwave.com/tutorials/edge-to-cloud-vlm Copy the example .env file and update it with your Cyberwave API token, Twin UUID, and camera settings. ```bash cp .env.example .env nano .env ``` ```dotenv # Cyberwave API Configuration CYBERWAVE_TOKEN= # Device Configuration CYBERWAVE_TWIN_UUID= # Camera Configuration CAMERA_ID=0 CAMERA_FPS=10 ``` -------------------------------- ### Create Workspace with API Key Authentication Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#authorization-10 This example shows how to create a new workspace using API key authentication. The API key should be configured via the 'API_KEY' environment variable. ```python import cyberwave.rest from cyberwave.rest.models.workspace_schema import WorkspaceSchema from cyberwave.rest.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = cyberwave.rest.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: CustomTokenAuthentication configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' # Enter a context with an instance of the API client with cyberwave.rest.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = cyberwave.rest.DefaultApi(api_client) try: # Create Workspace api_response = api_instance.src_users_api_workspaces_create_workspace() print("The response of DefaultApi->src_users_api_workspaces_create_workspace:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_users_api_workspaces_create_workspace: %s\n" % e) ``` -------------------------------- ### Get Attachment using Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#http-request-headers-111 Retrieve an attachment by its UUID. This example demonstrates API key authentication and printing the response. Requires `AttachmentSchema` model. ```python import cyberwave.rest from cyberwave.rest.models.attachment_schema import AttachmentSchema from cyberwave.rest.rest import ApiException from pprint import pprint import os configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: api_response = api_instance.src_app_api_attachments_get_attachment(uuid) print("The response of DefaultApi->src_app_api_attachments_get_attachment:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_attachments_get_attachment: %s\n" % e) ``` -------------------------------- ### Start Cyberwave Cloud Node with Custom Config Source: https://docs.cyberwave.com/sdks/cloud-node Starts the Cyberwave Cloud Node using a specified configuration file. This allows for more detailed customization than command-line flags. ```bash cyberwave-cloud-node start --config ./path/to/cyberwave.yml ``` -------------------------------- ### Get Attachment using Cyberwave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#authorization-108 Retrieve an attachment by its UUID. This example shows how to configure the API client with API key authentication and handle the response. ```python configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) uuid = 'uuid_example' # str | try: api_response = api_instance.src_app_api_attachments_get_attachment(uuid) print("The response of DefaultApi->src_app_api_attachments_get_attachment:\n") pprint(api_response) except Exception as e: print("Exception when calling DefaultApi->src_app_api_attachments_get_attachment: %s\n" % e) ``` -------------------------------- ### List Team Members with CyberWave API Source: https://docs.cyberwave.com/api-reference/rest/DefaultApi#http-request-headers-60 Retrieve a list of members for a specific team. This example shows the setup for API key authentication and client instantiation. ```python import cyberwave.rest from cyberwave.rest.models.team_member_response import TeamMemberResponse from cyberwave.rest.rest import ApiException from pprint import pprint import os configuration = cyberwave.rest.Configuration( host = "http://localhost" ) configuration.api_key['CustomTokenAuthentication'] = os.environ["API_KEY"] # configuration.api_key_prefix['CustomTokenAuthentication'] = 'Bearer' with cyberwave.rest.ApiClient(configuration) as api_client: api_instance = cyberwave.rest.DefaultApi(api_client) team_uuid = 'team_uuid_example' try: # List Team Members api_response = api_instance.src_users_api_members_list_team_members(team_uuid) pprint(api_response) except ApiException as e: print("Exception when calling DefaultApi->src_users_api_members_list_team_members: %s\n" % e) ``` -------------------------------- ### Initialize Cyberwave Client with Environment Variable Source: https://docs.cyberwave.com/sdks/python-sdk Initialize the Cyberwave client using the API key from the CYBERWAVE_API_KEY environment variable. This is the recommended authentication method. ```bash export CYBERWAVE_API_KEY=your_api_key_here ``` ```python from cyberwave import Cyberwave cw = Cyberwave() ``` -------------------------------- ### Cyberwave Cloud Node - Command Line Source: https://docs.cyberwave.com/sdks/cloud-node#configuration Instructions for starting the Cyberwave Cloud Node with verbose logging enabled. ```APIDOC ## Verbose logging ```bash cyberwave-cloud-node start -v ``` The `--slug` parameter is a hint. The backend owns identity assignment and may use your hint or assign a different slug. ```