From fd013b34354257617f008c8830ab938e9c2082b5 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Tue, 4 Aug 2015 10:59:39 -0400 Subject: [PATCH 1/6] use lcmtypes directly from the include/ folder --- drake/lcmtypes/CMakeLists.txt | 31 ------------------- drake/systems/controllers/CMakeLists.txt | 4 --- drake/systems/controllers/QPCommon.cpp | 2 +- drake/systems/controllers/QPCommon.h | 2 +- .../zmpCoMObserverStateVisualizer.cpp | 2 +- drake/systems/robotInterfaces/CMakeLists.txt | 1 - .../robotInterfaces/QPLocomotionPlan.h | 2 +- drake/util/CMakeLists.txt | 3 -- drake/util/lcmUtil.h | 8 ++--- drake/util/test/CMakeLists.txt | 1 - 10 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 drake/lcmtypes/CMakeLists.txt diff --git a/drake/lcmtypes/CMakeLists.txt b/drake/lcmtypes/CMakeLists.txt deleted file mode 100644 index 367013ba6717..000000000000 --- a/drake/lcmtypes/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ - -lcmtypes_build(LCM_TYPES - lcmt_drake_signal.lcm - lcmt_pendulum_u.lcm - lcmt_pendulum_x.lcm - lcmt_pendulum_y.lcm - lcmt_robot_state.lcm - lcmt_scope_data.lcm - lcmt_viewer_command.lcm - lcmt_simulation_command.lcm - lcmt_zmp_data.lcm - lcmt_qp_controller_input.lcm - lcmt_support_data.lcm - lcmt_foot_flag.lcm - lcmt_joint_pd_override.lcm - lcmt_body_motion_data.lcm - lcmt_body_wrench_data.lcm - lcmt_force_torque.lcm - lcmt_polynomial.lcm - lcmt_polynomial_matrix.lcm - lcmt_piecewise_polynomial.lcm - lcmt_zmp_com_observer_state.lcm - ) - -#add_lcmtype(lcmt_drake_signal.lcm) -#add_lcmtype(lcmt_pendulum_u.lcm) -#add_lcmtype(lcmt_pendulum_x.lcm) -#add_lcmtype(lcmt_pendulum_y.lcm) -#add_lcmtype(lcmt_robot_state.lcm) -#add_lcmtype(lcmt_scope_data.lcm) -#add_lcmtype(lcmt_viewer_command.lcm) diff --git a/drake/systems/controllers/CMakeLists.txt b/drake/systems/controllers/CMakeLists.txt index d3c75a055659..d80a34f2b1ad 100644 --- a/drake/systems/controllers/CMakeLists.txt +++ b/drake/systems/controllers/CMakeLists.txt @@ -1,10 +1,6 @@ include_directories(${PROJECT_SOURCE_DIR}/systems/robotInterfaces) include_directories(${PROJECT_SOURCE_DIR}/util/test) -if (LCM_FOUND) - include_directories (${CMAKE_BINARY_DIR}/lcmgen/lcmtypes ) -endif() - add_library(drakeControlUtil SHARED controlUtil.cpp) pods_find_pkg_config(terrain-map) if (terrain-map_FOUND) diff --git a/drake/systems/controllers/QPCommon.cpp b/drake/systems/controllers/QPCommon.cpp index bf88277ee574..d1cf293237bc 100644 --- a/drake/systems/controllers/QPCommon.cpp +++ b/drake/systems/controllers/QPCommon.cpp @@ -6,7 +6,7 @@ #include #include "lcmUtil.h" #include "testUtil.h" -#include "drake/lcmt_zmp_com_observer_state.hpp" +#include "lcmtypes/drake/lcmt_zmp_com_observer_state.hpp" const bool CHECK_CENTROIDAL_MOMENTUM_RATE_MATCHES_TOTAL_WRENCH = false; const bool PUBLISH_ZMP_COM_OBSERVER_STATE = true; diff --git a/drake/systems/controllers/QPCommon.h b/drake/systems/controllers/QPCommon.h index 89fb906a2dd2..cc100b62c5a0 100644 --- a/drake/systems/controllers/QPCommon.h +++ b/drake/systems/controllers/QPCommon.h @@ -4,7 +4,7 @@ #include "controlUtil.h" #include "drakeUtil.h" #include "fastQP.h" -#include "drake/lcmt_qp_controller_input.hpp" +#include "lcmtypes/drake/lcmt_qp_controller_input.hpp" #include "ExponentialPlusPiecewisePolynomial.h" #include #include "ForceTorqueMeasurement.h" diff --git a/drake/systems/controllers/zmpCoMObserverStateVisualizer.cpp b/drake/systems/controllers/zmpCoMObserverStateVisualizer.cpp index 4c783f8b9390..ccbf5002d622 100644 --- a/drake/systems/controllers/zmpCoMObserverStateVisualizer.cpp +++ b/drake/systems/controllers/zmpCoMObserverStateVisualizer.cpp @@ -1,6 +1,6 @@ #include #include -#include "drake_lcmt_zmp_com_observer_state.h" +#include "lcmtypes/drake_lcmt_zmp_com_observer_state.h" bot_lcmgl_t* lcmgl; diff --git a/drake/systems/robotInterfaces/CMakeLists.txt b/drake/systems/robotInterfaces/CMakeLists.txt index 97db6fd09067..10425139e556 100644 --- a/drake/systems/robotInterfaces/CMakeLists.txt +++ b/drake/systems/robotInterfaces/CMakeLists.txt @@ -4,7 +4,6 @@ include_directories (${PROJECT_SOURCE_DIR}/systems/controllers ) include_directories (${PROJECT_SOURCE_DIR}/systems/plants ) include_directories (${PROJECT_SOURCE_DIR}/systems/plants/joints ) include_directories (${PROJECT_SOURCE_DIR}/solvers/qpSpline ) -include_directories (${PROJECT_BINARY_DIR}/lcmgen/lcmtypes ) include_directories (${PROJECT_SOURCE_DIR}/examples/Atlas) add_library(drakeSide SHARED Side.cpp) diff --git a/drake/systems/robotInterfaces/QPLocomotionPlan.h b/drake/systems/robotInterfaces/QPLocomotionPlan.h index a43d69bf73f2..3b80bbdf77aa 100644 --- a/drake/systems/robotInterfaces/QPLocomotionPlan.h +++ b/drake/systems/robotInterfaces/QPLocomotionPlan.h @@ -9,7 +9,7 @@ #include "PiecewisePolynomial.h" #include "ExponentialPlusPiecewisePolynomial.h" #include "RigidBodyManipulator.h" -#include "drake/lcmt_qp_controller_input.hpp" +#include "lcmtypes/drake/lcmt_qp_controller_input.hpp" #include "BodyMotionData.h" #include "Side.h" #include diff --git a/drake/util/CMakeLists.txt b/drake/util/CMakeLists.txt index 00fd8548e9c5..6e5bfc976bdd 100644 --- a/drake/util/CMakeLists.txt +++ b/drake/util/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (${PROJECT_BINARY_DIR}/lcmgen/lcmtypes ) - if (simulink_FOUND) add_mex(realtime realtime.cpp) endif() @@ -51,7 +49,6 @@ if (LCM_FOUND) # note: requires drakeUtil header file, but not linking against it because # we only need methods that are templated and defined in the header include_directories (${PROJECT_SOURCE_DIR}/systems/trajectories ) - include_directories (${PROJECT_BINARY_DIR}/lcmgen/lcmtypes ) add_library(drakeLCMUtil SHARED lcmUtil.cpp) add_dependencies(drakeLCMUtil ${LCMTYPES_C_LIBRARY}) target_link_libraries(drakeLCMUtil drakeTrajectories) diff --git a/drake/util/lcmUtil.h b/drake/util/lcmUtil.h index 273cb09989f0..6d4c559c1e9f 100644 --- a/drake/util/lcmUtil.h +++ b/drake/util/lcmUtil.h @@ -4,10 +4,10 @@ #include #include #include "PiecewisePolynomial.h" -#include "drake/lcmt_polynomial.hpp" -#include "drake/lcmt_polynomial_matrix.hpp" -#include "drake/lcmt_piecewise_polynomial.hpp" -#include "drake/lcmt_qp_controller_input.hpp" +#include "lcmtypes/drake/lcmt_polynomial.hpp" +#include "lcmtypes/drake/lcmt_polynomial_matrix.hpp" +#include "lcmtypes/drake/lcmt_piecewise_polynomial.hpp" +#include "lcmtypes/drake/lcmt_qp_controller_input.hpp" #undef DLLEXPORT #if defined(WIN32) || defined(WIN64) diff --git a/drake/util/test/CMakeLists.txt b/drake/util/test/CMakeLists.txt index d463c51e3f5d..2afb849d2e68 100644 --- a/drake/util/test/CMakeLists.txt +++ b/drake/util/test/CMakeLists.txt @@ -5,7 +5,6 @@ include_directories(..) include_directories(${PROJECT_SOURCE_DIR}/systems/trajectories) -include_directories(${PROJECT_BINARY_DIR}/lcmgen/lcmtypes) if (NOT WIN32) # doesn't work because the timing tests require the include From 32bcbd8955ae8a3d7199e0124443d711c7b7ce18 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Tue, 4 Aug 2015 11:02:29 -0400 Subject: [PATCH 2/6] use my cmake fork for testing --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fa78ffdaf91..872af3633ef1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,8 +103,8 @@ set(bertini_GIT_REPOSITORY https://github.com/RobotLocomotion/bertini.git) set(bertini_GIT_TAG 3ae3e3ad3534acb4b6f7a4c3c22728b493beaa80) set(bullet_GIT_REPOSITORY https://github.com/RobotLocomotion/bullet-pod.git) set(bullet_GIT_TAG 6db7ae5e29f8b35ffcea384c53caa4bddcc6f986) -set(cmake_GIT_REPOSITORY https://github.com/RobotLocomotion/cmake.git) -set(cmake_GIT_TAG c48d1e461d8f0a8d67ebba3e4acb19d96dd5a25b) +set(cmake_GIT_REPOSITORY https://github.com/rdeits/cmake.git) +set(cmake_GIT_TAG f48840614d7d80a290ba0ef63ee1166b32ebcfac) set(cmake_GIT_CLONE_DIR "${PROJECT_SOURCE_DIR}/drake/cmake") set(cmake_NO_BUILD TRUE) set(director_GIT_REPOSITORY https://github.com/RobotLocomotion/director.git) From 74f6145f5fc287f9441b03546a2b5d4f6e8e8449 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Tue, 4 Aug 2015 20:14:17 -0400 Subject: [PATCH 3/6] point to merged robotlocomotion cmake --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 872af3633ef1..aea33ec3db2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,8 +103,8 @@ set(bertini_GIT_REPOSITORY https://github.com/RobotLocomotion/bertini.git) set(bertini_GIT_TAG 3ae3e3ad3534acb4b6f7a4c3c22728b493beaa80) set(bullet_GIT_REPOSITORY https://github.com/RobotLocomotion/bullet-pod.git) set(bullet_GIT_TAG 6db7ae5e29f8b35ffcea384c53caa4bddcc6f986) -set(cmake_GIT_REPOSITORY https://github.com/rdeits/cmake.git) -set(cmake_GIT_TAG f48840614d7d80a290ba0ef63ee1166b32ebcfac) +set(cmake_GIT_REPOSITORY https://github.com/RobotLocomotion/cmake.git) +set(cmake_GIT_TAG dd69c2b87493aed87e797968561695173c6468c2) set(cmake_GIT_CLONE_DIR "${PROJECT_SOURCE_DIR}/drake/cmake") set(cmake_NO_BUILD TRUE) set(director_GIT_REPOSITORY https://github.com/RobotLocomotion/director.git) From a55bc871afd4ff0b857617e0725a02449a085fbf Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Wed, 12 Aug 2015 16:47:30 -0400 Subject: [PATCH 4/6] update lcm --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 539f98bbc1e7..c0a2e1640c1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ set(gurobi_GIT_TAG beb0a84a1bcca1eb81a1b87d9fa140f2134d97e9) set(iris_GIT_REPOSITORY https://github.com/rdeits/iris-distro.git) set(iris_GIT_TAG 13468e0ea38e72ffae030adaa31e3015ea5f3ce0) set(lcm_GIT_REPOSITORY https://github.com/RobotLocomotion/lcm-pod.git) -set(lcm_GIT_TAG f072e9a54ae168503de8f9b96a70205d56ff5788) # cmake branch +set(lcm_GIT_TAG 31e9a3e2dd056cac749fc2879e841434181180ad) # cmake branch set(libbot_GIT_REPOSITORY https://github.com/RobotLocomotion/libbot.git) set(libbot_GIT_TAG c8c251cf2fe0954e5c4954a3e7c1e7a43a882492) set(mosek_GIT_REPOSITORY https://github.com/RobotLocomotion/mosek.git) From be0f2726033b87ef841d36db3bd5abfd9909b1e2 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Wed, 12 Aug 2015 17:06:22 -0400 Subject: [PATCH 5/6] another matlab-specific build --- drake/solvers/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drake/solvers/CMakeLists.txt b/drake/solvers/CMakeLists.txt index 900588994122..66a8cd81dd49 100644 --- a/drake/solvers/CMakeLists.txt +++ b/drake/solvers/CMakeLists.txt @@ -27,8 +27,10 @@ endif() pods_find_pkg_config(snopt_c) -add_mex(lqrmex lqrmex.cpp) -target_link_libraries(lqrmex drakeUtil) +if(MATLAB_FOUND) + add_mex(lqrmex lqrmex.cpp) + target_link_libraries(lqrmex drakeUtil) +endif() if(snopt_c_FOUND AND MATLAB_FOUND) add_mex(NonlinearProgramSnoptmex NonlinearProgramSnoptmex.cpp) From 1e21cc9eccf097180bc9f1b423e3b572e9cde184 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Wed, 12 Aug 2015 18:05:49 -0400 Subject: [PATCH 6/6] tabs to spaces --- drake/solvers/CMakeLists.txt | 74 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/drake/solvers/CMakeLists.txt b/drake/solvers/CMakeLists.txt index 66a8cd81dd49..4dc06f0cac0f 100644 --- a/drake/solvers/CMakeLists.txt +++ b/drake/solvers/CMakeLists.txt @@ -5,55 +5,55 @@ pods_find_pkg_config(gurobi) if (gurobi_FOUND) - add_library(drakeQP QP.cpp) - set_target_properties(drakeQP PROPERTIES COMPILE_FLAGS -fPIC) - pods_use_pkg_config_packages(drakeQP gurobi) - - if (MATLAB_FOUND) - add_mex(fastQPmex fastQPmex.cpp) - target_link_libraries(fastQPmex drakeQP) - add_mex(gurobiQPmex gurobiQPmex.cpp) - target_link_libraries(gurobiQPmex drakeQP) - endif() - - pods_install_libraries(drakeQP) - pods_install_headers(fastQP.h gurobiQP.h DESTINATION drake) - pods_install_pkg_config_file(drake-qp - LIBS -ldrakeQP - REQUIRES gurobi - VERSION 0.0.1) + add_library(drakeQP QP.cpp) + set_target_properties(drakeQP PROPERTIES COMPILE_FLAGS -fPIC) + pods_use_pkg_config_packages(drakeQP gurobi) + + if (MATLAB_FOUND) + add_mex(fastQPmex fastQPmex.cpp) + target_link_libraries(fastQPmex drakeQP) + add_mex(gurobiQPmex gurobiQPmex.cpp) + target_link_libraries(gurobiQPmex drakeQP) + endif() + + pods_install_libraries(drakeQP) + pods_install_headers(fastQP.h gurobiQP.h DESTINATION drake) + pods_install_pkg_config_file(drake-qp + LIBS -ldrakeQP + REQUIRES gurobi + VERSION 0.0.1) endif() pods_find_pkg_config(snopt_c) if(MATLAB_FOUND) - add_mex(lqrmex lqrmex.cpp) - target_link_libraries(lqrmex drakeUtil) + add_mex(lqrmex lqrmex.cpp) + target_link_libraries(lqrmex drakeUtil) endif() if(snopt_c_FOUND AND MATLAB_FOUND) - add_mex(NonlinearProgramSnoptmex NonlinearProgramSnoptmex.cpp) + add_mex(NonlinearProgramSnoptmex NonlinearProgramSnoptmex.cpp) pods_use_pkg_config_packages(NonlinearProgramSnoptmex snopt_c) set_target_properties(NonlinearProgramSnoptmex PROPERTIES COMPILE_FLAGS -fPIC) - # link against matlab's copy of the gfortran library, if possible - find_library(GFORTRAN_LIBRARY NAMES gfortran libgfortran - PATHS "${MATLAB_ROOT}/sys/os/" - PATH_SUFFIXES glnxa64/ maci64/ NO_DEFAULT_PATH ) - if (NOT GFORTRAN_LIBRARY) - # the above does not seem work on linux out of the box, because matlab - # symlinks to libgfortran.so.3 but not to libgfortran.so, and cmake isn't - # able to find it with the default CMAKE_FIND_LIBRARY_SUFFIXES. Instead - # of setting that variable, here is the annoying work-around: - find_file(GFORTRAN_LIBRARY NAMES libgfortran.so.3 - PATHS "${MATLAB_ROOT}/sys/os/" - PATH_SUFFIXES glnxa64/ maci64/ NO_DEFAULT_PATH) - endif() - - if (GFORTRAN_LIBRARY) - target_link_libraries(NonlinearProgramSnoptmex ${GFORTRAN_LIBRARY}) - endif() + # link against matlab's copy of the gfortran library, if possible + find_library(GFORTRAN_LIBRARY NAMES gfortran libgfortran + PATHS "${MATLAB_ROOT}/sys/os/" + PATH_SUFFIXES glnxa64/ maci64/ NO_DEFAULT_PATH ) + if (NOT GFORTRAN_LIBRARY) + # the above does not seem work on linux out of the box, because matlab + # symlinks to libgfortran.so.3 but not to libgfortran.so, and cmake isn't + # able to find it with the default CMAKE_FIND_LIBRARY_SUFFIXES. Instead + # of setting that variable, here is the annoying work-around: + find_file(GFORTRAN_LIBRARY NAMES libgfortran.so.3 + PATHS "${MATLAB_ROOT}/sys/os/" + PATH_SUFFIXES glnxa64/ maci64/ NO_DEFAULT_PATH) + endif() + + if (GFORTRAN_LIBRARY) + target_link_libraries(NonlinearProgramSnoptmex ${GFORTRAN_LIBRARY}) + endif() endif() add_subdirectory(qpSpline)