From a59c6e5146adcecbf77442f02ed49a62cc98476e Mon Sep 17 00:00:00 2001 From: roice Date: Sun, 4 Jan 2015 10:07:06 +0800 Subject: [PATCH] tested --- utils/solplot/CMakeLists.txt | 11 +++++++++++ utils/solplot/octplotRTKtraj3d.m | 6 ------ utils/solplot/plot/octplotRTKtraj3d.m | 8 -------- utils/solplot/plot/plot_octave.cxx | 16 ++++++++++++---- utils/solplot/sol/ufrtk.c | 8 +++++++- 5 files changed, 30 insertions(+), 19 deletions(-) delete mode 100644 utils/solplot/octplotRTKtraj3d.m delete mode 100644 utils/solplot/plot/octplotRTKtraj3d.m diff --git a/utils/solplot/CMakeLists.txt b/utils/solplot/CMakeLists.txt index 45441ab2..e6cb060e 100644 --- a/utils/solplot/CMakeLists.txt +++ b/utils/solplot/CMakeLists.txt @@ -9,6 +9,10 @@ cmake_minimum_required(VERSION 2.6) #==================================================== # ================ User can Access ================== #==================================================== +# install path +#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) +#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) +#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Project name set(PRJ_NAME solplot) # Add DEBUG defination to print out debug info @@ -106,3 +110,10 @@ target_link_libraries(${PRJ_NAME} rtk) # link external octave library target_link_libraries(${PRJ_NAME} octinterp) target_link_libraries(${PRJ_NAME} octave) + +# install +install(TARGETS ${PRJ_NAME} + RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/bin + LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/lib + ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/lib + ) diff --git a/utils/solplot/octplotRTKtraj3d.m b/utils/solplot/octplotRTKtraj3d.m deleted file mode 100644 index ef7cba27..00000000 --- a/utils/solplot/octplotRTKtraj3d.m +++ /dev/null @@ -1,6 +0,0 @@ -function result = octplotRTKtraj3d(pos) - - plot3(pos(0, :), pos(1, :), pos(2, :)); - result = 55; - -endfunction diff --git a/utils/solplot/plot/octplotRTKtraj3d.m b/utils/solplot/plot/octplotRTKtraj3d.m deleted file mode 100644 index a4d51269..00000000 --- a/utils/solplot/plot/octplotRTKtraj3d.m +++ /dev/null @@ -1,8 +0,0 @@ -function [resultState] = octplotRTKtraj3d(pos) - - plot3(pos(0, :), pos(1, :), pos(2, :)); - resultState = 0; - - disp("ssss"); - -endfunction diff --git a/utils/solplot/plot/plot_octave.cxx b/utils/solplot/plot/plot_octave.cxx index 1298fbfe..6057a5ff 100644 --- a/utils/solplot/plot/plot_octave.cxx +++ b/utils/solplot/plot/plot_octave.cxx @@ -14,9 +14,14 @@ void plotRTKtraj3d(solbuf_t *sol) 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)); + /* Create a matrix with 4 rows(xyz stat or enu stat) and sol->n colums + * position(1, :) ------ ECEF x or ENU east + * position(2, :) ------ ECEF y or ENU north + * position(3, :) ------ ECEF z or ENU up + * position(4, :) ------ GPS quality indicator + * sol->n ------ the number of solution + */ + Matrix position(4, sol->n, double(0)); /* fetch position data and put them into matrix */ for(i=0; i<3; i++) @@ -26,12 +31,15 @@ void plotRTKtraj3d(solbuf_t *sol) position(i, j) = double(sol->data[j].rr[i]); } } + /* fetch solution quality status and put them int matrix*/ + for(j=0; jn; j++) + position(3, j) = sol->data[j].stat; funcArg(0) = position; const octave_value_list result = feval("octplotRTKtraj3d", funcArg, 1); #ifdef DEBUG - fprintf(stderr, "position(0,0) = %f", position(0, 0)); +// fprintf(stderr, "position(0,0) = %f", position(0, 0)); #endif // clean_up_and_exit(0); } diff --git a/utils/solplot/sol/ufrtk.c b/utils/solplot/sol/ufrtk.c index 447e799f..80b14555 100644 --- a/utils/solplot/sol/ufrtk.c +++ b/utils/solplot/sol/ufrtk.c @@ -18,11 +18,17 @@ int ReadSolutionFiles(char *files[], int nfile, solbuf_t *sol) } /* set the origin position to 39.10639N 117.17046E 20m*/ - origin_pos[0] = 39.10639; origin_pos[1] = 117.17046; origin_pos[3] = 20; + origin_pos[0] = 39.10639*D2R; // degree to rad + origin_pos[1] = 117.17046*D2R; // degree to rad + origin_pos[3] = 20; // meters /* compute the ENU coordinate of this point, convert llh to ecef*/ + /* origin_r contains the ecef result of origin point */ pos2ecef(origin_pos, origin_r); + for (j=0; j<3; j++) r[j] = origin_r[j]; + /* compute the ENU result of this origin point */ + /* origin_r contains the ENU result of this origin point */ ecef2enu(origin_pos, r, origin_r);