From d70622abe0e6849dc6a5bb110e0ae8bf2949b0a2 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Thu, 7 Jun 2012 20:09:54 +0000 Subject: [PATCH] Rearranged matlab folders to avoid calling utility functions "examples" --- CMakeLists.txt | 3 ++ examples/CMakeLists.txt | 21 ---------- matlab/CMakeLists.txt | 37 ++++++++++++++++++ .../matlab => matlab}/covarianceEllipse.m | 0 .../matlab => matlab}/covarianceEllipse3D.m | 0 .../examples}/LocalizationExample.m | 0 .../examples}/PlanarSLAMExample.m | 0 .../examples}/PlanarSLAMExample_sampling.m | 0 .../examples}/Pose2SLAMExample.m | 0 .../examples}/Pose2SLAMExample_advanced.m | 0 .../examples}/Pose2SLAMExample_circle.m | 0 .../examples}/Pose2SLAMExample_graph.m | 0 .../examples}/Pose2SLAMwSPCG.m | 0 .../examples}/Pose3SLAMExample_circle.m | 0 .../examples}/Pose3SLAMExample_graph.m | 0 .../matlab => matlab/examples}/VO_Example.m | 0 .../examples}/VisualISAMExample.m | 0 .../examples}/VisualISAMExample_triangle.m | 0 .../examples}/VisualSLAMExample.m | 0 .../examples}/VisualSLAMExample_triangle.m | 0 {examples/matlab => matlab}/iSAMgui.fig | Bin {examples/matlab => matlab}/iSAMgui.m | 0 {examples/matlab => matlab}/load2D.m | 0 {examples/matlab => matlab}/load3D.m | 0 .../matlab => matlab}/plot3DTrajectory.m | 0 {examples/matlab => matlab}/plotCamera.m | 0 {examples/matlab => matlab}/plotPoint2.m | 0 {examples/matlab => matlab}/plotPose2.m | 0 {examples/matlab => matlab}/plotPose3.m | 0 {examples/matlab => matlab}/symbol.m | 0 {tests/matlab => matlab/tests}/CHECK.m | 0 {tests/matlab => matlab/tests}/EQUALITY.m | 0 .../tests}/testJacobianFactor.m | 0 .../tests}/testKalmanFilter.m | 0 {tests/matlab => matlab/tests}/test_gtsam.m | 0 tests/CMakeLists.txt | 12 ------ 36 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 matlab/CMakeLists.txt rename {examples/matlab => matlab}/covarianceEllipse.m (100%) rename {examples/matlab => matlab}/covarianceEllipse3D.m (100%) rename {examples/matlab => matlab/examples}/LocalizationExample.m (100%) rename {examples/matlab => matlab/examples}/PlanarSLAMExample.m (100%) rename {examples/matlab => matlab/examples}/PlanarSLAMExample_sampling.m (100%) rename {examples/matlab => matlab/examples}/Pose2SLAMExample.m (100%) rename {examples/matlab => matlab/examples}/Pose2SLAMExample_advanced.m (100%) rename {examples/matlab => matlab/examples}/Pose2SLAMExample_circle.m (100%) rename {examples/matlab => matlab/examples}/Pose2SLAMExample_graph.m (100%) rename {examples/matlab => matlab/examples}/Pose2SLAMwSPCG.m (100%) rename {examples/matlab => matlab/examples}/Pose3SLAMExample_circle.m (100%) rename {examples/matlab => matlab/examples}/Pose3SLAMExample_graph.m (100%) rename {examples/matlab => matlab/examples}/VO_Example.m (100%) rename {examples/matlab => matlab/examples}/VisualISAMExample.m (100%) rename {examples/matlab => matlab/examples}/VisualISAMExample_triangle.m (100%) rename {examples/matlab => matlab/examples}/VisualSLAMExample.m (100%) rename {examples/matlab => matlab/examples}/VisualSLAMExample_triangle.m (100%) rename {examples/matlab => matlab}/iSAMgui.fig (100%) rename {examples/matlab => matlab}/iSAMgui.m (100%) rename {examples/matlab => matlab}/load2D.m (100%) rename {examples/matlab => matlab}/load3D.m (100%) rename {examples/matlab => matlab}/plot3DTrajectory.m (100%) rename {examples/matlab => matlab}/plotCamera.m (100%) rename {examples/matlab => matlab}/plotPoint2.m (100%) rename {examples/matlab => matlab}/plotPose2.m (100%) rename {examples/matlab => matlab}/plotPose3.m (100%) rename {examples/matlab => matlab}/symbol.m (100%) rename {tests/matlab => matlab/tests}/CHECK.m (100%) rename {tests/matlab => matlab/tests}/EQUALITY.m (100%) rename {tests/matlab => matlab/tests}/testJacobianFactor.m (100%) rename {tests/matlab => matlab/tests}/testKalmanFilter.m (100%) rename {tests/matlab => matlab/tests}/test_gtsam.m (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25ca8d9e2..72270c712 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,9 @@ if (GTSAM_BUILD_EXAMPLES) add_subdirectory(examples) endif(GTSAM_BUILD_EXAMPLES) +# Matlab toolbox +add_subdirectory(matlab) + # Build gtsam_unstable if (GTSAM_BUILD_UNSTABLE) add_subdirectory(gtsam_unstable) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9dada79bc..9f799d294 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -30,24 +30,3 @@ foreach(example_src ${example_srcs} ) endforeach(example_src) -# Install matlab components -if (GTSAM_BUILD_WRAP) - if (GTSAM_INSTALL_MATLAB_TOOLBOX) - # Examples - if (GTSAM_INSTALL_MATLAB_EXAMPLES) - message(STATUS "Installing Matlab Toolbox Examples") - # Matlab files: *.m and *.fig - file(GLOB matlab_examples_m "${GTSAM_SOURCE_ROOT_DIR}/examples/matlab/*.m") - file(GLOB matlab_examples_fig "${GTSAM_SOURCE_ROOT_DIR}/examples/matlab/*.fig") - set(matlab_examples ${matlab_examples_m} ${matlab_examples_fig}) - install(FILES ${matlab_examples} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam/examples) - - message(STATUS "Installing Matlab Toolbox Examples (Data)") - # Data files: *.graph and *.txt - file(GLOB matlab_examples_data_graph "${GTSAM_SOURCE_ROOT_DIR}/examples/Data/*.graph") - file(GLOB matlab_examples_data_txt "${GTSAM_SOURCE_ROOT_DIR}/examples/Data/*.txt") - set(matlab_examples_data ${matlab_examples_data_graph} ${matlab_examples_data_txt}) - install(FILES ${matlab_examples_data} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam/Data) - endif (GTSAM_INSTALL_MATLAB_EXAMPLES) - endif (GTSAM_INSTALL_MATLAB_TOOLBOX) -endif () \ No newline at end of file diff --git a/matlab/CMakeLists.txt b/matlab/CMakeLists.txt new file mode 100644 index 000000000..9d48a949f --- /dev/null +++ b/matlab/CMakeLists.txt @@ -0,0 +1,37 @@ +# Install matlab components +if (GTSAM_BUILD_WRAP) + if (GTSAM_INSTALL_MATLAB_TOOLBOX) + # Utility functions + message(STATUS "Installing Matlab Utility Functions") + # Matlab files: *.m and *.fig + file(GLOB matlab_utils_m "${GTSAM_SOURCE_ROOT_DIR}/matlab/*.m") + file(GLOB matlab_utils_fig "${GTSAM_SOURCE_ROOT_DIR}/matlab/*.fig") + set(matlab_utils ${matlab_utils_m} ${matlab_utils_fig}) + install(FILES ${matlab_utils} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam) + + # Tests + if (GTSAM_INSTALL_MATLAB_TESTS) + message(STATUS "Installing Matlab Toolbox Tests") + file(GLOB matlab_tests "${GTSAM_SOURCE_ROOT_DIR}/matlab/tests/*.m") + install(FILES ${matlab_tests} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam/tests) + endif () + + # Examples + if (GTSAM_INSTALL_MATLAB_EXAMPLES) + message(STATUS "Installing Matlab Toolbox Examples") + # Matlab files: *.m and *.fig + file(GLOB matlab_examples_m "${GTSAM_SOURCE_ROOT_DIR}/matlab/examples/*.m") + file(GLOB matlab_examples_fig "${GTSAM_SOURCE_ROOT_DIR}/matlab/examples/*.fig") + set(matlab_examples ${matlab_examples_m} ${matlab_examples_fig}) + install(FILES ${matlab_examples} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam/examples) + + message(STATUS "Installing Matlab Toolbox Examples (Data)") + # Data files: *.graph and *.txt + file(GLOB matlab_examples_data_graph "${GTSAM_SOURCE_ROOT_DIR}/examples/Data/*.graph") + file(GLOB matlab_examples_data_txt "${GTSAM_SOURCE_ROOT_DIR}/examples/Data/*.txt") + set(matlab_examples_data ${matlab_examples_data_graph} ${matlab_examples_data_txt}) + install(FILES ${matlab_examples_data} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam/Data) + endif () + endif () +endif () + diff --git a/examples/matlab/covarianceEllipse.m b/matlab/covarianceEllipse.m similarity index 100% rename from examples/matlab/covarianceEllipse.m rename to matlab/covarianceEllipse.m diff --git a/examples/matlab/covarianceEllipse3D.m b/matlab/covarianceEllipse3D.m similarity index 100% rename from examples/matlab/covarianceEllipse3D.m rename to matlab/covarianceEllipse3D.m diff --git a/examples/matlab/LocalizationExample.m b/matlab/examples/LocalizationExample.m similarity index 100% rename from examples/matlab/LocalizationExample.m rename to matlab/examples/LocalizationExample.m diff --git a/examples/matlab/PlanarSLAMExample.m b/matlab/examples/PlanarSLAMExample.m similarity index 100% rename from examples/matlab/PlanarSLAMExample.m rename to matlab/examples/PlanarSLAMExample.m diff --git a/examples/matlab/PlanarSLAMExample_sampling.m b/matlab/examples/PlanarSLAMExample_sampling.m similarity index 100% rename from examples/matlab/PlanarSLAMExample_sampling.m rename to matlab/examples/PlanarSLAMExample_sampling.m diff --git a/examples/matlab/Pose2SLAMExample.m b/matlab/examples/Pose2SLAMExample.m similarity index 100% rename from examples/matlab/Pose2SLAMExample.m rename to matlab/examples/Pose2SLAMExample.m diff --git a/examples/matlab/Pose2SLAMExample_advanced.m b/matlab/examples/Pose2SLAMExample_advanced.m similarity index 100% rename from examples/matlab/Pose2SLAMExample_advanced.m rename to matlab/examples/Pose2SLAMExample_advanced.m diff --git a/examples/matlab/Pose2SLAMExample_circle.m b/matlab/examples/Pose2SLAMExample_circle.m similarity index 100% rename from examples/matlab/Pose2SLAMExample_circle.m rename to matlab/examples/Pose2SLAMExample_circle.m diff --git a/examples/matlab/Pose2SLAMExample_graph.m b/matlab/examples/Pose2SLAMExample_graph.m similarity index 100% rename from examples/matlab/Pose2SLAMExample_graph.m rename to matlab/examples/Pose2SLAMExample_graph.m diff --git a/examples/matlab/Pose2SLAMwSPCG.m b/matlab/examples/Pose2SLAMwSPCG.m similarity index 100% rename from examples/matlab/Pose2SLAMwSPCG.m rename to matlab/examples/Pose2SLAMwSPCG.m diff --git a/examples/matlab/Pose3SLAMExample_circle.m b/matlab/examples/Pose3SLAMExample_circle.m similarity index 100% rename from examples/matlab/Pose3SLAMExample_circle.m rename to matlab/examples/Pose3SLAMExample_circle.m diff --git a/examples/matlab/Pose3SLAMExample_graph.m b/matlab/examples/Pose3SLAMExample_graph.m similarity index 100% rename from examples/matlab/Pose3SLAMExample_graph.m rename to matlab/examples/Pose3SLAMExample_graph.m diff --git a/examples/matlab/VO_Example.m b/matlab/examples/VO_Example.m similarity index 100% rename from examples/matlab/VO_Example.m rename to matlab/examples/VO_Example.m diff --git a/examples/matlab/VisualISAMExample.m b/matlab/examples/VisualISAMExample.m similarity index 100% rename from examples/matlab/VisualISAMExample.m rename to matlab/examples/VisualISAMExample.m diff --git a/examples/matlab/VisualISAMExample_triangle.m b/matlab/examples/VisualISAMExample_triangle.m similarity index 100% rename from examples/matlab/VisualISAMExample_triangle.m rename to matlab/examples/VisualISAMExample_triangle.m diff --git a/examples/matlab/VisualSLAMExample.m b/matlab/examples/VisualSLAMExample.m similarity index 100% rename from examples/matlab/VisualSLAMExample.m rename to matlab/examples/VisualSLAMExample.m diff --git a/examples/matlab/VisualSLAMExample_triangle.m b/matlab/examples/VisualSLAMExample_triangle.m similarity index 100% rename from examples/matlab/VisualSLAMExample_triangle.m rename to matlab/examples/VisualSLAMExample_triangle.m diff --git a/examples/matlab/iSAMgui.fig b/matlab/iSAMgui.fig similarity index 100% rename from examples/matlab/iSAMgui.fig rename to matlab/iSAMgui.fig diff --git a/examples/matlab/iSAMgui.m b/matlab/iSAMgui.m similarity index 100% rename from examples/matlab/iSAMgui.m rename to matlab/iSAMgui.m diff --git a/examples/matlab/load2D.m b/matlab/load2D.m similarity index 100% rename from examples/matlab/load2D.m rename to matlab/load2D.m diff --git a/examples/matlab/load3D.m b/matlab/load3D.m similarity index 100% rename from examples/matlab/load3D.m rename to matlab/load3D.m diff --git a/examples/matlab/plot3DTrajectory.m b/matlab/plot3DTrajectory.m similarity index 100% rename from examples/matlab/plot3DTrajectory.m rename to matlab/plot3DTrajectory.m diff --git a/examples/matlab/plotCamera.m b/matlab/plotCamera.m similarity index 100% rename from examples/matlab/plotCamera.m rename to matlab/plotCamera.m diff --git a/examples/matlab/plotPoint2.m b/matlab/plotPoint2.m similarity index 100% rename from examples/matlab/plotPoint2.m rename to matlab/plotPoint2.m diff --git a/examples/matlab/plotPose2.m b/matlab/plotPose2.m similarity index 100% rename from examples/matlab/plotPose2.m rename to matlab/plotPose2.m diff --git a/examples/matlab/plotPose3.m b/matlab/plotPose3.m similarity index 100% rename from examples/matlab/plotPose3.m rename to matlab/plotPose3.m diff --git a/examples/matlab/symbol.m b/matlab/symbol.m similarity index 100% rename from examples/matlab/symbol.m rename to matlab/symbol.m diff --git a/tests/matlab/CHECK.m b/matlab/tests/CHECK.m similarity index 100% rename from tests/matlab/CHECK.m rename to matlab/tests/CHECK.m diff --git a/tests/matlab/EQUALITY.m b/matlab/tests/EQUALITY.m similarity index 100% rename from tests/matlab/EQUALITY.m rename to matlab/tests/EQUALITY.m diff --git a/tests/matlab/testJacobianFactor.m b/matlab/tests/testJacobianFactor.m similarity index 100% rename from tests/matlab/testJacobianFactor.m rename to matlab/tests/testJacobianFactor.m diff --git a/tests/matlab/testKalmanFilter.m b/matlab/tests/testKalmanFilter.m similarity index 100% rename from tests/matlab/testKalmanFilter.m rename to matlab/tests/testKalmanFilter.m diff --git a/tests/matlab/test_gtsam.m b/matlab/tests/test_gtsam.m similarity index 100% rename from tests/matlab/test_gtsam.m rename to matlab/tests/test_gtsam.m diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ef9660c90..4d29dd557 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,15 +40,3 @@ if (GTSAM_BUILD_TIMING) "${tests_local_libs}" "gtsam-static;CppUnitLite" "${tests_exclude}" # Pass in linking and exclusion lists ${is_test}) endif (GTSAM_BUILD_TIMING) - -# Install matlab components -if (GTSAM_BUILD_WRAP) - if (GTSAM_INSTALL_MATLAB_TOOLBOX) - # Tests - if (GTSAM_INSTALL_MATLAB_TESTS) - message(STATUS "Installing Matlab Toolbox Tests") - file(GLOB matlab_tests "${GTSAM_SOURCE_ROOT_DIR}/tests/matlab/*.m") - install(FILES ${matlab_tests} DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam/tests) - endif () - endif () -endif () \ No newline at end of file