Skip to content

PTZ Camera API ​

The PTZ camera is a standalone Hanwha Vision XNZ-L6320AG and is controlled directly, without going through the robot's software. It sits on the robot's internal network (default 192.168.0.100) and supports three standard interfaces:

  • RTSP — live H.264 / H.265 video
  • SUNAPI — Hanwha's HTTP CGI API for pan / tilt / zoom, presets, focus, and audio
  • ONVIF — Profile S / T for third-party VMS and tools

For the camera's mechanical and optical specifications, see PTZ Camera.

Control paths ​

There are two ways to drive the PTZ camera from code.

Directly to the camera (this page)Through the robot (ROS2 / DDS)
InterfacesSUNAPI (HTTPS CGI) · RTSP · ONVIF Profile S / T/rbq/cmd/ptz · /rbq/ptz (std_msgs/Float64MultiArray)
EndpointThe camera at 192.168.0.100The robot's DDS domain
Pan / tilt / zoomAbsolute and continuous moves, presets, focusAbsolute pan / tilt / zoom setpoint — all three applied together
VideoCamera RTSP, H.264 / H.265, profile-selectableRobot Streamer RTSP — see Media
AudioSpeaker and microphone (SUNAPI audio, RTSP back-channel)Not available
Third-party VMSONVIFNot available
RequiresA camera account and access to the robot's internal networkThe Ptz app running on the robot

Use the ROS2 topics when the camera moves as part of robot SDK code. Use direct control when you need the camera's own features — presets, focus, audio, or ONVIF.

Credentials

The camera uses HTTP Digest authentication (the SUNAPI default). The --anyauth flag in the examples lets curl negotiate it automatically — a plain -u sends Basic only and is rejected with 401. Use the account provided with your robot and replace <user> / <password>. Keep the camera on a trusted network.

Live Video (RTSP) ​

bash
ffplay "rtsp://<user>:<password>@192.168.0.100:554/profile2/media.smp"

The profile number selects the stream (resolution / codec); the camera lists its profiles in its own web UI.

Pan / Tilt / Zoom (SUNAPI) ​

SUNAPI is served over HTTPS. The camera ships with a self-signed certificate, so -k (skip verification) is used below. Common calls:

bash
# Read the current zoom level
curl -k --anyauth -u <user>:<password> \
  "https://192.168.0.100/stw-cgi/ptzcontrol.cgi?msubmenu=query&action=view&Channel=0&Query=Zoom"

# Absolute zoom to 8x  (range 1-32)
curl -k --anyauth -u <user>:<password> \
  "https://192.168.0.100/stw-cgi/ptzcontrol.cgi?msubmenu=absolute&action=control&Zoom=8"

# Continuous zoom: in / stop / out  ->  1 / 0 / -1
curl -k --anyauth -u <user>:<password> \
  "https://192.168.0.100/stw-cgi/ptzcontrol.cgi?msubmenu=continuous&action=control&Zoom=1"

Pan, tilt, and presets use the same ptzcontrol.cgi endpoint with Pan / Tilt parameters and msubmenu=preset. For the complete command set — pan/tilt ranges, presets, focus, audio in/out, event, and image settings — see the Hanwha SUNAPI reference for the XNZ-L6320AG.

Speaker & Microphone ​

The 25 W speaker and the microphone are the camera's own two-way audio, available over SUNAPI audio and the RTSP back-channel. See the Hanwha SUNAPI reference for audio in/out.

NOTE

These interfaces talk to the camera directly. The robot's own software also reads the camera to build its composite views, but that path is internal — integrations use the standard interfaces above or the ROS2 PTZ topics.

See also ​

This user manual is intended for RBQ users.