Skip to content

Endpoints by Data Type

Each endpoint has an associated functionality described, along with example shell and Python commands to interact with the API.

1. Coordinates

  • Endpoint: /api/v1/coordinates/
  • Method:: POST
  • Shell Command:
    curl -X POST "http://<ROBOT_IP>:8000/api/v1/coordinates/" \
       -H "Content-Type: application/json" \
       -d '{"command": "<command>", "value": {"x": 1.5, "y": -0.5, "z": 0.0, "theta": 3.14}}'
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/coordinates/"
    data = {
        "command": "<command>",
        "value": {"x": 1.5, "y": -0.5, "z": 0.0, "theta": 3.14}
    }
    response = requests.post(url, json=data)
    print(response.text)
    
  • Note: NO COMMAND IS USING THIS ENDPOINT

2. Float

  • Endpoint: /api/v1/float/
  • Function example: Sets the maximum velocity at which the robot can operate in percentage
  • Method:: POST
  • Shell Command:
    curl -X POST "http://<ROBOT_IP>:8000/api/v1/int/" \
       -H "Content-Type: application/json" \
       -d '{"command": "set_robot_max_velocity", "value": 50}'
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/int/"
    data = {
        "command": "set_robot_max_velocity",
        "value": 50
    }
    response = requests.post(url, json=data)
    print(response.text)
    

3. Int

  • Endpoint: /api/v1/int/
  • Function example: Adjusts the sound level setting.
  • Method:: POST
  • Shell Command:
    curl -X POST "http://<ROBOT_IP>:8000/api/v1/float/" \
       -H "Content-Type: application/json" \
       -d '{"command": "sound_level", "value": 85}'
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/float/"
    data = {
        "command": "sound_level",
        "value": 85
    }
    response = requests.post(url, json=data)
    print(response.text)
    

4. String

  • Endpoint: /api/v1/str/
  • Function example: Checks if a rune has been detected.
  • Method:: POST
  • Shell Command:
    curl -X POST "http://<ROBOT_IP>:8000/api/v1/str/" \
       -H "Content-Type: application/json" \
       -d '{"command": "is_detected", "value": "rune_id"}'
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/str/"
    data = {
        "command": "is_detected",
        "value": "rune_id"
    }
    response = requests.post(url, json=data)
    print(response.text)
    

5. Boolean

  • Endpoint: /api/v1/bool/
  • Function example: Toggles the obstacle avoidance feature.
  • Method:: POST
  • Shell Command:
    curl -X POST "http://<ROBOT_IP>:8000/api/v1/bool/" \
       -H "Content-Type: application/json" \
       -d '{"command": "set_obstacle_avoidance", "value": "true"}'
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/bool/"
    data = {
        "command": "set_obstacle_avoidance",
        "value": True  # Use Python's boolean True instead of the string "true"
    }
    response = requests.post(url, json=data)
    print(response.text)
    

6. Dictionary

  • Endpoint: /api/v1/dict/
  • Function example: Trigger a wave animation.
  • Method:: POST
  • Shell Command:
    curl -X POST "http://<ROBOT_IP>:8000/api/v1/dict/" \
       -H "Content-Type: application/json" \
       -d '{"command": "skill", "value": {name: wave}}'
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/dict/"
    data = {
        "command": "skill",
        "value": {"name": "wave"}}
    }
    response = requests.post(url, json=data)
    print(response.text)
    

7. Get / Commands with no argument

This endpoint is to send either a command with no argument, either to get data. - Endpoint: /api/v1/get/{command}/ - Function example: Get robot's language. - Method:: GET - Shell Command:

curl -L "http://<ROBOT_IP>:8000/api/v1/get/get_language/"
- Python Command:
import requests

url = "http://<ROBOT_IP>:8000/api/v1/get/get_language/"
response = requests.get(url)
print(response.text)

8. Get available services list

This endpoint is to get available services list.

  • Endpoint: /api/v1/service/get_services_list/
  • Function example: Get robot's services list for head and base
  • Method:: GET
  • Shell Command:
    curl -L "http://<ROBOT_IP>:8000/api/v1/service/get_services_list/"
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/service/get_services_list/"
    response = requests.get(url)
    print(response.text)
    

9. Get services logs

This endpoint is to get last hour services logs from user services of a specific system (head or base).

  • Endpoint: /api/v1/service/{system_name}/{service_name}
  • Function example: Get logs of enchanted_stack.service for the base.
  • Method:: GET
  • Shell Command:
    curl -L "http://<ROBOT_IP>:8000/api/v1/service/base/enchanted_stack.service/"
    
  • Python Command:
    import requests
    
    url = "http://<ROBOT_IP>:8000/api/v1/service/base/enchanted_stack.service/"
    response = requests.get(url)
    print(response.text)
    

Each endpoint except NoArgCommand supports a POST method where JSON data can be sent as part of the request to interact with different functionalities provided by the API.