Web launch

With the server extension enabled, you can drive capabilities over HTTP and integrate web UIs — see Server REST API.

Prerequisites

  • A working config file that can start the simulator backend.\n- If you plan to use camera/render-related APIs, ensure cameras are enabled in the backend launch config (for IsaacLab: launch_config.enable_cameras: true).\n- The server extension is enabled in the config (see below).

Step 1: Enable the server extension in config

The server extension config is defined by ServerConfig (source: fastsim/fastsim/extensions/servitize/server_cfg.py). Minimal example:

yaml
extension:
  extension_cfg_dict:
    my_server:
      enable: true
      stereotype: server
      host: 0.0.0.0
      port: 5000
      debug: false

Step 2: Start FastSim (server starts automatically)

With server enabled, FastSim.start() will start the Flask server in a background thread (source: fastsim/fastsim/extensions/servitize/server.py).

Reference demo:

  • Config: fastsim/demo/extension/01_server_extension/demo_config.yaml\n- Entry: fastsim/demo/extension/01_server_extension/server_extension.py
bash
python server_extension.py

Route rule (matches the Server REST API page)

The server registers @apiclass(...) static methods as HTTP POST routes. The default URL rule is:

/{apiclass}/{static_method}

Reference implementation:

  • Registration: fastsim/fastsim/annotations/api_class.py\n- Server wiring: fastsim/fastsim/extensions/servitize/server.py

Request/response format

  • Method: POST\n- Body: JSON (keys match the static method parameter names)\n- Response: JSON, typically Result(success/msg/data)

Example:

bash
curl -X POST "http://localhost:5000/spawnable/control_object" \
  -H "Content-Type: application/json" \
  -d '{
    "object_name": "test_laptop",
    "function": "get_joint_names",
    "parameters": null
  }'

Troubleshooting

Port unavailable

  • Update server.port (must be 1024–65535).\n- Check firewall and port-forwarding rules.

404 route not found

  • Run fastsim show_static_api to list registered routes.\n- Ensure the target controller class is imported and @apiclass registration has been executed.