It is difficult to judge an animal’s emotional state, but researchers have devised a system that attempts to do just that.