If you’ve ever dreamed about getting a good night’s sleep, your answer may someday lie in data generated by your sleepwear. Researchers have developed pajamas embedded with self-powered sensors that provide unobtrusive and continuous monitoring of heartbeat, breathing and sleep posture — all factors that play a role in how well a person slumbers.