Best way to determine if ROS is installed

No, those are only defined if a workspace is activated. It also doesn’t necessarily imply that Debian packages are installed at all, which is really the issue here.