Graphviz 16.1.1~dev.20261101.1716
Loading...
Searching...
No Matches
route.c File Reference
#include "config.h"
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <pathplan/pathutil.h>
#include <pathplan/solvers.h>
#include <stdio.h>
#include <stdlib.h>
#include <util/list.h>
Include dependency graph for route.c:

Go to the source code of this file.

Data Structures

struct  tna_t
 

Macros

#define EPSILON1   1E-3
 
#define EPSILON2   1E-6
 
#define DISTSQ(a, b)    ((((a).x - (b).x) * ((a).x - (b).x)) + (((a).y - (b).y) * ((a).y - (b).y)))
 

Typedefs

typedef struct tna_t tna_t
 

Functions

typedef LIST (static int reallyroutespline(Pedge_t Ppoint_t)
 
static int reallyroutespline (Pedge_t *edges, size_t edgen, Ppoint_t *inps, int inpn, Ppoint_t ev0, Ppoint_t ev1)
 
static int mkspline (Ppoint_t *inps, int inpn, const tna_t *tnas, Ppoint_t ev0, Ppoint_t ev1, Ppoint_t *sp0, Ppoint_t *sv0, Ppoint_t *sp1, Ppoint_t *sv1)
 
static double dist_n (Ppoint_t *p, int n)
 
static int splinefits (Pedge_t *edges, size_t edgen, Ppoint_t pa, Pvector_t va, Ppoint_t pb, Pvector_t vb, Ppoint_t *inps, int inpn)
 
static int splineisinside (Pedge_t *edges, size_t edgen, Ppoint_t *sps)
 
static int splineintersectsline (Ppoint_t *sps, Ppoint_t *lps, double *roots)
 
static void points2coeff (double v0, double v1, double v2, double v3, double *coeff)
 
static void addroot (double root, double *roots, int *rootnp)
 
static Pvector_t normv (Pvector_t v)
 
static Ppoint_t add (Ppoint_t p1, Ppoint_t p2)
 
static Ppoint_t sub (Ppoint_t p1, Ppoint_t p2)
 
static double dist (Ppoint_t p1, Ppoint_t p2)
 
static Ppoint_t scale (Ppoint_t p, double c)
 
static double dot (Ppoint_t p1, Ppoint_t p2)
 
static double B0 (double t)
 
static double B1 (double t)
 
static double B2 (double t)
 
static double B3 (double t)
 
static double B01 (double t)
 
static double B23 (double t)
 

Macro Definition Documentation

◆ DISTSQ

#define DISTSQ (   a,
  b 
)     ((((a).x - (b).x) * ((a).x - (b).x)) + (((a).y - (b).y) * ((a).y - (b).y)))

Definition at line 30 of file route.c.

◆ EPSILON1

#define EPSILON1   1E-3

Definition at line 22 of file route.c.

◆ EPSILON2

#define EPSILON2   1E-6

Definition at line 23 of file route.c.

Typedef Documentation

◆ tna_t

typedef struct tna_t tna_t

Function Documentation

◆ add()

static Ppoint_t add ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 402 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Referenced by eval(), mkspline(), and reallyroutespline().

Here is the caller graph for this function:

◆ addroot()

static void addroot ( double  root,
double *  roots,
int *  rootnp 
)
static

Definition at line 386 of file route.c.

Referenced by splineintersectsline().

Here is the caller graph for this function:

◆ B0()

static double B0 ( double  t)
static

Definition at line 428 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ B01()

static double B01 ( double  t)
static

Definition at line 445 of file route.c.

Referenced by mkspline().

Here is the caller graph for this function:

◆ B1()

static double B1 ( double  t)
static

Definition at line 433 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ B2()

static double B2 ( double  t)
static

Definition at line 438 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ B23()

static double B23 ( double  t)
static

Definition at line 450 of file route.c.

Referenced by mkspline().

Here is the caller graph for this function:

◆ B3()

static double B3 ( double  t)
static

Definition at line 443 of file route.c.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ dist()

static double dist ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 412 of file route.c.

References dx, dy, Pxy_t::x, and Pxy_t::y.

Referenced by mkspline(), and reallyroutespline().

Here is the caller graph for this function:

◆ dist_n()

static double dist_n ( Ppoint_t *  p,
int  n 
)
static

Definition at line 195 of file route.c.

Referenced by splinefits().

Here is the caller graph for this function:

◆ dot()

static double dot ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 424 of file route.c.

References Pxy_t::x, and Pxy_t::y.

◆ LIST()

typedef LIST ( static int reallyroutespline(Pedge_t  Ppoint_t)

Definition at line 33 of file route.c.

◆ mkspline()

static int mkspline ( Ppoint_t *  inps,
int  inpn,
const tna_t *  tnas,
Ppoint_t  ev0,
Ppoint_t  ev1,
Ppoint_t *  sp0,
Ppoint_t *  sv0,
Ppoint_t *  sp1,
Ppoint_t *  sv1 
)
static

Definition at line 155 of file route.c.

References add(), B01(), B23(), dist(), dot, scale(), and sub.

Referenced by reallyroutespline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normv()

static Pvector_t normv ( Pvector_t  v)
static

Definition at line 391 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Referenced by reallyroutespline().

Here is the caller graph for this function:

◆ points2coeff()

static void points2coeff ( double  v0,
double  v1,
double  v2,
double  v3,
double *  coeff 
)
static

Definition at line 378 of file route.c.

Referenced by splineintersectsline().

Here is the caller graph for this function:

◆ reallyroutespline()

static int reallyroutespline ( Pedge_t *  edges,
size_t  edgen,
Ppoint_t *  inps,
int  inpn,
Ppoint_t  ev0,
Ppoint_t  ev1 
)
static

Definition at line 93 of file route.c.

References tna_t::a, add(), B0(), B1(), B2(), B3(), dist(), free(), mkspline(), normv(), NULL, reallyroutespline(), scale(), splinefits(), sub, tna_t::t, Pxy_t::x, and Pxy_t::y.

Referenced by reallyroutespline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale()

static Ppoint_t scale ( Ppoint_t  p,
double  c 
)
static

Definition at line 419 of file route.c.

References Pxy_t::x, and Pxy_t::y.

Referenced by mkspline(), and reallyroutespline().

Here is the caller graph for this function:

◆ splinefits()

static int splinefits ( Pedge_t *  edges,
size_t  edgen,
Ppoint_t  pa,
Pvector_t  va,
Ppoint_t  pb,
Pvector_t  vb,
Ppoint_t *  inps,
int  inpn 
)
static

Definition at line 206 of file route.c.

References dist_n(), EPSILON1, LIST_TRY_APPEND, splineisinside(), Pxy_t::x, and Pxy_t::y.

Referenced by reallyroutespline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splineintersectsline()

static int splineintersectsline ( Ppoint_t *  sps,
Ppoint_t *  lps,
double *  roots 
)
static

Definition at line 305 of file route.c.

References addroot(), points2coeff(), solve3(), Pxy_t::x, and Pxy_t::y.

Referenced by splineisinside().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splineisinside()

static int splineisinside ( Pedge_t *  edges,
size_t  edgen,
Ppoint_t *  sps 
)
static

Definition at line 277 of file route.c.

References Pedge_t::a, Pedge_t::b, DISTSQ, EPSILON1, EPSILON2, splineintersectsline(), Pxy_t::x, and Pxy_t::y.

Referenced by splinefits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub()

static Ppoint_t sub ( Ppoint_t  p1,
Ppoint_t  p2 
)
static

Definition at line 407 of file route.c.

References Pxy_t::x, and Pxy_t::y.