Rover: allow steering to Motors beyond -1 to +1 range #8600
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to resolve and issue with loss of steering control for vehicles traveling at high speeds. This issue was caused by this earlier PR which moved the speed-scaling from the attitude controller to the motors library. The potential issue was recognised and sadly now it's been confirmed during beta testing. Comments from the PR are copied below:
This PR resolved the problem by allowing the high-level steering request sent to the motors to be outside the -1 to +1 range.
Below are images before and after showing the simulated vehicle is better able to achieve the desired turn rate. In this test an Ackermann style rover (i.e. separate throttle and steering controls) was driven slowly (2m/s) but with full left steering. In master, because the speed scaling, the steering output was scaled back too far to achieve the desired turn rate. With this PR the vehicle comes much closer.
Somewhat separately this PR also adds a new parameter MOT_SPD_SCA_BASE (i.e. "Motor Speed Scaling Base") which is equivalent to the similar "Vector Thrust Scaling Base" parameter. It allows the user to specify the lowest speed that the scaling is applied. I don't expect many people to change this but it could be useful especially for very slow vehicles because it will give them better steering control below 1m/s. Very fast vehicles that spend very little time below 1m/s.
This issue is discussed here in the Rover-3.4.0-rc1 beta testing thread.