Answer
In the 2016 film Rogue One, Alan Tudyk played K-2SO, a reprogrammed Imperial droid who joined the Rebel Alliance in their fight against the Galactic Empire. K-2SO was a sarcastic and witty droid who often provided comic relief, but he was also a skilled fighter and a valuable asset to the Rebel Alliance.