Obika was named Sponsors Man of the Match against Rovers, who finished with 10 players after Richard Chaplow’s 78th minute sending off.
The win moves the Robins up to 11th place in League One with 48 points from 34 matches played.
Luke Williams made two changes to his starting lineup from the team that started at Peterborough with Ellis Iandolo replacing Fabien Robert and Drissa Traore starting in place of Louis Thompson.
Doncaster kicked off playing towards the 888PSport Town End but it was Swindon who made a bright start with Barry popping up on the right hand side of the penalty area sending in a cross towards Obika but the defence cleared at the expense of a corner.
Jon Obika set up Ellis Iandolo with a great chance in the 17th minute with a cheeky backheel allowing the Town number 28 to shoot but the keeper Stuckmann parried his effort at the expense of a corner and when that was taken, the ball eventually reached Traore and he too was denied by the keeper who made a good save to push the ball out from the Frenchman's long range shot.
Town’s leading scorer Nicky Ajose was denied by the keeper after latching onto a superb ball from Iandolo and shooting goalwards but Stuckmann pushed the ball over the crossbar.
The visitors threatened briefly through Mitchell Lund but his first time effort flew well over the crossbar in the 27th minute and just over a minute later Town were awarded a free kick for a tug on Obika’s shirt. Up stepped Ajose but his effort lacked height and the ball pinged about in the penalty area before Jamie Sendles-White sent in a low shot which went just wide of the upright.
Town were enjoying plenty of possession without getting a final shot on goal as the half wore on but in the 40th minute Doncaster’s Grant gained possession and his first time shot went wide of the upright.
Town grabbed the lead deep in added time after clearing a Doncaster corner when Obika grabbed possession and charged downfield before the ball was crossed by Barry to Michael Doughty who headed goalbound. Jon Obika got the final touch to make sure. The visitors appealed for offside but the referee awarded the goal and then blew for halftime a few seconds after the restart.
Town started the second half buoyed by the goal and there was an early chance for Ajose but his close range shot was parried by Stuckmann for a corner but the resulting cross was eventually cleared.
Brandon Ormonde Ottewill picked up possession from Barry’s long ball on the left hand side of the penalty area before firing in a low shot which was well taken by the keeper.
Lynden Gooch replaced Middleton in the 54th minute for the visitors which signalled more attacking intent from the visitors leading to Chaplow firing in a powerful shot which Vigouroux did well to tip away for a corner.
Ellis Iandolo left the field to good applause in the 61st minute after putting in a good performance to be replaced by Fabien Robert.
Richard Chaplow was cautioned in the 63rd minute for pushing Doughty in retaliation at a free kick.
Louis Thompson replaced Doughty in the 65th minute and he too received a good round of applause.
Town had withstood a period of pressure before Jon Obika collected the ball inside and his own half before outpacing the chasing defence to fire past Stuckmann for his 11th goal of the season in the 66th minute.
The visitors counterattacked strongly in the 68th minute through Gooch who advanced into the penalty area before he was denied by two Towm defenders who did well to protect their goal.
Doncaster were reduced to 10 men when Chaplow was shown a second yellow card having previously been cautioned in the 63rd minute.
Andy Williams was replaced by Gary McKenzie in the 80th minute and the Town fans generously applauded his contribution.
Nathan Thompson was replaced by Anton Rodgers in the 84th minute and the Town captain gave his armband to brother Louis.
Aaron Taylor-Sinclair popped up in attack to fire in a low shot which was well taken by Vigouroux as the visitors threatened in the 89th minute.
Brad Barry set Fabien Robert up with a shooting chance early in the four minutes of added time but Robert’s shot went wide and that proved to be the last main action of the match as Town kept a clean sheet and earned all three points.