RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.18k stars 1.24k forks source link

Adding functionality to Drake #4133

Closed aespielberg closed 7 years ago

aespielberg commented 7 years ago

Hi all,

We have been developing some (what I think is) useful code for soft body simulation that I'd like to push back to drake. Right now it works almost completely separately, but we are developing an interface to let it interface easily with rigid body dynamics.

What is the best way to go about integrating this into Drake? Are there any guides for integration and testing, other than the formal code review process?

liangfok commented 7 years ago

Thanks for contributing back to Drake! Yes, being familiar with the code review process is a must. Other than that, one idea is to incrementally do the integration by defining a sequence of spirals. See some examples below:

By defining the spirals, we can provide quick architectural-level feedback. The resulting incremental PRs will also be easier and thus faster to review.

david-german-tri commented 7 years ago

As @liangfok said, please open an issue that describes the design, and explains the spiral of PRs necessary to implement it. You'll probably get some important feedback from @amcastro-tri, among others.

Once that's done and you're ready to start creating PRs, check out http://drake.mit.edu/developers.html#review-process. Regarding testing in particular, reviewers will ask that your new code has fine-grained, quick-to-execute unit tests that protect all the important new behaviors.

aespielberg commented 7 years ago

Thank you guys for the advice. This is really good to know for how to get something tested and integrated long-term in Drake.

Playing around today, though, I think I can hone my question a little better (and perhaps I should make a new thread?). I have an external that I want to add to Drake, which I then want to wrap inside Drake to be used there. However, the main problem is adding the external itself. I've been playing around with the CMakeLists.txt, but I still seem to be getting an error as I do this. Is there a guide for all the steps that should be taken in order to add an external?

-Andy S.

On Mon, Nov 14, 2016 at 1:14 PM, David German notifications@github.com wrote:

As @liangfok https://github.com/liangfok said, please open an issue that describes the design, and explains the spiral of PRs necessary to implement it. You'll probably get some important feedback from @amcastro-tri https://github.com/amcastro-tri, among others.

Once that's done and you're ready to start creating PRs, check out http://drake.mit.edu/developers.html#review-process. Regarding testing in particular, reviewers will ask that your new code has fine-grained, quick-to-execute unit tests that protect all the important new behaviors.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RobotLocomotion/drake/issues/4133#issuecomment-260414795, or mute the thread https://github.com/notifications/unsubscribe-auth/ADbqdEZcLU8_bOVKzxrKR2tCHMFySuw_ks5q-KTxgaJpZM4KxmY9 .

liangfok commented 7 years ago

To my knowledge, there's currently no written documentation on how to add an external. It'll probably be easiest if your external is a git repository because then it can be added as a submodule in drake-distro/externals. Then use drake_add_external to include it in the superbuild.

aespielberg commented 7 years ago

Hmm, this is exactly what I had tried. I have a solution which builds completely fine in isolation, but when I try to include it, I'm getting errors. I should note that I am trying to build on Windows (checkout from before last windows SHA), and I know this is unsupported so I shouldn't expect a ton of help here, but I don't think this is necessarily the source of the error.

Is there an issue with trying to add an external solution which itself has subprojects? Do I essentially need to unfold those subprojects?

-Andy S.

On Tue, Nov 15, 2016 at 1:14 AM, Chien-Liang Fok notifications@github.com wrote:

To my knowledge, there's currently no written documentation on how to add an external. It'll probably be easiest if your external is a git repository because then it can be added as a submodule in drake-distro/externals. Then use drake_add_external https://github.com/RobotLocomotion/drake/blob/master/cmake/externals.cmake#L364 to include it in the superbuild.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RobotLocomotion/drake/issues/4133#issuecomment-260556728, or mute the thread https://github.com/notifications/unsubscribe-auth/ADbqdClIic8t-TdDMaJAA5xhS4U-o59nks5q-U2_gaJpZM4KxmY9 .

david-german-tri commented 7 years ago

Is there an issue with trying to add an external solution which itself has subprojects? Do I essentially need to unfold those subprojects?

You shouldn't need to do that, no. The Drake superbuild initializes submodules recursively.

I'm getting errors. I should note that I am trying to build on Windows (checkout from before last windows SHA), and I know this is unsupported so I shouldn't expect a ton of help here...

I personally am not up for unwinding a CMake failure from an old SHA on Windows, but if you post your error messages you might possibly get input from someone. That said, your changes will have to work at HEAD of master on Ubuntu before we can merge them, so you might want to consider biting the bullet and developing there locally.

liangfok commented 7 years ago

I have a solution which builds completely fine in isolation, but when I try to include it, I'm getting errors.

One strategy for solving this problem is to build in verbose mode and compare the build commands when building your solution in isolation versus as a Drake external.

Using make:

make VERBOSE=true

Using ninja:

ninja -v
aespielberg commented 7 years ago

Yes, I will absolutely make sure this is up to date and compiling with Ubuntu come the time I push it back. For now, for various reasons, it's easiest I work on the Windows build.

For a minimal-ish example of what's wrong, here's my current situation.

I have an external called "robot" that I wish to add (poorly named). The file structure looks like this:

  -robot
   CMakeLists.txt
    -projects
      -external_voxel
       Various code in here
       CMakeLists.txt
    -externals
     Various code in here

So the main CMakeLists.txt in here creates a project and includes references to the externals and the project external_voxel under projects.

The CMakeLists, for robot:

cmake_minimum_required(VERSION 3.0)

project (robot)

# Check Visual Studio version number.
if (MSVC12)
    set(MSVC_LIB_EXTENSION vs2013)
elseif (MSVC14)
    set(MSVC_LIB_EXTENSION vs2015)
endif (MSVC12)

find_library(GTEST_LIB_DEBUG
    "gtestd_${MSVC_LIB_EXTENSION}"
    PATHS ${PROJECT_SOURCE_DIR}/externals/googletest/lib/Debug
    NO_DEFAULT_PATH
)
find_library(GTEST_LIB_RELEASE
    "gtest_${MSVC_LIB_EXTENSION}"
    PATHS ${PROJECT_SOURCE_DIR}/externals/googletest/lib/Release
    NO_DEFAULT_PATH
)
find_library(GTEST_MAIN_LIB_DEBUG
    "gtest_maind_${MSVC_LIB_EXTENSION}"
    PATHS ${PROJECT_SOURCE_DIR}/externals/googletest/lib/Debug
    NO_DEFAULT_PATH
)
find_library(GTEST_MAIN_LIB_RELEASE
    "gtest_main_${MSVC_LIB_EXTENSION}"
    PATHS ${PROJECT_SOURCE_DIR}/externals/googletest/lib/Release
    NO_DEFAULT_PATH
)
find_library(FREEGLUT_LIB_DEBUG
    freeglutd
    PATHS ${PROJECT_SOURCE_DIR}/externals/freeglut/lib/x64
    NO_DEFAULT_PATH
)
find_library(FREEGLUT_LIB_RELEASE
    freeglut
    PATHS ${PROJECT_SOURCE_DIR}/externals/freeglut/lib/x64
    NO_DEFAULT_PATH
)
find_library(ANTTWEAKBAR_LIB
    AntTweakBar64
    PATHS ${PROJECT_SOURCE_DIR}/externals/AntTweakBar/lib
    NO_DEFAULT_PATH
)

include(${PROJECT_SOURCE_DIR}/projects/external_voxel/CMakeLists.txt)

and for the one under external_voxel:

set(VOXEL_SOURCE_DIR ${PROJECT_SOURCE_DIR}/projects/external_voxel)

file(GLOB_RECURSE VOXEL_HEADER ${VOXEL_SOURCE_DIR}/*.h)
file(GLOB_RECURSE VOXEL_SOURCE ${VOXEL_SOURCE_DIR}/*.cpp)

add_library(external_voxel STATIC ${VOXEL_HEADER} ${VOXEL_SOURCE})
target_include_directories(external_voxel PRIVATE ${VOXEL_SOURCE_DIR}/include)
target_include_directories(external_voxel PRIVATE ${VOXEL_SOURCE_DIR}/include/vecmath)
target_compile_definitions(external_voxel PRIVATE _CRT_SECURE_NO_WARNINGS)

set_target_properties(external_voxel
    PROPERTIES
    OUTPUT_NAME voxel
    DEBUG_POSTFIX "d_${MSVC_LIB_EXTENSION}"
    RELEASE_POSTFIX "_${MSVC_LIB_EXTENSION}"
)

When I try to build the superbuild, I get the following error:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB1009 Project file does not exist.    robot   C:\ResearchCode\drake-soft\artifacts\MSBUILD    1   

or for more verbose output:

 Microsoft (R) Build Engine version 14.0.25420.1
11>  Copyright (C) Microsoft Corporation. All rights reserved.
11>
11>MSBUILD : error MSB1009: Project file does not exist.
11>  Switch: install.vcxproj

I know this is the VS compiler I'm using, but since this project compiles fine in isolation and only chokes when I try to merge it with drake, I suspect that is not the problem. Googling has given me sparse help.

Does anyone see something obvious I'm doing wrong?

aespielberg commented 7 years ago

For reference, this is how I edited the main CMakeLists.txt to be:

cmake_minimum_required(VERSION 3.5)
project(drake-superbuild)

include(CTest)

include(cmake/config.cmake)
include(cmake/externals.cmake)
include(cmake/examples.cmake)
include(cmake/git/hooks.cmake)

drake_setup_superbuild()
drake_setup_platform()
drake_setup_git_hooks()

###############################################################################
# BEGIN options

##########################################
# External Projects that are ON by default
##########################################
option(WITH_EIGEN "required c++ matrix library.  only disable if you have it already." ON)
option(WITH_GOOGLETEST "required c++ unit test library.  only disable if you have it already." ON)
option(WITH_GFLAGS "required c++ command-line library.  only disable if you have it already." ON)
option(WITH_GOOGLE_STYLEGUIDE "provides cpplint.py style checking" ON)
option(WITH_SWIGMAKE "helper tools to build python & MATLAB wrappers for C++ libraries with Eigen" ON)
option(WITH_BULLET "used for collision detection" ON)
option(WITH_LCM "interprocess communications protocol for visualizers, etc" ON)
option(WITH_BOT_CORE_LCMTYPES "required LCM types library. only disable if you have it already." ON)
option(WITH_SPDLOG "spdlog text logging facility; disabling will turn off text logging." ON)
option(WITH_ROBOT "FEM Library for soft robotics." ON)
if(WIN32)
  option(WITH_GTK "precompiled gtk binaries/headers for Windows" ON)  # needed for lcm on windows
else()
  option(WITH_DIRECTOR "vtk-based visualization tool and robot user interface" ON) # not win32 yet.  it builds on windows, but requires manually installation of vtk, etc.  perhaps make a precompiled director pod (a bit like snopt)
  option(WITH_LIBBOT "simple open-gl visualizer + lcmgl for director" ON) # there is hope, but i spent a long time cleaning up c/c++ language errors trying to make msvc happy.. and still had a long way to go.
  option(WITH_NLOPT "nonlinear optimization solver" ON)
  option(WITH_DREAL "nonlinear SMT solver" ON)
  option(WITH_MOSEK "convex optimization solver; free for academics" OFF)
  # IPOPT is currently disabled on Mac due to MATLAB compatibility
  # issues: https://github.com/RobotLocomotion/drake/issues/2578
  if (NOT APPLE)
    option(WITH_IPOPT "nonlinear optimization solver" ON)
  endif()
  option(WITH_SWIG_MATLAB "A version of SWIG with MATLAB support" ON)
endif()

option(WITH_SNOPT_PRECOMPILED "precompiled binaries only for snopt; the source requires a license (will be disabled if WITH_SNOPT=ON)" ON)
option(WITH_YAML_CPP "library for reading and writing yaml configuration files" ON)

##############################################################
# External Projects that are only needed when MATLAB is in use
##############################################################
include(CMakeDependentOption)
option(DISABLE_MATLAB "Don't use MATLAB even if it is present." OFF)
if(DISABLE_MATLAB)
  message(STATUS "MATLAB is disabled.")
else()
  find_program(matlab matlab)
  if(matlab)
    message(STATUS "Found MATLAB at " ${matlab})
  else()
    message(STATUS "Looked for MATLAB but could not find it.")
  endif()
endif()

## The following projects are default ON when MATLAB is present and enabled.
## Otherwise, they are hidden and default OFF.
cmake_dependent_option(WITH_SPOTLESS "polynomial optimization front-end for MATLAB" ON "NOT DISABLE_MATLAB;matlab" OFF)

## The following projects are default OFF when MATLAB is present and enabled.
## Otherwise, they are hidden and default OFF.
## Some of them may also be hidden on Windows regardless of the status of MATLAB.
cmake_dependent_option(WITH_BERTINI "solve polynomial equations; free but pod requires permissions (can't redistribute)" OFF "NOT DISABLE_MATLAB;matlab;NOT WIN32" OFF)
cmake_dependent_option(WITH_GLOPTIPOLY "free global polynomial optimization tooblox" OFF "NOT DISABLE_MATLAB;matlab;NOT WIN32" OFF)
cmake_dependent_option(WITH_IRIS "fast approximate convex segmentation" OFF "NOT DISABLE_MATLAB;matlab;NOT WIN32;WITH_MOSEK" OFF)
cmake_dependent_option(WITH_SEDUMI "semi-definite programming solver" OFF "NOT DISABLE_MATLAB;matlab;NOT WIN32" OFF)
cmake_dependent_option(WITH_YALMIP "free optimization front-end for MATLAB" OFF "NOT DISABLE_MATLAB;matlab;NOT WIN32" OFF)

###########################################
# External Projects that are OFF by default
###########################################
option(WITH_SNOPT "nonlinear optimization solver; requires access to RobotLocomotion/snopt-pod")
cmake_dependent_option(WITH_SIGNALSCOPE "live plotting tool for lcm messages" OFF "NOT WIN32;WITH_DIRECTOR" OFF)

if(NOT WIN32) # many of these might work on win32 with little or no work... they just haven't been tried
  option(WITH_AVL "use w/ AVL to compute aerodynamic coefficients for airfoils")
  option(WITH_GUROBI "convex/integer optimization solver; free for academics (will prompt you for login bits)")
  option(WITH_MESHCONVERTERS "uses vcglib to convert a few standard filetypes")
  option(WITH_OCTOMAP "provides oct-tree data structures")
  option(WITH_TEXTBOOK "pull in the Underactuated Robotics textbook and its examples")  # almost works on windows.  the update step call to git was complaining about local modifications on drake003
  option(WITH_XFOIL "use w/ XFOIL to compute aerodynamic coefficients for airfoils")
endif()

# Option to skip building drake proper via the superbuild. This allows the
# superbuild to build everything BUT drake, which can still be built separately
# from its build directory. This is used by the dashboards to make separate
# submissions for drake proper and the superbuild without drake. Some users may
# also find it useful, especially to build drake with ninja using fewer than
# the default number of jobs.
option(SKIP_DRAKE_BUILD "Build external projects but not drake itself" OFF)
if(SKIP_DRAKE_BUILD)
  set(DRAKE_BUILD_COMMANDS BUILD_COMMAND : INSTALL_COMMAND :)
endif()

# END options
###############################################################################
# BEGIN external projects

# External projects in order of dependencies; 'trivial' ones first
drake_add_external(bertini CMAKE)
drake_add_external(eigen PUBLIC CMAKE)
drake_add_external(gloptipoly CMAKE)
drake_add_external(gurobi)
drake_add_external(meshconverters PUBLIC CMAKE)
drake_add_external(mosek PUBLIC)
drake_add_external(sedumi)
drake_add_external(snopt CMAKE)
drake_add_external(spdlog PUBLIC CMAKE)
drake_add_external(swigmake PUBLIC CMAKE)
drake_add_external(yalmip PUBLIC CMAKE)
drake_add_external(robot CMAKE)

# avl
# The Ninja generator does not support Fortran.
drake_add_external(avl PUBLIC CMAKE GENERATOR "Unix Makefiles")

# bullet
if(WIN32)
  set(BULLET_EXTRA_CMAKE_ARGS -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON)
else()
  set(BULLET_EXTRA_CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
endif()

drake_add_external(bullet PUBLIC CMAKE
  CMAKE_ARGS
    -DBUILD_BULLET2_DEMOS=OFF
    -DBUILD_CPU_DEMOS=OFF
    -DBUILD_EXTRAS=OFF
    -DBUILD_OPENGL3_DEMOS=OFF
    -DBUILD_UNIT_TESTS=OFF
    -DCMAKE_DEBUG_POSTFIX=
    -DCMAKE_MINSIZEREL_POSTFIX=
    -DCMAKE_RELWITHDEBINFO_POSTFIX=
    -DINSTALL_LIBS=ON
    -DPKGCONFIG_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
    -DUSE_DOUBLE_PRECISION=ON
    ${BULLET_EXTRA_CMAKE_ARGS})

# cmake
drake_add_external(cmake PUBLIC ALWAYS
  BUILD_COMMAND :
  SOURCE_DIR ${PROJECT_SOURCE_DIR}/drake/cmake)

# dreal
drake_add_external(dreal PUBLIC CMAKE
  CMAKE_ARGS -DUSE_NLOPT=OFF
  SOURCE_SUBDIR src)

# gflags
if(WIN32)
  # We can't figure out how to get gflags shared libraries working on Windows
  # (see #3345), so here we build it with static libraries only.  Code that
  # lives in Drake's shared libraries must be conditionalized to avoid using
  # gflags on Windows.
  drake_add_external(gflags PUBLIC CMAKE)
else()
  drake_add_external(gflags PUBLIC CMAKE
    CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
endif()

# googletest
drake_add_external(googletest PUBLIC CMAKE
  CMAKE_ARGS
    -DBUILD_SHARED_LIBS=ON
    -DGTEST_CREATE_SHARED_LIBRARY=1 # Needed for parameterized tests on Windows
    -DCMAKE_INSTALL_NAME_DIR=${CMAKE_INSTALL_PREFIX}/lib)

# google_styleguide
drake_add_external(google_styleguide PUBLIC
  BUILD_COMMAND :)

# ipopt
drake_add_external(ipopt PUBLIC
  # TODO(sam.creasey) add an alternate build command for WIN32 which
  # downloads the precopiled binary and installs that.
  CONFIGURE_COMMAND ./configure
    --with-blas=BUILD
    --with-lapack=BUILD
    --prefix=${CMAKE_INSTALL_PREFIX}
    --includedir=${CMAKE_INSTALL_PREFIX}/include/ipopt
    --disable-shared
    --with-pic
  INSTALL_COMMAND ${MAKE_COMMAND} install)

# nlopt
drake_add_external(nlopt PUBLIC CMAKE
  CMAKE_ARGS
    -DBUILD_SHARED_LIBS=ON
    -DBUILD_PYTHON=OFF
    -DBUILD_OCTAVE=OFF
    -DBUILD_MATLAB=OFF
    -DBUILD_GUILE=OFF
    -DUSE_SWIG=OFF)

# spotless
drake_add_external(spotless PUBLIC CMAKE
  CMAKE_ARGS -DMatlab_ROOT_DIR=${MATLAB_ROOT_DIR})

# octomap
drake_add_external(octomap PUBLIC CMAKE
  SOURCE_SUBDIR octomap)

# swig_matlab
drake_add_external(swig_matlab PUBLIC
  PATCH_COMMAND ./autogen.sh
  CONFIGURE_COMMAND ./configure
    --prefix=${CMAKE_INSTALL_PREFIX}
    --with-matlab
  INSTALL_COMMAND ${MAKE_COMMAND} install)

# textbook
drake_add_external(textbook PUBLIC
  REQUIRES PythonInterp
  SOURCE_DIR ${PROJECT_SOURCE_DIR}/drake/doc/textbook
  BUILD_COMMAND \@PYTHON_EXECUTABLE\@
    extract_examples.py underactuated.html ./examples)

# yaml_cpp
if(APPLE OR WIN32)
  drake_add_external(yaml_cpp PUBLIC CMAKE
    CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF)
else()
  drake_add_external(yaml_cpp PUBLIC CMAKE
    CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
endif()

# iris
drake_add_external(iris PUBLIC
  CONFIGURE_COMMAND ${MAKE_COMMAND} configure-cdd-only
  DEPENDS eigen mosek)

# lcm (and gtk)
if(WIN32)
  # On Windows, always build LCM in Release mode for compatibility with the
  # Python libraries.
  if(CMAKE_CONFIGURATION_TYPES)
    # If using a multi-configuration generator, replace the default build
    # commands to force the Release configuration to be built.
    set(lcm_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release)
    set(lcm_FORCE_RELEASE_BUILD_COMMANDS
      BUILD_COMMAND ${lcm_BUILD_COMMAND}
      INSTALL_COMMAND ${lcm_BUILD_COMMAND} --target install)
  endif()

  drake_add_external(gtk PUBLIC CMAKE)
  drake_add_external(lcm PUBLIC CMAKE
    ${lcm_FORCE_RELEASE_BUILD_COMMANDS}
    CMAKE_ARGS
      -DBUILD_SHARED_LIBS=ON # Because LCM has no ABI decoration
      -DCMAKE_BUILD_TYPE=Release # See above
      -DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_SOURCE_DIR}/externals/gtk/gtk3
    DEPENDS gtk)
else()
  drake_add_external(lcm PUBLIC CMAKE
    CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
endif()

# libbot
drake_add_external(libbot PUBLIC CMAKE
  DEPENDS lcm)

# bot_core_lcmtypes
drake_add_external(bot_core_lcmtypes PUBLIC CMAKE
  DEPENDS lcm libbot) # Conflicts with libbot; ensure this is built after

# director
drake_add_external(director PUBLIC CMAKE
  SOURCE_SUBDIR distro/superbuild
  CMAKE_ARGS
    -DUSE_LCM=ON # TODO: predicate on whether we have LCM enabled?
    -DUSE_LCMGL=ON
    -DUSE_SYSTEM_LCM=ON
    -DUSE_EXTERNAL_INSTALL=ON
  INSTALL_COMMAND :
  DEPENDS bot_core_lcmtypes lcm libbot)

# signalscope
drake_add_external(signalscope PUBLIC
  DEPENDS director)

# xfoil
# The Ninja generator does not support Fortran.
drake_add_external(xfoil PUBLIC CMAKE GENERATOR "Unix Makefiles")

# drake: For drake, list both compilation AND RUNTIME dependencies. Runtime
# dependencies are needed because the drake project must configure only after
# any dependencies used by MATLAB have been installed.
drake_add_external(drake LOCAL PUBLIC CMAKE ALWAYS
  SOURCE_DIR ${PROJECT_SOURCE_DIR}/drake
  BINARY_DIR ${PROJECT_BINARY_DIR}/drake
  ${DRAKE_BUILD_COMMANDS}
  CMAKE_ARGS
    -DDISABLE_MATLAB:BOOL=${DISABLE_MATLAB}
    -DWITH_AVL:BOOL=${WITH_AVL}
    -DWITH_BERTINI:BOOL=${WITH_BERTINI}
    -DWITH_BULLET:BOOL=${WITH_BULLET}
    -DWITH_DIRECTOR:BOOL=${WITH_DIRECTOR}
    -DWITH_DREAL:BOOL=${WITH_DREAL}
    -DWITH_ROBOT:BOOL=${WITH_ROBOT}
    -DWITH_GLOPTIPOLY:BOOL=${WITH_GLOPTIPOLY}
    -DWITH_GOOGLE_STYLEGUIDE:BOOL=${WITH_GOOGLE_STYLEGUIDE}
    -DWITH_GUROBI:BOOL=${WITH_GUROBI}
    -DWITH_IPOPT:BOOL=${WITH_IPOPT}
    -DWITH_IRIS:BOOL=${WITH_IRIS}
    -DWITH_LCM:BOOL=${WITH_LCM}
    -DWITH_LIBBOT:BOOL=${WITH_LIBBOT}
    -DWITH_MOSEK:BOOL=${WITH_MOSEK}
    -DWITH_NLOPT:BOOL=${WITH_NLOPT}
    -DWITH_OCTOMAP:BOOL=${WITH_OCTOMAP}
    -DWITH_PYTHON_3:BOOL=${WITH_PYTHON_3}
    -DWITH_SEDUMI:BOOL=${WITH_SEDUMI}
    -DWITH_SNOPT:BOOL=${WITH_SNOPT}
    -DWITH_SPOTLESS:BOOL=${WITH_SPOTLESS}
    -DWITH_XFOIL:BOOL=${WITH_XFOIL}
    -DWITH_YALMIP:BOOL=${WITH_YALMIP}
  DEPENDS
    avl
    bertini
    bot_core_lcmtypes
    bullet
    cmake
    director
    dreal
    eigen
    gflags
    gloptipoly
    google_styleguide
    googletest
    gtk
    gurobi
    ipopt
    iris
    lcm
    libbot
    meshconverters
    mosek
    nlopt
    octomap
    robot
    sedumi
    snopt
    spdlog
    spotless
    swig_matlab
    swigmake
    yalmip
    yaml_cpp
    xfoil
)

# END external projects
###############################################################################
# BEGIN examples

# Optional examples
drake_add_example(LittleDog OFF
  "planning and control for a small quadruped robot")

# END examples
###############################################################################

## grab and install precompiled snopt

# TODO: look for snopt_c
if(snopt_c_FOUND OR WITH_SNOPT)
  set(WITH_SNOPT_PRECOMPILED OFF)
endif()
if(WITH_SNOPT_PRECOMPILED)
  message(STATUS "Preparing to install precompiled snopt")
  ExternalProject_Add(download-snopt-precompiled
    URL "https://s3.amazonaws.com/drake-provisioning/drakeSnopt.zip"
    URL_MD5 "7b36168cba2fb9a56b2fd6117427fc4a"
    SOURCE_DIR "${CMAKE_BINARY_DIR}/snopt-precompiled"
    CONFIGURE_COMMAND ""
    BUILD_COMMAND cmake -E copy_directory
      ${CMAKE_BINARY_DIR}/snopt-precompiled/
      ${PROJECT_SOURCE_DIR}/drake/matlab/solvers/
    INSTALL_COMMAND "")
  add_dependencies(download-all download-snopt-precompiled)
  add_dependencies(drake download-snopt-precompiled) # just in case: make sure any compiled drake version happens after precompiled install
endif()
amcastro-tri commented 7 years ago

Hello @aespielberg, glad to hear you are working on this!. I am actually doing some research myself on how to do soft body simulation within Drake. I am curious to know what approach you used, if applicable to general 3D configurations and about its integration with rigid body dynamics. As the guys told you above probably a good way to start would be opening and issue where we could spiral a discussion and then a series of smaller PR's. Thank you!

RussTedrake commented 7 years ago

Thanks @aespielberg . but, uh. Can we not call the new external WITH_ROBOT? :) What external package is it exactly?

aespielberg commented 7 years ago

Hahaha, yes, WITH_ROBOT is a terrible, terrible name. We're going to fix it once we fix the cmake stuff. I will provide more details about it on slack tomorrow for you and @amcastro-tri .

RussTedrake commented 7 years ago

This discussion fizzled. Will close this for now.