Warming Up
The safest way to warm up before playing tennis seems to be to have both players stand on the service line and tap the ball on one bounce back and forth. This allows you to warm up your hand/eye coordination and find good contact without risking a painful mishit with a full swing.
For some players this is not easy. Many players today are taught to take a full swing the
first time they step onto the court. If your opponent prefers too warm up from the baseline, be sure to swing slowly and watch the ball closely to avoid mishitting the ball with a full swing. It is best not to do anything quickly until you have broken a sweat. Overdressing at the start helps. Some like to jog a few laps around the court. Some like to take a few practice swings.
When you do move back and take full swings, start out with a steady top spin balls that land close to your partner/opponent. If you are playing a match, look out for which side does your opponent step around. This usually tells you which one is the weaker side. Hit a few more shots to the backhand side and the forehand side to see which they prefer more. One important note is to remember to take a few at net to warm up as well. The best is to warm up before getting to your match.
In addition, remember to do a few laps before the match in order to warm up the legs. If you want to channel what Nadal does, run and touch the baseline side to side.