sourcebots / robot-api

(Legacy) API to interface with robotd
http://docs.sourcebots.co.uk/api/
MIT License
4 stars 1 forks source link

Log the current zone and mode on startup #91

Closed RealOrangeOne closed 6 years ago

RealOrangeOne commented 6 years ago

So it's more obvious what zone a robot is running in, which may be useful for debugging

PeterJCLaw commented 6 years ago

@RealOrangeOne this already happens when the start button is pressed, do we need it on startup as well?

Alternatively, should we remove that duplication?

RealOrangeOne commented 6 years ago

Ah, didn't realise that existed. Perhaps we remove it from the start signal? Not sure it's necessary there?

PeterJCLaw commented 6 years ago

I put it in the start signal primarily as a debugging aid for testing the start signal behaviour -- since it uses the same instance of the game state it's reliable as to whether the game timeout would get started. I'd like to leave that in place, even if we dialed it down to being debug rather than info. However: once we have that, I'm not sure what the benefits to having it elsewhere are?

RealOrangeOne commented 6 years ago

Personally I don't see why having it in the start signal is better, but as long as the values are presented, that's fine with me!

PeterJCLaw commented 6 years ago

@RealOrangeOne for clarity:

Given that the zone number and mode can change (by, for example, unplugging the USB stick and plugging in a different one, while the robot is running):

I still think from a debugging perspective the start signal is the right time to do this as it reduces two race-condition windows: