Full Screen Video Player icon Full Screen Video Player Fullscreen overlay video player controlled by ControlCommand: play/pause/resume/stop; ESC cancels playback and locks new playback until unpaused. Try it →
Australia
Asked
Camera Tracking Type Variable Bug

Camera Tracking Type Variable Bug

Athena,

I'm using the Camera Skill with Object Recognition in ARC and I think I've found a bug. The ARC Variable Watcher shows $CameraTrackingType as type Object (not as the string "Object"), so this test fails:

if (getVar("$CameraTrackingType") == "Object") {
  Audio.sayEZBWait("I see a " + getVar("$CameraObjectName"));
  sleep(2500);
}

I'm using the example code from DJ Sures' live hack (circa 2020). This is happening in the free v2026.07.16.00 release. Can you confirm whether this is a bug in the Camera Skill / Object Recognition robot skill (or in how ARC reports the variable type in the Variable Watcher), or explain how to correctly test for the Object type/value from a script?

Screenshot from the ARC Variable Watcher showing $CameraTrackingType in the current release: image.png



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skill (view all robot skills)
Camera Device by Synthiam
Use PC or robot cameras for vision tracking: color, QR, glyph, face, object, motion; record video/data, control servos and movement, run scripts

ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Yes - this looks like a type/value mismatch, not an Object Recognition issue.

What’s likely happening

$CameraTrackingType is probably being stored as an Object / enum-like value internally, while the Variable Watcher is displaying its type as Object instead of the string "Object".

So this test:

if (getVar("$CameraTrackingType") == "Object")

will fail if the variable is not actually a string.

What to try instead

First, inspect the actual value ARC is returning:

var trackingType = getVar("$CameraTrackingType");
print("trackingType = " + trackingType);
print("type = " + typeof(trackingType));

If it prints something other than "Object", then compare against the actual value you see.

You may need one of these:

if (String(getVar("$CameraTrackingType")) == "Object") {
  Audio.sayEZBWait("I see a " + getVar("$CameraObjectName"));
  sleep(2500);
}

or:

if (getVar("$CameraTrackingType").toString() == "Object") {
  Audio.sayEZBWait("I see a " + getVar("$CameraObjectName"));
  sleep(2500);
}

Best quick fix

If your goal is specifically to react when object tracking is active, a more reliable approach is often to check the object name variable instead:

var objectName = getVar("$CameraObjectName");
if (objectName != null && objectName != "") {
  Audio.sayEZBWait("I see a " + objectName);
  sleep(2500);
}

That avoids depending on the tracking type formatting.

About the Variable Watcher

The watcher may be showing the variable’s data type rather than the literal value, which can be confusing. If that’s the case, it’s a display/reporting quirk in ARC rather than the tracking skill itself.

Relevant docs

If you want, I can also help you rewrite that live-hack example into a more robust ARC JavaScript version that works across tracking modes. The ARC AI Assistant built into ARC can also help rewrite and test this kind of script right in the editor: https://synthiam.com/Products/AI-Assistant

Could you share what print() shows for getVar("$CameraTrackingType") in your project?

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.