On duty, yes we have a duty to based on policy at most agencies, and depending on the state the law. Off duty we may actually have policy that states we are not to get involved period (yes it's crazy, but that has never stopped police administrators).
In most armed robberies that aren't an immediate shooting/stabbing/beating, the assailant has the weapon as a tool of intimidation and does not use it. Think bank robberies, very rarely is violence used (heck a weapon isn't most of the time). Provided that the there is no particularized threat to anyone, besides the presences of a weapon, the smart thing to do may just be a very good witness, formulate an action plan, and be prepared to act upon it. What constitutes a "go signal" for you may be different then me, etc. Whatever it is though have it figured out ahead of time.
A real life example I can give you from personal experience. Suspect walked into the restaurant pulled his pistol out, held it about waist level and calmly told the cashier to open the register and hand over the money. Yes a firearm is involved, yes it does represent a deadly force threat, but do I really want to get into a shoot out in the middle of a crowded restaurant full of people and kids? There has been no threat with the weapon, it's not being particularly aimed at the cashier, and the suspects demeanor is very calm. Could I be justified in being involved in a shooting, most likely, would it be the best course of action? Probably not. World's best witness time. I certainly had a plan of action in mind, I took steps to get myself in the best position I was going to get surreptitiously in a crowded restaurant, and I knew what was going to be my "line in the sand" to act." However if at all possible, I wanted to avoid turning it into anything it didn't need to be.
Opposite end of the spectrum. Suspect walks into a major sporting goods store, goes to the customer service counter where they have a large amount of cash for returns. As he gets to the register, he produces a pistol, fires a round into the ceiling, and screams "it's a real ****'ing gun, and I aint afraid to ****ing use it!" Points it directly at the cashiers face and screams her to open the register all the while threatening to shoot her. Here we have a much different set of circumstances in specific, that overall are the same. I walked into the store about 60 seconds after the suspect bailed out through a side exit, didn't hear the shot from the parking lot. Not even my jurisdiction, and they were out of the caliber I was looking for ammo in. If I had been present though, there is a real possibility I would have felt that deadly force was the best option to handle the situation.
Not all armed robberies are the same. An experienced LEO has probably dealt with a lot them (if you live in an area where there is a risk of being present for one going down), and likely will have a very good idea seconds into the robbery if they are going to do anything and what.
-Jenrick