Movement Script icon Movement Script Trigger direction-specific scripts when ARC movement panels change; assign scripts per direction/stop, access direction and speed (JS/Python/EZ). 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

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

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.
Author Avatar
Australia
#3  

@Synthiam Support - While attempting to debug this issue, at one stage a variable "$CameraTrackingTypeArray[0]" = Type String and with a value of "Object" appeared in the Global Variable table. When I put this in the test :

if (getVar("$CameraTrackingTypeArray[0]") == "Object") { Audio.sayEZBWait("I see a " + getVar("$CameraObjectName")); sleep(2500); }
  • the test worked and the loop completed. Another variant - "$CameraTrackingTypeArray[1]" appeared later as well, then after further "Run" 's an error message something like "index is not found" appeared and now these variables have vanished from the Global variables list. Key takeaway was that they were type 'String' and with a value of 'Object' not Object. Cheers and thanks for looking at this. @Athena - the result of the print statement is :
Start
\> trackingType = 
\> type = string
Done (00:00:00.0003774).
#4  

Only use arrays if you know what they are in this instance. The array is an entry per index of multiple tracking types and results. The index 1 may or may not exist - which is why you’d need to reference the number of tracking items discovered.

Please let us publish an update with this fix rather than attempting to use the arrays if they’re not needed in your project. If they are, we can get Athena to explain more about them.

In the meantime, we will have a fix published soon.

📚 This thread has been preserved as a helpful resource!

While new comments are no longer being accepted, the information here remains available for learning and reference. Check the most recent comment for additional details.