I really wanted to make this a private function, but to do so would mean RobotInteraction would have to be a friend of InteractionHandler, which I really don't want to do (breaks encapsulation).  I considered adding a new class which is a friend of InteractionHandler and is inherited by RobotInteraction with a single method that calls setRobotInteraction, but that seemed like a lot of complexity.

On the other hand, making this a public function does not really hurt anything.  It is an error (print error and do nothing) to call it with anything other than the RobotInteraction it is already associated with, and calling it with that RobotInteraction does nothing.  So it is benign to call this.  

I could put it in a separate (but still public) section of the class (e.g. at the end) to make it clear it is not part of the public interface.  Another idea is to name it specially (e.g. leading or trailing underscore) to make it clear it is  not really part of the public interface.

I think the best solution is to have the RobotInteraction be a parameter of the InteractionHandler constructor.  This function will not be needed anymore.  But legacy code may still use the old constructor so I don't know if I can get rid of it (your opinion?), which means this function is still needed.

I struggled with this for way longer than such a trivial detail merits, so if you have any good solutions to this problem in general I'd love to hear them.