Orbital rendezvous hovering phases

The LAAS laboratory is developing activities in the field of space. The space axis of the laboratory defines the development strategies in this field: main scientific themes, collaborations, technical choices. In this frame, I am a member of the space axis.

Spatial software development platform for orbital
rendezvous hovering phases

Since 2014, I implemented a software development platform for space embedded applications. In space only a few processors are used. The LEON3 processor is probably the most used for reasons of operational safety (see https://en.wikipedia.org/wiki/LEON). In our research projects we need to compare the performance of a standard algorithm like CSP with an original solution. For this purpose CSDP must be used directly on the LEON card. This approach, however, poses many technical problems because CSDP is not available for this type of processor and its rudimentary compilation chain provides no solution outside of Linux x86. CSDP depends on the Lapack library, this is the first technical step to solve. I use a Gaisler board with a LEON3 processor.

The research activity on space is also developing in the laboratory through the space axis. As such, I am the technical correspondent of my department in this area. This function makes it possible to define technical choices in this field, to also correspond with other departments of the laboratory.


Build of the "lapack-3.7.0" library for Sparc LEON3 on Linux

Cross compiler: X86 / Sparc: The installation of the cross compilation chain is the first step. Gaisler provides a LEON / x86 cross-compilation chain at this address: http://gaisler.com/anonftp/linux/linux-2.6/toolchains/sparc-linux-4.4.2/sparc-linux-ct-multilib- 0.0.7.tar.bz2.

Official website: http://www.netlib.org/lapack/
Archives: http://www.netlib.org/lapack/lapack-3.7.0.tgz
Release note: http://www.netlib.org/lapack/lapack-3.7.0.html

Step 1: Unpack the archive

$ tar xvzf lapack-3.7.0.tgz

Step 2: Change your path

$ echo $PATH

/opt/sparc-linux-4.4.2-toolchains/multilib/sparc-leon-linux-gnu/bin:/opt/sparc-linux-4.4.2-toolchains/multilib/libexec/gcc/sparc-leon-linux-gnu/4.4.2/:/opt/sparc-linux-4.4.2-toolchains/multilib/bin:/usr/local/gnu/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:.:/usr/local/X11_Contrib/bin/unknown

 
Step 3: Some variables configuration in shell
 

$ export CPPFLAGS="-I/opt/sparc-linux-4.4.2-toolchains/multilib/sparc-leon-linux-gnu/sys-root/usr/include"

$ export  CFLAGS="-g -O2"

$ export  LD="/opt/sparc-linux-4.4.2-toolchains/multilib/sparc-leon-linux-gnu/bin/ld"

$ export  LDFLAGS="-L/opt/sparc-linux-4.4.2-toolchains/multilib/lib/gcc/sparc-leon-linux-gnu/4.4.2"

$ export  CC=sparc-linux-gcc

 
Step 4: makefile generation

$ ./configure  --host=sparc-sun-sunos4.1.1

Step 5: generating the library

$ make

make[2]: Entering directory `/data/MAC/tmp/ORIGINAL/glpk-4.60/src'

/bin/bash ../libtool  --tag=CC   --mode=compile sparc-linux-gcc -DHAVE_CONFIG_H -I. -I..  -I. -I./amd -I./api -I./bflib -I./cglib -I./colamd -I./env -I./minisat -I./misc -I./mpl -I./proxy -I./simplex -I./zlib -I/opt/sparc-linux-4.4.2-toolchains/multilib/sparc-leon-linux-gnu/sys-root/usr/include  -g -O2 -MT libglpk_la-bfd.lo -MD -MP -MF .deps/libglpk_la-bfd.Tpo -c -o libglpk_la-bfd.lo `test -f 'bfd.c' || echo './'`bfd.c

...

Making all in examples

make[2]: Entering directory `/data/MAC/tmp/ORIGINAL/glpk-4.60/examples'

sparc-linux-gcc -DHAVE_CONFIG_H -I. -I..  -I./../src -I/opt/sparc-linux-4.4.2-toolchains/multilib/sparc-leon-linux-gnu/sys-root/usr/include  -g -O2 -MT glpsol.o -MD -MP -MF .deps/glpsol.Tpo -c -o glpsol.o glpsol.c

mv -f .deps/glpsol.Tpo .deps/glpsol.Po

/bin/bash ../libtool --tag=CC   --mode=link sparc-linux-gcc  -g -O2  -L/opt/sparc-linux-4.4.2-toolchains/multilib/lib/gcc/sparc-leon-linux-gnu/4.4.2 -o glpsol glpsol.o ../src/libglpk.la -lm

libtool: link: LD_LIBRARY_PATH="../src/.libs:/usr/local/openrobots/i386-linux/lib/openprs:/usr/local/lib" sparc-linux-gcc -g -O2 -o .libs/glpsol glpsol.o  -L/opt/sparc-linux-4.4.2-toolchains/multilib/lib/gcc/sparc-leon-linux-gnu/4.4.2 -L../src/.libs -lglpk -lm -Wl,-rpath -Wl,/usr/local/lib

 

At this point a library is created in the directory:

glpk-4.60/src/.libs$ ll *.a
-rw-rw-r-- 1 fcamps idea 3837144 Oct 23 15:31 libglpk.a

Content of the library libglpk.a :

$nm -C libglpk.a | less
libglpk_la-bfd.o:

00000338 T _glp_bfd_btran
000003ac T _glp_bfd_btran_s
000000b0 T _glp_bfd_condest
000008e8 T _glp_bfd_create_it
00000114 T _glp_bfd_delete_it
00000508 T _glp_bfd_factorize

...

 

Step 6: Test the library
 
$pwd
/data/MAC/tmp/glpk-4.60/src
fcamps@centaure:/data/MAC/tmp/glpk-4.60/src$ ll test.c
-rw-rw-r-- 1 fcamps idea 1452 Oct  6  2016 test.c
 
test.c :

#include <stdio.h>            /* C input/output                       */

#include <stdlib.h>           /* C standard library                   */

#include <glpk.h>             /* GNU GLPK linear/mixed integer solver */

int main(void)
{

 /* declare variables */

 glp_prob *lp;

 int ia[1+1000], ja[1+1000];

 double ar[1+1000], z, x1, x2;

 /* create problem */

 lp = glp_create_prob();

 glp_set_prob_name(lp, "short");

 glp_set_obj_dir(lp, GLP_MAX);

 /* fill problem */

 glp_add_rows(lp, 2);

 glp_set_row_name(lp, 1, "p");

 glp_set_row_bnds(lp, 1, GLP_UP, 0.0, 1.0);

 glp_set_row_name(lp, 2, "q");

 glp_set_row_bnds(lp, 2, GLP_UP, 0.0, 2.0);

 glp_add_cols(lp, 2);

 glp_set_col_name(lp, 1, "x1");

 glp_set_col_bnds(lp, 1, GLP_LO, 0.0, 0.0);

 glp_set_obj_coef(lp, 1, 0.6);

 glp_set_col_name(lp, 2, "x2");

 glp_set_col_bnds(lp, 2, GLP_LO, 0.0, 0.0);

 glp_set_obj_coef(lp, 2, 0.5);

 ia[1] = 1, ja[1] = 1, ar[1] = 1.0; /* a[1,1] = 1 */

 ia[2] = 1, ja[2] = 2, ar[2] = 2.0; /* a[1,2] = 2 */

 ia[3] = 2, ja[3] = 1, ar[3] = 3.0; /* a[2,1] = 3 */

 ia[4] = 2, ja[4] = 2, ar[4] = 1.0; /* a[2,2] = 1 */

 glp_load_matrix(lp, 4, ia, ja, ar);

 /* solve problem */

 glp_simplex(lp, NULL);

 /* recover and display results */

 z = glp_get_obj_val(lp);

 x1 = glp_get_col_prim(lp, 1);

 x2 = glp_get_col_prim(lp, 2);

 printf("z = %g; x1 = %g; x2 = %g\n", z, x1, x2);

 /* housekeeping */

 glp_delete_prob(lp);

 glp_free_env();

 return 0;

}

/* build */

sparc-linux-g++ -Wall test.c  -o test -I. -L./.libs  -lglpk

 

Result on the board LEON3:

# ./test
GLPK Simplex Optimizer, v4.60
2 rows, 2 columns, 4 non-zeros
* 0: obj =-0.000000000e+00 inf=0.000e+00 (2)

* 2: obj =4.600000000e-01 inf=0.000e+00 (0)

OPTIMAL LP SOLUTION FOUND

z = 0.46; x1 = 0.6; x2 = 0.2

#


CSDP Library
 
The CSDP compilation chain must be modified a lot for cross-compilation. Each Makefile file must be modified to integrate the lapack library and the paths to the compilers. We use the diff command to highlight new instructions. A complete CSDP archive with all the changes for a cross-compilation is available here: homepages.laas.fr/fcamps/CSDP/CSDP.tar. Each Make.diff file makes it possible to apply a patch to the Makefile of the original archive.
 
The CSDP project is available at this address: https://projects.coin-or.org/Csdp/ but only available for x86 architecture.
 

Live demo, source code, binaries of SDP-base control algorithm for the orbital rendezvous hovering phases

 
 

(PhD. Paulo Ricardo Arantes Gilz <prarante@laas.fr>)
 

--> Get all binaries (Sparc Binaries) and codes souces for LP and CSDP : test_files.zip

--> Get the live demo here (need java installed) : demo.zip

--> Get the demo video: video

Launch the demo with Java:

$ java -jar demo.jar
SIMU: /tmp/data/config.xml
SIMU: xmin : 50.0
SIMU: ymax : 25.0
SIMU: network : UDP
SIMU: scale : 20
SIMU: verbose : true
SIMU: i : 0.523598776
SIMU: xmax : 150.0
SIMU: zmin : -25.0
SIMU: e : 0.004
SIMU: Omega : 0.0
SIMU: a :  7011e3
SIMU: simu : file
SIMU: ymin : -25.0
SIMU: omega : 0.0
SIMU: fileDataPath : ./data/dataDistanceCibleSuiveur3.txt
SIMU: zmax : 25.0
SIMU: Working Directory = /tmp
UDP client: Server on port 7778 created. Waiting for incoming data...
UDP server: Accept data on port 7777
UDP client: Client created. Sending data...
UDP server: Receive hello :-)

Keys : 
SHIFT + z : zoom in spacecraft
SHIFT + a : zoom out spacecraft
"c" : change screen focus and use mouse scrolling to zoom in/out

 

IEEE - International Conference on Integrated Navigation Systems Jun 2018, Saint Petersburg, Russia
Embedding a SDP-based control algorithm for the orbital rendezvous hovering phases
Frédéric Camps, Paulo Ricardo Arantes Gilz, Mioara Joldes, Christophe Louembet