Giter Club home page Giter Club logo

dubins-path-pp's Introduction

Hey there fellow engineer πŸ‘‹

  • β˜• always up for philosophy-101 discussions over a cup of tea/coffee

and also,

dubins-path-pp's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jiangwei1009

dubins-path-pp's Issues

Two question

  1. The speed direction does not match the path.
  2. All paths are not exhausted.
    consider about the following file
    %starting Pose
    xs = 0; ys = 0; phis=deg2rad(90);
    %final Pose
    xf = 10; yf = 10; phif=deg2rad(70);
    %curvature constraints:εŠεΎ„ε€§ε°
    rhos = 3; rhof = 1;
    Mode = 3;%1、L+L 2、L+R 3、R+R 4、R+L
    %center of curvature circles: ε·¦θ½¬εœ†ε’Œε³θ½¬εœ†
    xcs_L = xs - rhoscos(phis - pi/2);
    ycs_L = ys - rhos
    sin(phis - pi/2);
    xcf_L = xf - rhofcos(phif - pi/2);
    ycf_L = xf - rhof
    sin(phif - pi/2);
    xcs_R = xs + rhoscos(phis - pi/2);
    ycs_R = ys + rhos
    sin(phis - pi/2);
    xcf_R = xf + rhofcos(phif - pi/2);
    ycf_R = xf + rhof
    sin(phif - pi/2);
    %%
    switch Mode
    case 1%L+L
    %tangent entry (E) and exit (X)
    c = sqrt((xcs_L - xcf_L)^2 + (ycs_L-ycf_L)^2);
    alpha = asin((rhof-rhos)/c);
    beta = atan2(ycf_L-ycs_L, xcf_L - xcs_L);
    %E
    % phi = alpha+beta +pi/2; % right turn
    phi = beta-alpha +3pi/2; % left turn
    xPX = xcs_L + rhos
    cos(phi);
    yPX = ycs_L + rhossin(phi);
    %X
    %phi = alpha+beta +pi/2; %right turn
    phi = beta-alpha +3
    pi/2; %left turn
    xPN = xcf_L + rhofcos(phi);
    yPN = ycf_L + rhof
    sin(phi);
    xcs = xcs_L;ycs = ycs_L; xcf = xcf_L; ycf = ycf_L;
    case 2%L+R
    %tangent entry (E) and exit (X)
    c = sqrt((xcs_L - xcf_R)^2 + (ycs_L-ycf_R)^2);
    alpha = asin((rhof-rhos)/c);
    beta = atan2(ycf_R-ycs_L, xcf_R - xcs_L);
    %E
    % phi = alpha+beta +pi/2; % right turn
    phi = beta-alpha +3pi/2; % left turn
    xPX = xcs_L + rhos
    cos(phi);
    yPX = ycs_L + rhossin(phi);
    %X
    phi = alpha+beta +pi/2; %right turn
    %phi = beta-alpha +3
    pi/2; %left turn
    xPN = xcf_R + rhofcos(phi);
    yPN = ycf_R + rhof
    sin(phi);
    xcs = xcs_L;ycs = ycs_L; xcf = xcf_R; ycf = ycf_R;
    case 3% R+R
    %tangent entry (E) and exit (X)
    c = sqrt((xcs_R - xcf_R)^2 + (ycs_R-ycf_R)^2);
    alpha = asin((rhof-rhos)/c);
    beta = atan2(ycf_R-ycs_R, xcf_R - xcs_R);
    %E
    phi = alpha+beta +pi/2; % right turn
    %phi = beta-alpha +3pi/2; % left turn
    xPX = xcs_R + rhos
    cos(phi);
    yPX = ycs_R + rhossin(phi);
    %X
    phi = alpha+beta +pi/2; %right turn
    %phi = beta-alpha +3
    pi/2; %left turn
    xPN = xcf_R + rhofcos(phi);
    yPN = ycf_R + rhof
    sin(phi);
    xcs = xcs_R;ycs = ycs_R; xcf = xcf_R; ycf = ycf_R;
    otherwise%R+L
    %tangent entry (E) and exit (X)
    c = sqrt((xcs_R - xcf_L)^2 + (ycs_R-ycf_L)^2);
    alpha = asin((rhof-rhos)/c);
    beta = atan2(ycf_L-ycs_R, xcf_L - xcs_R);
    %E
    phi = alpha+beta +pi/2; % right turn
    %phi = beta-alpha +3pi/2; % left turn
    xPX = xcs_R + rhos
    cos(phi);
    yPX = ycs_R + rhossin(phi);
    %X
    %phi = alpha+beta +pi/2; %right turn
    phi = beta-alpha +3
    pi/2; %left turn
    xPN = xcf_L + rhofcos(phi);
    yPN = ycf_L + rhof
    sin(phi);
    xcs = xcs_R;ycs = ycs_R; xcf = xcf_L; ycf = ycf_L;
    end
    %%
    %%%%%η»˜ε›Ύ
    close all;
    figure()
    hold on
    %plot circles:
    centers = [xcs ycs; xcf ycf]; radii = [rhos; rhof];
    viscircles(centers,radii)%η”»ε€šδΈͺεœ†
    %plot poses:
    scatter(xs, ys,45, '','r','LineWidth',5);
    scatter(xf, yf,45, '
    ','r','LineWidth',5);
    %plot center line
    xc = [xcs xcf];
    yc = [ycs ycf];
    plot(xc, yc, '--')
    xT = [xPX xPN]; yT = [yPX yPN];
    plot(xT, yT, 'k','lineWidth', 3)
    hold off
    daspect([1,1,1])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.