-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow TankModifier to produce negative velocity for inside wheel on tight curves #50
base: master
Are you sure you want to change the base?
Conversation
…into TankNegativeDistance
Could this now work with waypoint 0,0,0 to 0,0,90(degrees). Previously and understandably it would produce sigsegs |
It won't do that. It only addresses sharp turns in the rank modifier. |
if ((last_seg.x > seg.x && last_right.x < right.x) || (last_seg.y > seg.y && last_right.y < right.y) || | ||
(last_seg.x < seg.x && last_right.x > right.x) || (last_seg.y < seg.y && last_right.y > right.y)) { | ||
right_distance = -right_distance; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate? Not sure I am seeing what you mean...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing is just a bit off here. Remove a space from the line commented on so it lines up with the if
statement. Sorry, just have an eye for this kind of stuff 😂
For Issue #36
I modified the logic in tank.c to detect when the left or right path is moving in the opposite direction as the original path. In such cases, I negate the distance which in turn generates a negative velocity.
I tested a bunch of tight turns, and the velocity goes negative as expected (i.e. when the inside path goes back on itself)