In short, for past missions NASA has said no, it was not a priority consideration.
In the future, this may change and it is being considered.
In EXPLORING MARS WITH SOLAR-POWERED ROVERS
.. there has been some interest in developing means to mitigate the effect of dust on the solar arrays for long-duration operation on Mars.. however, the engineering decision was that it would be more cost effective to oversize the arrays to account for the predicted degradation than it would be to fly a system to remove dust from the panels.
Since the operating temperature varies significantly during the day, and the spectrum of the incident sunlight varies both with time of day and with the amount of dust in the atmosphere, the performance of the solar arrays on Mars is complicated.
https://ntrs.nasa.gov/api/citations/20060013412/downloads/20060013412.pdf
With the latest Mars-bound rover (explored more below) in its current configuration, they calculated that it would be acceptable to have more than 30% loss in power output by the time the rover reached its end of life due to dust coverage, rather than try and design some kind of dust removal mechanism.
In 2017, NASA did include this provision with the request for concepts in the period 2018-2020:
Mars Surface Solar Array Structures
NASA Space Tech “seedling” study to
develop a Mars power architecture with
deployable solar arrays
Note requirement number 14: Ability to tilt arrays for dust removal and to feather in high winds.
Unfortunately, no concepts were delivered that satisfied this requirement.
https://ntrs.nasa.gov/api/citations/20170004910/downloads/20170004910.pdf
In 2019, dust removal of some kind was still listed as something that needs to be looked at:
Although Compact Telescoping Surface Array for Mars Solar Power was considered as most promising for future Mars solar array technology, dust removal of some kind was ... the subject of on-going studies...
Technology Gaps and Additional Trade Studies
Dust abatement/removal technology.
- Demonstrate high effectiveness (>90% dust clearing) on flexible blanket solar arrays
https://ntrs.nasa.gov/api/citations/20190000437/downloads/20190000437.pdf
With regards to ExoMars, a rover bound for Mars (or Moon, as suggested in light of the withdrawal of Russian involvement recently): It was looked at originally, and then in its current configuration they decided that no - it was too risky, and too costly.
With the rebirth of the ExoMars mission (not launching before 2028) - they are looking at it again, so this changes to a maybe.
(Note: aka Rosalind Franklin Rover, so @uhoh's question is also here Will the Rosalind Franklin (ExoMars) rover solar panels be able to clear themselves of dust by tilting?)
https://www.space.com/saving-mars-robots-from-death-by-dust
Tilting solar panels
Mike Williams, Chief Engineer at Airbus Defence and Space, agrees that NASA's approach of outsized solar panels is the best, safest and cheapest when it comes to dust-proofing Mars-exploring spacecraft. However, Airbus is currently looking at the possibility of adding a dedicated dust defense capability, and they have plenty of time to do that. The mission, built in cooperation with Russia, was suspended in the wake of Russia's invasion of Ukraine. The planned September launch was canceled, and Airbus is now storing the ExoMars rover in a clean room as some critical components, originally built by Russia, have to be replaced.
"Sizing the arrays to be able to manage the lower amount of sunlight that reaches them because of the dust is the best and simplest solution," Williams told Space.com. "It's the lowest level of complexity. It requires the least number of subsystems and functions and so it has the lowest risk. From the perspective of designing a mission, that's definitely the most preferable way of going about it."
Williams said that when the ExoMars mission was first conceived, engineers considered a plethora of dust cleaning technologies, including brushes, wipers, gas blowers and electrostatic wipers to get rid of the dust. At that time, they decided the rover, whose nominal mission in Oxia Planum was designed to last only 180 Martian days, or sols, did not need to self-clean. With the new launch date now expected no earlier than 2028, they are rethinking their approach again.
"With ExoMars now being reborn, we are looking at possibly reinstating some of that capability," Williams said. "We could use something like solar panel tilting to possibly dislodge some of that dust. It would also help point the panels more efficiently at the sun, which may also have some benefits."
Williams added that Airbus engineers, just like NASA's, have to reconcile with the fact that ExoMars, just like other spacecraft on Mars, may eventually succumb to dust, and won't be disappointed if the rover outlasts its designed mission lifetime only marginally. Although they hope to get some help from Martian weather just like Spirit and Opportunity.
"It's just, it's just the way it goes with space missions, unfortunately," Williams said.
Circa 2009, ExoMars did originally have tilting ability built into the solar array:
Although originally meant for Dawn/Dusk solar optimization, this could be revisited for dust alleviation.
https://www.lpi.usra.edu/mepag/meetings/archive/meeting/2009-07/04-Mepag_Coradini.pdf
Looking at other NASA docs, dust was a concern, but other items were higher on the list of concerns:
(The arrays in this concept lock after fold out, no tilting considered)
https://pdfs.semanticscholar.org/772a/2f6e1b9b50e64295895eb88e7c715012855d.pdf
https://www.researchgate.net/publication/24286713_Solar_radiation_on_Mars_Tracking_photovoltaic_array
InSight's self-cleaning attempt
Even though InSight wasn't built to wipe dust off of itself, NASA made some last resort attempts to help the lander remove some of the dust in the final months of its life as the amount of electricity generated by its panels dwindled.
In May (2021), ground controllers commanded InSight's robotic arm to sprinkle a bit of sand across one of the lander's dust-covered panels. As wind blew the sand grains across the panel, they actually picked up some of the dust along the way, reducing the thickness of the sun-obstructing dust blanket.
The operation enabled the lander to gain about 30 watt-hours of energy per sol at that time.
https://mars.nasa.gov/resources/25952/insights-robotic-arm-helps-remove-solar-panel-dust-trickles-sand-in-the-wind/?site=insight
InSight's Robotic Arm Helps Remove Solar Panel Dust Trickles Sand in the Wind
https://ntrs.nasa.gov/api/citations/20205004953/downloads/IAPG%20RECWG%20NASA%20July%202020.pdf