Software Archive
Read-only legacy content
17061 Discussions

Some trouble in Intel RealSense SDK programming

yinhu_z_
Beginner
295 Views

Why the Initialization statement "psm->Init() < PXC_STATUS_NO_ERROR" always gets the true result?

 

0 Kudos
1 Reply
jb455
Valued Contributor II
295 Views

If it's working fine, that should evaluate to false, not true. Only if there is some error will it evaluate to true.

Why: PXC_STATUS_NO_ERROR will be given an internal numeric value, say 0. All the other error codes will then have the value of -1,-2,-3 etc, so if the status is something other than NO_ERROR (ie, less than 0) it will evaluate as true then you can handle the error inside the if block. You can find a list of the possible statuses here: https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?pxcstatus.html

Hopefully that makes sense!

0 Kudos
Reply