Skip to main content

HTTPClient

Inherits from: object Direct HTTP client for robot communication. Provides simple REST API access to robot endpoints. Best suited for web applications, scripts, and IoT devices requiring lightweight HTTP-based robot control.

init

HTTPClient.__init__(robot_ip: str, port: int = 4774, enable_heartbeat: bool = True, heartbeat_interval: float = 3.0) -> None
Initialize HTTP client.
Arguments
robot_ip (str)
str
required
IP address of the robot
port (int)
int
Port number (default 4774)
enable_heartbeat (bool)
bool
Enable automatic heartbeat monitoring for safety
heartbeat_interval (float)
float
Heartbeat interval in seconds (default 3.0)
Returns
returns
None
Raises
ImportError
If requests library is not installed

is_connected

HTTPClient.is_connected() -> bool
Check if HTTP client can connect.
Returns
bool
bool
True if client can successfully connect to the robot

disconnect

HTTPClient.disconnect() -> None
Disconnect HTTP client and stop heartbeat monitoring. Stops the heartbeat monitoring thread and cleans up resources.
Returns
returns
None