Am I running on a robot?
You can determine whether your script is actually running on a robot using something like this.
Am I talking to a robot?
ROS control clients will generally work on the robot or the simulator, but at times you may want to know which you are working with.
To determine if the target you are talking to on the ROS interface is a robot (or a simulator), look for the flag
miro.constants.PLATFORM_U_FLAG_SIMULATOR) in the ROS topic sensors/flags.
You can access this, and other tests, through RobotInterface() in Python, as follows.