UbiquityRobotics / ubiquity_motor

Package that provides a ROS interface for the motors in UbiquityRobotics robots
BSD 3-Clause "New" or "Revised" License
25 stars 24 forks source link

Odom4wd scale factor for 4WD closer to reality odom. Decouple 4wd-2wd from thin wheel option #142

Closed mjstn closed 3 years ago

mjstn commented 3 years ago

Add a correction only for 4wd robot drive system that applies an odom correction for when the robot is doing a pure rotation in place.

We are also at this time decoupling the option for thin wheels from the option for use of 4wd vs 2wd. We had been forcing the internal option of 4wd whenever thin wheels were selected. They will be mostly separate now except for one case of when we do a default for unspecified option.

mjstn commented 3 years ago

This is not done yet and is here for a sort of preview or second set of eyes to take a look at this correction we are forced to implement to better indicate in odom rotation the real rotation we have done due to a lot of wheel slipping.

mjstn commented 3 years ago

This is now appearing to be functional and this PR is suitable for 1st review. Keep in mind it works on making the assumption that the wheel slip on all wheels is symmetrical which it often will not be the case. This hack is all we have so I feel it will make our rotational ODOM way closer to reality than before.

mjstn commented 3 years ago

Yes, g_odom4wdRotationScale will be set to 1.65 and enabled by default for 4WD mode. There is a dual-purpose thing I want to clean up but since other things do it already and we want this now I will not roll it into this pull request. You see I can check if we have thin wheels and then assume we are 4WD which I feel is a bit ugly because having thin wheels SHOULD simply modify encoder tics to odom calculations and also pid loop settings. There really should be in motor_hardware also the option that is in motor_node.cc where we have the 2wd or 4wd but it has never made it's way to motor_hardware.cc yet. So that will be the change I make then ask for tests once you guys get wheels. But if it looks good enough we may just push it to Avalon to test once they are stable and I have tested all I can test in terms of time.

mjstn commented 3 years ago

Really BIG push today to this branch. We are trying to do these 3 things:

mjstn commented 3 years ago

This is now all ready for review and pushed into branch odom4wdScaleFactor

mjstn commented 3 years ago

Have added an informational elog for high wheel speed request so we can gain more insight into this high speed rotatation issue. We need to determine if the motor node is being ASKED to rotate at high speed or the motor node OR mcb has 'lost its wonkers'.

mjstn commented 3 years ago

Today I updated this PR to back out the warning message for high rotational rates and to back out the change of the wheel slip nulling conversion from fixed value to now a define. In this way this PR now covers one main change, not 3.