srobo / sr-robot3-j5

Python 3 API for Student Robotics Kit - Built with j5
MIT License
4 stars 1 forks source link

Add property to determine if the code is in the simulator or not #75

Closed trickeydan closed 2 years ago

trickeydan commented 2 years ago

Requested in Discord

PeterJCLaw commented 2 years ago

Depending somewhat on how much we want this to be the canonical approach, this is already possible fairly easily. There are various properties on Robot.metadata which are hard-coded to empty or None values which will be non-empty on the kits.

See https://github.com/srobo/competition-simulator/blob/master/modules/sr/robot3/metadata.py