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

robotsquiggles's Difference to JaciBrunning's Pathfinder #70

Open
vex-lq opened this issue May 15, 2024 · 1 comment
Open

robotsquiggles's Difference to JaciBrunning's Pathfinder #70

vex-lq opened this issue May 15, 2024 · 1 comment

Comments

@vex-lq
Copy link

vex-lq commented May 15, 2024

hi, I tried baylessj's robotsquiggles at baylessj/robotsquiggles, and with the same parameters:

(1)squiggles:
const double MAX_VEL = 2; // in meters per second
const double MAX_ACCEL = 3.0; // in meters per second per second
const double MAX_JERK = 6.0; // in meters per second per second per second
const double ROBOT_WIDTH = 0.4; // in meters
squiggles::Constraints constraints_3 = squiggles::Constraints(MAX_VEL, MAX_ACCEL, MAX_JERK);
squiggles::SplineGenerator generator = squiggles::SplineGenerator(
constraints_3,
std::make_sharedsquiggles::TankModel(ROBOT_WIDTH, constraints_3),0.01);
std::vectorsquiggles::ProfilePoint path_3 = generator.generate({
squiggles::Pose(0.5, 0.2, 1),
squiggles::Pose(0.5, 0.5, 1)});

(2) Pathfinder :
int POINT_LENGTH = 2;
Waypoint points = (Waypoint)malloc(sizeof(Waypoint) * POINT_LENGTH);
Waypoint p1 = { 0.5, 0.2, 1 }; // Waypoint @ x=-4, y=-1, exit angle=45 degrees
Waypoint p2 = { 0.5, 0.5, 1 }; // Waypoint @ x=-1, y= 2, exit angle= 0 radians
points[0] = p1;
points[1] = p2;
TrajectoryCandidate candidate;
pathfinder_prepare(points, POINT_LENGTH, FIT_HERMITE_QUINTIC, PATHFINDER_SAMPLES_HIGH, 0.01, 2, 3, 6, &candidate);
free(points);
int length = candidate.length;
Segment *trajectory = (Segment *)malloc(length * sizeof(Segment));
pathfinder_generate(&candidate, trajectory);

and I get different trajectory,as below, red line for left wheel,cyan line for left wheel, and green line for squiggles trajectory, and blue line for Pathfinder trajectory。
image

it seems that squiggles trajectory is more complicated, but on the other hand, squiggles use cpp, costing 100ms to generate, while Pathfinder use c, and costs 2000ms+...

can you explain to me the difference?

@vex-lq
Copy link
Author

vex-lq commented May 15, 2024

    Pose(0.2, 0.7, 0),
    Pose(1.1, 2.0, deg2rad(135))

now, pathfinder trajectory is more complicated..
image

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

No branches or pull requests

1 participant