AR Data API Reference
ARDataSubscriber
Constructor:
ARDataSubscriber(ip, port=8000, hwm=1, conflate=True, verbose=False)Parameters:
ip(str): iPhone's IP addressport(int): Port number (default: 8000)hwm(int): High water mark (default: 1, keeps only latest message)conflate(bool): Message conflation (default: True)verbose(bool): Print connection info (default: False)
Usage:
# Create subscriber
sub = ARDataSubscriber("192.168.1.100")
# Continuously receive data
for data in sub:
print(data.timestamp)
print(data.velocity)
# Close when done
sub.close()Main Methods:
Method
Returns
Description
get()
ARFrame or None
Get latest data frame
get_timestamp()
float or None
Get timestamp only
get_velocity()
np.ndarray or None
Get velocity only
get_local_pose()
np.ndarray or None
Get local pose only
get_global_pose()
np.ndarray or None
Get global pose only
get_camera_intrinsics()
np.ndarray or None
Get camera intrinsics only
get_color_image()
bytes or None
Get color image bytes only
get_depth_image()
np.ndarray or None
Get depth array only
close()
None
Close connection
ARFrame
Data object returned by get() or when iterating. For data format details, see AR Data Format Reference above.
Properties:
Property
Type
Description
timestamp
float
Unix timestamp in seconds
velocity
np.ndarray
Velocity $[v_x, v_y, v_z]$ in m/s
local_pose
np.ndarray
Local pose $[t_x, t_y, t_z, q_x, q_y, q_z, q_w]$
global_pose
np.ndarray
Global pose $[t_x, t_y, t_z, q_x, q_y, q_z, q_w]$
camera_intrinsics
np.ndarray
Camera intrinsics (3×3 flattened)
Color Image
color_bytes
bytes
JPEG image bytes (for saving/forwarding)
color_array
np.ndarray
Decoded RGB image array (640×480×3)
color
np.ndarray
Shortcut for color_array
Depth Image
depth_array
np.ndarray
Depth image array (uint16, 256×192)
depth
np.ndarray
Shortcut for depth_array
depth_width
int
Depth image width (256)
depth_height
int
Depth image height (192)
Helpers
has_color_image
bool
Check if color image exists
has_depth_image
bool
Check if depth image exists
Methods:
Method
Returns
Description
show_color(window_name)
bool
Display color image with OpenCV
show_depth(window_name, colormap)
bool
Display depth image with colormap
show_images(show_color, show_depth)
tuple
Display both images side by side
Last updated
Was this helpful?