PR2 / pr2_controllers

The controllers that run in realtime on the PR2 and supporting packages.
46 stars 34 forks source link

caster angle errors published by pr2_base_controller2 are wrong #379

Open goretkin opened 9 years ago

goretkin commented 9 years ago

If you rostopic echo /base_controller/state after having moved the robot around in circles but keeping the same heading, the casters will have rotated around (they're continuous rotation joints), the first four numbers of joint_error: corresponding to the caster angles, will be multiples of pi, even though the true error is zero as calculated for the PID controller: https://github.com/PR2/pr2_controllers/blob/02376d1a1899b71f561dc0e669786cfbc4d3d512/pr2_mechanism_controllers/src/pr2_base_controller2.cpp#L407-L413

The error calculation for publishing (here: https://github.com/PR2/pr2_controllers/blob/02376d1a1899b71f561dc0e669786cfbc4d3d512/pr2_mechanism_controllers/src/pr2_base_controller2.cpp#L346) should match the error calculation above.

trainman419 commented 9 years ago

If you change this, be very careful in your testing. If the gains or the error term for any of the caster motors is wrong, the motors can fight each other and burn out.

I recommend lifting the robot slightly off the floor by putting it on wooden blocks while testing this.