In general people speak both languages. And because they can tell you are a tourist from the way you breathe :) they will not expect you to speak Spanish, nor Catalan. Having said this, you should always learn a few common words in the local language, such as greetings and please/thank you, as it shows you are making an effort. You said you are already planning on doing this, so why not add the extra effort and learn them in both Catalan and Spanish?
One rule of thumb could be using Spanish when asking for directions, when talking to the Guardia Civil/Mossos d'Esquadra (national/local police), and in any other situations in which you can't assume the person is a pure-bred Catalan. On the other hand, when you go to the market, when you enter local shops or local restaurants, you can attempt a
bon dia and
Regarding the tense situation you mention I would not worry about it. The situation might be tense between the Catalan government and the Spanish government. Since you belong to neither, nobody will expect you to be involved. I would say you might be over-thinking this too much.
On a personal note, I stick to Spanish when I tour Spain. The reason is simple: that's the language I know. I never had anyone get offended at me for speaking Spanish to them, not in Catalunya, not in Euskadi, nowhere. I always assumed it was because, as I said, they can tell I am tourist and generally appreciate it when I make the effort.