-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
#==================================================== | ||
# CMakeLists configuration file for plot lib of | ||
# solplot project | ||
# this file aims to build a lib calls plot to be | ||
# further linked to the project | ||
# | ||
# Author: Roice(LUO Bing) | ||
# Date: 2014-11-26 Create this file | ||
|
||
# include octave related | ||
include_directories(/usr/include/octave-3.8.2) | ||
include_directories(/usr/include/octave-3.8.2/octave) | ||
include_directories(/usr/include/hdf5/serial) | ||
# include rtklib related, so as to search for rtklib.h | ||
include_directories(${PROJECT_SOURCE_DIR}/../../3rdparty/rtklib_2.4.2_p10/src) | ||
|
||
add_library(plot plot_octave.cxx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,37 @@ | ||
#include <octave/oct.h> // Octave math functions related | ||
void solsss(void) | ||
{} | ||
#include <octave/octave.h> | ||
#include <octave/parse.h> | ||
#include <octave/toplev.h> /* do_octave_atexit */ | ||
#include <rtklib.h> // for solbuf_t structure definition | ||
|
||
void plotRTKtraj3d(solbuf_t *sol) | ||
{ | ||
int i,j; | ||
|
||
const char * argvv [] = {"" /* name of program, not relevant */, "--silent"}; | ||
|
||
octave_main(2, (char **) argvv, true /**/); | ||
|
||
octave_value_list funcArg; | ||
|
||
/* Create a matrix with 3 rows(xyz or enu) and sol->n colums | ||
* sol->n is the number of solution */ | ||
Matrix position(3, sol->n, double(0)); | ||
|
||
/* fetch position data and put them into matrix */ | ||
for(i=0; i<3; i++) | ||
{ | ||
for(j=0; j<sol->n; j++) | ||
{ | ||
position(i, j) = double(sol->data[j].rr[i]); | ||
} | ||
} | ||
|
||
funcArg(0) = position; | ||
|
||
const octave_value_list result = feval("octplotRTKtraj3d", funcArg, 1); | ||
#ifdef DEBUG | ||
fprintf(stderr, "position(0,0) = %f", position(0, 0)); | ||
#endif | ||
// clean_up_and_exit(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters