Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

DrewTheRat
Copy link

@DrewTheRat DrewTheRat commented Apr 15, 2018

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)

@vargoose84
Copy link

Could this now work with waypoint 0,0,0 to 0,0,90(degrees). Previously and understandably it would produce sigsegs

@DrewTheRat
Copy link
Author

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;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many spaces

Copy link
Author

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...

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 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants