HTML5 Icon   Salsa   HTML5 Icon

The Numerical Code Transformation



Overview

Example

Salsa has been evaluated on a suite of control algorithms and numerical methods to improve their numerical accuracy of computations. The experiment results shown that our tool improves significantly their accuracy.

Computing the position (x, y) of a two wheeled robot by odometry in a Cartesian space. The instantaneous rotation speeds sl and sr of the left and right wheels are given.

Before Transformation

sl = [0.52, 0.53, 0.0, 0.0];
%salsa%
double main(){
x = 0.0 ; y = 0.0 ; arg = 0.0 ; delta_d = 0.0 ;
delta_dl = 0.0 ; delta_dr = 0.0 ; delta_theta = 0.0 ;
sr = 0.62831853071 ; t = 0.0; x = 0.0 ; y = 0.0 ;
inv_l = 0.1 ; c = 12.34 ; theta = -0.985 ;
while (t ‹ 1.0) {
  delta_dl = c * sl ;
  delta_dr = c * sr ;
  delta_d = (delta_dl + delta_dr) * 0.5 ;
  delta_theta = (delta_dr - delta_dl) * inv_l ;
  arg = theta + (delta_theta * 0.5) ;
  z = cosi(arg) ;
  x = x + (delta_d * z) ;
  q = sini(arg) ;
  y = y + (delta_d * q) ;
  theta = theta + delta_theta ;
  t = t + 0.1;
  }
return y ;
}

double cosi(double a){
  b = 1.0 - (a * a * 0.5) + ((a * a * a * a) * 0.0416) ;
  return b;
}

double sini(double u){
  w = u - ((u * u * u) * 0.1666) + ((u * u * u * u * u) * 0.0083) ;
  return w;
}

HTML5 Icon

After Transformation

sl = [0.52,0.53,-0.,0.]
%salsa%
double main() {
t = 0.0 ; theta = -0.985 ; y = 0.0 ; x = 0.0 ; arg = 0.0 ;
delta_theta = 0.0 ; delta_d = 0.0 ; delta_dr = 0.0 ; delta_dl = 0.0 ;
while (t < 1.0) {
  delta_dl = (12.34 * sl) ;
  delta_dr = 7.753450668961398 ;
  delta_d = (0.5 * (delta_dl + delta_dr)) ;
  delta_theta = (0.1 * (delta_dr - delta_dl)) ;
  arg = (theta + (delta_theta * 0.5)) ;
  z = cosiTMP_2(theta,delta_theta) ;
  x = (x + (delta_d * z)) ;
  q = siniTMP_4(theta,delta_theta) ;
  y = (y + (delta_d * q)) ;
  theta = (theta + delta_theta) ;
  t = (t + 0.1) ;
  } ;
return y ;
}

double siniTMP_4(double theta,double delta_theta) {
  TMP_3 = (theta + (delta_theta * 0.5)) ;
  w = ((TMP_3 - (0.1666 * (TMP_3 * (TMP_3 * TMP_3)))) + (((((0.0083 * TMP_3) * TMP_3) * TMP_3) * TMP_3) * TMP_3)) ;
  return w ;
}

double cosiTMP_2(double theta,double delta_theta) {
  TMP_1 = (theta + (delta_theta * 0.5)) ;
  b = ((1.0 - (0.5 * (TMP_1 * TMP_1))) + ((((0.0416 * TMP_1) * TMP_1) * TMP_1) * TMP_1)) ;
  return b ;
}



The difference between the two trajectories of the robot before and after transformation.
HTML5 Icon
The accuracy of the transformed Odometry program is improved by 21%

Software Architecture

HTML5 Icon

Documentation

How does Salsa work?

Parameters

Bibliographie

click here to find more details on our Salsa tool and its different applications.

News

- Integrating the affine arithmetic to compute a more safe error bounds

Contacts

For any question, please feel free to send us a mail!