Control API
Section titled “Control API”The Control API is used for real-time control of USV movement and behavior.
Basic Control
Section titled “Basic Control”Move to Specified Position
Section titled “Move to Specified Position”POST /api/v1/control/moveRequest Body:
{ "device_id": "USV-2024-001", "latitude": 31.2354, "longitude": 121.4787, "speed": 5, "heading": 90}Response:
{ "success": true, "data": { "command_id": "cmd-001", "status": "executing", "eta": 180 }}Stop Movement
Section titled “Stop Movement”POST /api/v1/control/stopRequest Body:
{ "device_id": "USV-2024-001", "mode": "immediate"}Return to Home
Section titled “Return to Home”POST /api/v1/control/returnRequest Body:
{ "device_id": "USV-2024-001", "speed": 8}Manual Control
Section titled “Manual Control”Set Speed and Direction
Section titled “Set Speed and Direction”POST /api/v1/control/manualRequest Body:
{ "device_id": "USV-2024-001", "throttle": 0.7, "rudder": 0.3}Parameter description:
throttle: Throttle (-1.0 to 1.0)rudder: Rudder angle (-1.0 to 1.0)
Navigation Modes
Section titled “Navigation Modes”Switch Navigation Mode
Section titled “Switch Navigation Mode”POST /api/v1/control/modeRequest Body:
{ "device_id": "USV-2024-001", "mode": "auto"}Supported modes:
auto- Auto navigationmanual- Manual controlwaypoint- Waypoint navigationhold- Hold position
Python SDK Example
Section titled “Python SDK Example”from jhusv import Client
client = Client(api_key='your-api-key')
# Move to specified positionclient.control.move_to( device_id='USV-2024-001', latitude=31.2354, longitude=121.4787, speed=5)
# Stopclient.control.stop('USV-2024-001')
# Return homeclient.control.return_home('USV-2024-001')See more examples at API Overview.