Mac app only shows a black screen

Macbook Pro, MacOS Catalina 10.15.7. The app opens to nothing but a black window. Same if the RadarIQ is connected or not.

It’s really bad on Linux too. The SDKs are pretty functional, though. And making your own viewer isn’t too hard. Here’s a pretty bad one in Python using open3d:

#import math
import numpy as np
import open3d as o3d

from radariq import RadarIQ, MODE_POINT_CLOUD, MOVING_OBJECTS_ONLY, MOVING_BOTH, RESET_REBOOT
import radariq

riq = RadarIQ()
riq.set_moving_filter(MOVING_BOTH)
riq.set_mode(MODE_POINT_CLOUD)
riq.set_units('mm', 'mm/s', 'mm/s^2')
riq.set_frame_rate(10)
riq.set_distance_filter(0, 10000)
riq.set_angle_filter(-55, 55)
riq.set_height_filter(-1000, 1000)
riq.set_point_density(radariq.DENSITY_NORMAL)
riq.start()

def update():
    frame = riq.get_frame()
    if frame is None:
        return

    points = [(p[0], p[1], p[2]) for p in frame]
    print(points)
    return points

pc = o3d.geometry.PointCloud()

vis = o3d.visualization.Visualizer()
vis.create_window()

vc = vis.get_view_control()
vc.set_lookat((0, 0, 1))
vc.set_up((0, 1, 0))

X = 1000

test_vector = [(-X, -X, 0), (X, X, 0), (-X, X, 0), (X, -X, 0)]

def do_filter(l):
    return list(filter(lambda p: abs(p[0]) < 1000 and abs(p[1]) < 1000, l))

for frame in riq.get_data():
    if frame:
        vis.remove_geometry(pc)
        pc.clear()
        points = do_filter([(p[0], p[2], p[1]) for p in frame])
        print(points)
        pc.points = o3d.utility.Vector3dVector(test_vector + points)
        vis.add_geometry(pc, True)
    vis.poll_events()
    vis.update_renderer()
1 Like

Here’s a hacky 2d viewer built for raspberry pi with small TFT LCD on the framebuffer. Note that this intentionally introduces a non-affine distortion in the X dimension.

import math
from radariq import RadarIQ, MODE_POINT_CLOUD, MOVING_OBJECTS_ONLY, MOVING_BOTH, RESET_REBOOT
import radariq

from fb import ready_fb

BLUE = bytes([255, 0, 0, 255])
MAGENTA = bytes([255, 0, 255, 255])
FADE = [bytes([255, 0, 255, 255]),
		bytes([220, 0, 220, 255]),
		bytes([200, 0, 200, 255]),
		bytes([180, 0, 180, 255]),
		bytes([120, 0, 120, 255]),
		bytes([80, 0, 80, 255]),
		bytes([60, 0, 60, 255]),
		bytes([40, 0, 40, 255]),
		bytes([20, 0, 20, 255]),
		bytes([20, 0, 20, 255]),
		bytes([20, 0, 20, 255]),
		bytes([20, 0, 20, 255])
		]
BLACK = bytes([0, 0, 0, 255])

radarRange = 10_000.0 #mm

radarHAperture = math.radians(110) # from spec
radarHCrossAngle = math.radians(35)
apertureHCFactor = math.sin(radarHAperture)
apertureHAFactor = math.sin(radarHCrossAngle)

def appWidthAtRange(r):
	return apertureHCFactor * r / apertureHAFactor


def clamp(x, _min, _max):
	return max(min(x, _max), _min)

def normalizeContact(cp):
	dist = clamp(cp[1], 0.0, radarRange)
	rangeWidth = appWidthAtRange(dist)
	halfWidth = rangeWidth / 2

	x = clamp(cp[0], -halfWidth, halfWidth)
	
	return clamp((x + halfWidth) / rangeWidth, 0.0, 1.0),  clamp(dist / radarRange, 0.0, 1.0)


def n2s(normalized):
	return math.floor((1.0 - normalized[1]) * (width - 1)), math.floor((1.0 - normalized[0]) * (height - 1))


def drawBlip(screen, color):
	pxStart = (screen[1] * width + screen[0]) * 4
	try:
		framebuffer[pxStart:pxStart+4] = color
	except:
		print(screen, pxStart)


### script

framebuffer, width, height, bitsPerPixel = ready_fb()

for i in range(len(framebuffer)):
	framebuffer[i] = 0


riq = RadarIQ()
riq.set_moving_filter(MOVING_BOTH)
riq.set_mode(MODE_POINT_CLOUD)
riq.set_units('mm', 'mm/s', 'mm/s^2')
riq.set_frame_rate(15)
riq.set_distance_filter(0, 10000)
riq.set_angle_filter(-55, 55)
riq.set_height_filter(-1000, 1000)
riq.set_sensitivity(2)
riq.set_point_density(radariq.DENSITY_NORMAL)
riq.start()

class Blip:
	def __init__(self, point, life=8):
		self.p = point
		self.lifeLeft = life + 1
		self.startLife = life

blips = []

def handleBlips():
	to_erase = []
	for blip in blips:
		blip.lifeLeft -= 1

		if blip.lifeLeft == 0:
			drawBlip(blip.p, BLACK)
			to_erase.append(blip)
		elif blip.lifeLeft == blip.startLife:
			drawBlip(blip.p, BLUE)
		else:
			drawBlip(blip.p, FADE[blip.startLife - blip.lifeLeft])
	
	for b in to_erase:
		blips.remove(b)

for row in riq.get_data():
	if not row: continue
	for point in row:
		if not point: continue
		contactPoint = point[0], point[1]
		normPoint = normalizeContact(contactPoint) # (point[0] / radarWidth, point[1] / radarRange)
		#print(normPoint)
		screenPix = n2s(normPoint)
		#drawBlip(screenPix)
		blips.append(Blip(screenPix))
	handleBlips()
1 Like

I sorry to hear that is not working for you on the mac. Typically it worked fine while we were testing :confused:. We’ll take another look and try it on a few more machines.

Also black screen for me on Mac.
macOS Monterey v12.2.1

Just letting you know that we’ve done a fresh build of the application for OSX and have now got the code “properly” signed through the apple processes. Can you please test this to see if it works for you.
https://files.radariq.io/RadarIQ%20Controller%20v1.0.4b.dmg

Also, are you running the x86_64 or the arm64 macs? The version released today is for x86. We are still working on the ARM version.

Now, instead of a black window, I get nothing. I approved the running of the app the first time, but nothing comes up. As I test, I tried to run “/Applications/RadarIQ\ Controller.app/Contents/MacOS/RadarIQ\ Controller” from the command line and got this message:

Traceback (most recent call last):
  File "PyInstaller/loader/pyiboot01_bootstrap.py", line 106, in <module>
  File "PyInstaller/loader/pyimod04_ctypes.py", line 27, in install
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
  File "ctypes/__init__.py", line 551, in <module>
  File "ctypes/__init__.py", line 273, in _reset_cache
MemoryError
[87435] Failed to execute script 'pyiboot01_bootstrap' due to unhandled exception:
[87435] Traceback:
Traceback (most recent call last):
  File "PyInstaller/loader/pyiboot01_bootstrap.py", line 106, in <module>
  File "PyInstaller/loader/pyimod04_ctypes.py", line 27, in install
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
  File "ctypes/__init__.py", line 551, in <module>
  File "ctypes/__init__.py", line 273, in _reset_cache
MemoryError

FYI I have an x86_64 processor.