ColorSensor event not firing

Hi, I am working with some custom code of my own creation, and I can get all of the other events to fire, but no matter what I have tried, I cannot get the color sensor event to fire. I went back to the demo provided by Nuitrack, and the color event does not even fire within that code either. Is this a config file parameter that needs to be changed? What other reason could there be for the color sensor event not firing?

Which device are you using ?

The color events cant fire if the sensor you are using is not configured correctly.

For example if you are using an Astra Pro - you will need to set the CamerId in the config to the correct value.

"AstraProPerseeDepthProvider": {
    "Windows": {
        "CameraID": -1

In most cases it would be 0 or 1 depending on if you also have a webcam configured on your test device/


Thanks for the response Westa!

I am using the Astra Pro on a laptop with a built-in webcam, so I would need to change that CameraID to 0 or 1? I will try that in the morning, because that is likely the issue then.


yes id is -1 by default - which says - dont connect to a color camera using local USB

the rest is trial and error - it will depend on the order that the Camera Devices are enumerated.
In most of our tests - the internal USB enumerates first - BUT we have also see some cases where that is not the result.

Also we have seen situations where the enumeration order changes at bootup - depending on if the sensor is already plugged in on not.


Ok, sounds like I’m going to have to set the config variable in code, then do some sort of a watchdog if I don’t get a color frame, then rinse repeat until I find one or get to 5 I guess. You would think that there would be a more reliable way to check for the color sensor. I thought the -1 was just a go find it yourself, which was why I was baffled as to why I wasn’t getting any images.

There are a number of ways to do it … but not with the sdk … we have created some extra code libraries that run before we fire up nuitrack … they do things like discover what devices are connected.

So that yes we can make changes to the nuitrack.config at runtime.

Have a read of the notes here - they maybe be of some use to you depending on the language you are using.