Skip to content

Pure Pursuit - Group 2#7

Open
sbanerjee13 wants to merge 4 commits intomasterfrom
pure-pursuit-2
Open

Pure Pursuit - Group 2#7
sbanerjee13 wants to merge 4 commits intomasterfrom
pure-pursuit-2

Conversation

@sbanerjee13
Copy link
Copy Markdown

No description provided.

@gradyw gradyw changed the title Create PurePursuit.java Pure Pursuit - Group 2 Dec 5, 2019
sbanerjee13 and others added 2 commits December 6, 2019 11:44
Please update these methods so that they work with your pure pursuit class
}

public static double[][] doubleArrayCopy(double[][] arr) // Method for copying matrices, something that comes up quite often. Credit to KHEngineering for method.
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@sbanerjee13 do you understand why you use this instead of java's built in method to copy arrays?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The built in method (Arrays.copyOf) only copies one-dimensional arrays. Thus, we need a separate algorithm for copying matrices.

for(int j=0; j<path[i].length; j++)
{
double aux = newPath[i][j];
newPath[i][j] += weight_data * (path[i][j] - newPath[i][j]) + weight_smooth * (newPath[i-1][j] + newPath[i+1][j] - (2.0 * newPath[i][j]));
Copy link
Copy Markdown
Collaborator

@gradyw gradyw Dec 8, 2019

Choose a reason for hiding this comment

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

@sbanerjee13 it looks to me that this does not make sense and would always equal zero. Do you understand it?

(path[i][j] - newPath[i][j])

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