├── .gitignore
├── CHANGES
├── CMakeLists.txt
├── CMakeModules
├── FindCBLAS.cmake
├── FindIPOPT.cmake
├── FindLAPACKLite.cmake
├── FindOpenMP.cmake
├── FindQHULL.cmake
├── FindQPOASES.cmake
├── FindRavelin.cmake
└── FindSuperLU.cmake
├── README
├── README.md
├── cmake_uninstall.cmake.in
├── docs
├── Moby
├── XML-structure.tex
├── fixed.nb
├── install.tex
├── prismatic.nb
├── revolute.nb
└── universal.nb
├── example
├── README
├── bouncing-ball
│ └── bouncing-ball.xml
├── contact-constrained-pendulum
│ ├── contact-constrained-pendulum-coldet-plugin.cpp
│ ├── contact-constrained-pendulum-init.cpp
│ └── contact-constrained-pendulum.xml
├── ellipse
│ ├── ellipse-init.cpp
│ ├── ellipse-plane-coldet-plugin.cpp
│ ├── ellipse.obj
│ └── ellipse2D.xml
├── events
│ └── rotating-box.xml
├── fixed-joint
│ └── fixed-articulated-table.xml
├── gears
│ └── pendulum-gears.xml
├── joint-limits
│ ├── chain.xml
│ ├── limit-double-pendulum.xml
│ └── limit-pendulum.xml
├── mrobot
│ ├── controller.cpp
│ ├── mrobot.pacer
│ ├── mrobot.sdf
│ └── mrobot.xml
├── parts-feeder
│ ├── CMakeLists.txt
│ ├── feeder.cpp
│ └── feeder.xml
├── passive-walker
│ ├── coldet-plugin.cpp
│ ├── init.cpp
│ ├── walker.sdf
│ └── walker.xml
├── planar-joint
│ └── constrained.xml
├── plugin-template.cpp
├── polyhedra
│ ├── spinning-box-frictional.xml
│ └── spinning-box-frictionless.xml
├── reduced-coords
│ ├── chain.xml
│ ├── double-pendulum.xml
│ ├── pendulum-gears-impact.xml
│ ├── pendulum-plugin.cpp
│ └── pendulum.xml
├── regress.cpp
├── relative-visualization
│ └── box-plane.xml
├── rimless-wheel
│ ├── coldet-plugin.cpp
│ ├── init.cpp
│ ├── params.h
│ └── wheel.xml
├── rolling-torus
│ └── torus.xml
├── simple-contact
│ ├── box-plugin.cpp
│ ├── cylinder.xml
│ ├── ramp.xml
│ ├── simplest.xml
│ ├── spinning-box-frictional.xml
│ └── spinning-box-frictionless.xml
├── sims-in-code
│ ├── block.cpp
│ ├── doublependulum.cpp
│ ├── linearactuator.cpp
│ ├── pendulum.cpp
│ ├── pushpendulum.cpp
│ └── viewer.h
├── stacks
│ ├── sphere-stack.xml
│ ├── stack.xml
│ ├── stack2.xml
│ └── stack3.xml
├── tare
│ └── pendulum.xml
├── ur10
│ ├── block.obj
│ ├── controller.cpp
│ ├── meshes
│ │ ├── Base.obj
│ │ ├── Base.obj.mtl
│ │ ├── Forearm.obj
│ │ ├── SCHUNK_MPG-80_BASE.obj
│ │ ├── SCHUNK_MPG-80_LEFT_FINGER.obj
│ │ ├── SCHUNK_MPG-80_RIGHT_FINGER.obj
│ │ ├── Shoulder.obj
│ │ ├── UpperArm.obj
│ │ ├── UpperArm.obj.mtl
│ │ ├── Wrist1.obj
│ │ ├── Wrist2.obj
│ │ ├── Wrist3.obj
│ │ ├── centered.Base.obj
│ │ ├── centered.Shoulder.obj
│ │ ├── schunk_base.obj
│ │ ├── schunk_left_finger.obj
│ │ └── schunk_right_finger.obj
│ ├── model.config
│ ├── model.sdf
│ ├── schunk_mpg_80
│ │ ├── cvio.dat
│ │ ├── driver.out-00000000-0.001000.mtl
│ │ ├── driver.out-00000000-0.001000.obj
│ │ ├── meshes
│ │ │ └── visual
│ │ │ │ ├── SCHUNK_MPG-80_BASE.dae
│ │ │ │ ├── SCHUNK_MPG-80_LEFT_FINGER.dae
│ │ │ │ └── SCHUNK_MPG-80_RIGHT_FINGER.dae
│ │ ├── model.config
│ │ ├── model.sdf
│ │ └── schunk.xml
│ ├── ur10.xml
│ └── ur10
│ │ ├── meshes
│ │ ├── collision
│ │ │ ├── Base.dae
│ │ │ ├── Forearm.dae
│ │ │ ├── Shoulder.dae
│ │ │ ├── UpperArm.dae
│ │ │ ├── Wrist1.dae
│ │ │ ├── Wrist2.dae
│ │ │ └── Wrist3.dae
│ │ └── visual
│ │ │ ├── Base.dae
│ │ │ ├── Forearm.dae
│ │ │ ├── Shoulder.dae
│ │ │ ├── UpperArm.dae
│ │ │ ├── Wrist1.dae
│ │ │ ├── Wrist2.dae
│ │ │ └── Wrist3.dae
│ │ ├── model.config
│ │ ├── ref_ur10.sdf
│ │ └── ur10.sdf
└── urdf
│ ├── pendulum-urdf.xml
│ └── pendulum.urdf
├── include
└── Moby
│ ├── AABB.h
│ ├── AABB.inl
│ ├── ADF.h
│ ├── ArticulatedBody.h
│ ├── ArticulatedBody.inl
│ ├── BV.h
│ ├── BV.inl
│ ├── Base.h
│ ├── BoundingSphere.h
│ ├── BoundingSphere.inl
│ ├── BoxPrimitive.h
│ ├── C2ACCD.h
│ ├── C2ACCD.inl
│ ├── CCD.h
│ ├── CCD.inl
│ ├── CP.h
│ ├── CSG.h
│ ├── CollisionDetection.h
│ ├── CollisionDetection.inl
│ ├── CollisionGeometry.h
│ ├── CompGeom.h
│ ├── CompGeom.inl
│ ├── ConePrimitive.h
│ ├── Constants.h
│ ├── ConstraintSimulator.h
│ ├── ConstraintStabilization.h
│ ├── Contact.inl
│ ├── ContactParameters.h
│ ├── ControlledBody.h
│ ├── CylinderPrimitive.h
│ ├── DampingForce.h
│ ├── DegenerateTriangleException.h
│ ├── Dissipation.h
│ ├── DummyBV.h
│ ├── EventDrivenSimulator.h
│ ├── EventDrivenSimulator.inl
│ ├── FastThreadable.h
│ ├── FixedJoint.h
│ ├── GJK.h
│ ├── GaussianMixture.h
│ ├── Gears.h
│ ├── GravityForce.h
│ ├── HashClasses.h
│ ├── HeightmapPrimitive.h
│ ├── ImpactConstraintHandler.h
│ ├── ImpactToleranceException.h
│ ├── IndexedTetra.h
│ ├── IndexedTetraArray.h
│ ├── IndexedTetraArray.inl
│ ├── IndexedTri.h
│ ├── IndexedTriArray.h
│ ├── IndexedTriArray.inl
│ ├── InvalidIndexException.h
│ ├── InvalidStateException.h
│ ├── InvalidVelocityException.h
│ ├── Joint.h
│ ├── LCP.h
│ ├── LCPSolverException.h
│ ├── LCP_IPOPT.h
│ ├── LP.h
│ ├── Log.h
│ ├── MCArticulatedBody.h
│ ├── MissizeException.h
│ ├── NQP_IPOPT.h
│ ├── Node.h
│ ├── NonsquareMatrixException.h
│ ├── NumericalException.h
│ ├── OBB.h
│ ├── OBB.inl
│ ├── OSGGroupWrapper.h
│ ├── PairwiseDistInfo.h
│ ├── PenaltyConstraintHandler.h
│ ├── PlanarJoint.h
│ ├── Plane.h
│ ├── PlanePrimitive.h
│ ├── PolyhedralPrimitive.h
│ ├── PolyhedralPrimitive.inl
│ ├── Polyhedron.h
│ ├── Polyhedron.inl
│ ├── Primitive.h
│ ├── Primitive.inl
│ ├── PrismaticJoint.h
│ ├── QLCPD.h
│ ├── QLCPD.inl
│ ├── QP.h
│ ├── QP.inl
│ ├── RCArticulatedBody.h
│ ├── RCArticulatedBodyInvDynAlgo.h
│ ├── RecurrentForce.h
│ ├── RevoluteJoint.h
│ ├── RigidBody.h
│ ├── RigidBody.inl
│ ├── SDFReader.h
│ ├── SSL.h
│ ├── SSL.inl
│ ├── SSR.h
│ ├── SSR.inl
│ ├── ScrewJoint.h
│ ├── SignedDistDot.h
│ ├── Simulator.h
│ ├── Simulator.inl
│ ├── SingularException.h
│ ├── SparseJacobian.h
│ ├── SpherePrimitive.h
│ ├── SphericalJoint.h
│ ├── StokesDragForce.h
│ ├── SustainedUnilateralConstraintHandler.h
│ ├── SustainedUnilateralConstraintProblemData.h
│ ├── SustainedUnilateralConstraintSolveFailException.h
│ ├── TessellatedPolyhedron.h
│ ├── TessellatedPolyhedron.inl
│ ├── Tetrahedron.h
│ ├── ThickTriangle.h
│ ├── TimeSteppingSimulator.h
│ ├── TorusPrimitive.h
│ ├── Triangle.h
│ ├── TriangleMeshPrimitive.h
│ ├── TriangleMeshPrimitive.inl
│ ├── Types.h
│ ├── URDFReader.h
│ ├── UndefinedAxisException.h
│ ├── UnilateralConstraint.h
│ ├── UnilateralConstraint.inl
│ ├── UnilateralConstraintProblemData.h
│ ├── UniversalJoint.h
│ ├── Visualizable.h
│ ├── XMLReader.h
│ ├── XMLTree.h
│ ├── XMLWriter.h
│ ├── insertion_sort
│ ├── permute.h
│ ├── qpOASES.h
│ ├── qpOASES.inl
│ └── select
├── programs
├── adjust-center.cpp
├── center.cpp
├── compare-trajs.cpp
├── conv-decomp.cpp
├── convexify.cpp
├── driver.cpp
├── main.cpp
├── objwrl.cpp
├── regress.cpp
├── render-movie-simple.sh
├── render-movie.sh
├── render.cpp
└── view.cpp
├── regress
├── absolute-coords.setup
├── bouncing-ball.setup
├── contact-constrained-pendulum.dat
├── contact-constrained-pendulum.setup
├── cylinder.setup
├── fixed-articulated-table.dat
├── fixed-articulated-table.setup
├── gears.setup
├── joint-limits.setup
├── pendulum-urdf.setup
├── planar-joint.setup
├── ramp.setup
├── reduced-coords.setup
├── regenerate-regression-data
├── regression-test
├── rimless-wheel.dat
├── rimless-wheel.setup
├── rolling-torus.setup
├── sitting-box.dat
├── sphere-stack.dat
├── spinning-boxes.setup
└── stacks.setup
├── src
├── AABB.cpp
├── ADF.cpp
├── ArticulatedBody.cpp
├── BV.cpp
├── Base.cpp
├── BoundingSphere.cpp
├── BoxPrimitive.cpp
├── BulirschStoerIntegrator.cpp
├── C2ACCD.cpp
├── CCD.cpp
├── CP.cpp
├── CSG.cpp
├── CollisionDetection.cpp
├── CollisionGeometry.cpp
├── Color.h
├── CompGeom.cpp
├── ConePrimitive.cpp
├── ConstraintSimulator.cpp
├── ConstraintStabilization.cpp
├── ContactParameters.cpp
├── ControlledBody.cpp
├── CylinderPrimitive.cpp
├── DampingForce.cpp
├── Dissipation.cpp
├── EulerIntegrator.cpp
├── EventDrivenSimulator.cpp
├── FixedJoint.cpp
├── GJK.cpp
├── GaussianMixture.cpp
├── Gears.cpp
├── GravityForce.cpp
├── HeightmapPrimitive.cpp
├── ImpactConstraintHandler.cpp
├── ImpactConstraintHandlerLCP.cpp
├── ImpactConstraintHandlerNQP.cpp
├── ImpactConstraintHandlerQP.cpp
├── IndexedTetraArray.cpp
├── IndexedTriArray.cpp
├── Integrator.cpp
├── Joint.cpp
├── LCP.cpp
├── LCP_IPOPT.cpp
├── LP.cpp
├── Log.cpp
├── MCArticulatedBody.cpp
├── NQP_IPOPT.cpp
├── OBB.cpp
├── ODEPACKIntegrator.cpp
├── OSGGroupWrapper.cpp
├── OsgTorus.cpp
├── OsgTorus.h
├── PenaltyConstraintHandler.cpp
├── PlanarJoint.cpp
├── PlanePrimitive.cpp
├── PolyhedralPrimitive.cpp
├── Polyhedron.cpp
├── Primitive.cpp
├── PrismaticJoint.cpp
├── QLCPD.cpp
├── RCArticulatedBody.cpp
├── RCArticulatedBodyFwdDynAlgo.cpp
├── RestingContactHandler.cpp.bak
├── RevoluteJoint.cpp
├── RigidBody.cpp
├── Rosenbrock4Integrator.cpp
├── RungeKuttaFehlbergIntegrator.cpp
├── RungeKuttaImplicitIntegrator.cpp
├── RungeKuttaIntegrator.cpp
├── SDFReader.cpp
├── SSL.cpp
├── SSR.cpp
├── ScrewJoint.cpp
├── SignedDistDot.cpp
├── Simulator.cpp
├── SingleBody.cpp
├── SparseJacobian.cpp
├── SpherePrimitive.cpp
├── SphericalJoint.cpp
├── StokesDragForce.cpp
├── SustainedUnilateralConstraintHandler.cpp
├── TessellatedPolyhedron.cpp
├── Tetrahedron.cpp
├── ThickTriangle.cpp
├── TimeSteppingSimulator.cpp
├── TorusPrimitive.cpp
├── Triangle.cpp
├── TriangleMeshPrimitive.cpp
├── URDFReader.cpp
├── UnilateralConstraint.cpp
├── UniversalJoint.cpp
├── VariableEulerIntegrator.cpp
├── VariableStepIntegrator.cpp
├── Visualizable.cpp
├── XMLReader.cpp
├── XMLTree.cpp
└── XMLWriter.cpp
└── test
├── PolyhedronTest.cpp
├── TestDie.cpp
├── TestOffsetSphere.cpp
├── TestSparseJacobian.cpp
├── TestTorus.cpp
├── VClipTest.cpp
├── box.xml
├── qp.cpp
├── sphere.xml
└── torus.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | release
2 | debug
3 | build
4 |
--------------------------------------------------------------------------------
/CMakeModules/FindCBLAS.cmake:
--------------------------------------------------------------------------------
1 | # - Find CBLAS
2 | # Find the native CBLAS headers and libraries.
3 | #
4 | # CBLAS_LIBRARIES - List of libraries when using cblas.
5 | # CBLAS_FOUND - True if cblas found.
6 | #
7 | # Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
8 | #
9 | # Licensed under the Apache License, Version 2.0 (the "License");
10 | # you may not use this file except in compliance with the License.
11 | # You may obtain a copy of the License at
12 | #
13 | # http://www.apache.org/licenses/LICENSE-2.0
14 | #
15 | # Unless required by applicable law or agreed to in writing, software
16 | # distributed under the License is distributed on an "AS IS" BASIS,
17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | # See the License for the specific language governing permissions and
19 | # limitations under the License.
20 | #
21 |
22 | find_library(CBLAS_LIBRARY NAMES blas cblas HINTS $ENV{CBLASDIR}/lib $ENV{CBLASDIR}/lib64 )
23 |
24 | set(CBLAS_LIBRARIES ${CBLAS_LIBRARY} )
25 |
26 | include(FindPackageHandleStandardArgs)
27 | # handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE
28 | # if all listed variables are TRUE
29 |
30 | find_package_handle_standard_args(CBLAS DEFAULT_MSG CBLAS_LIBRARY )
31 |
32 | if (CBLAS_FOUND)
33 | include(CheckLibraryExists)
34 | check_library_exists("${CBLAS_LIBRARY}" cblas_dsyrk "" FOUND_DSYRK)
35 | if(NOT FOUND_DSYRK)
36 | message(FATAL_ERROR "Could not find cblas_dsyrk in ${CBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set CBLAS_LIBRARY by hand (i.e. -DCBLAS_LIBRARY='/path/to/libcblas.so') !")
37 | endif(NOT FOUND_DSYRK)
38 | endif (CBLAS_FOUND)
39 |
40 | mark_as_advanced( CBLAS_LIBRARY )
41 |
42 |
--------------------------------------------------------------------------------
/CMakeModules/FindLAPACKLite.cmake:
--------------------------------------------------------------------------------
1 | # - Find LAPACK library
2 | # This module finds an installed fortran library that implements the LAPACK
3 | # linear-algebra interface (see http://www.netlib.org/lapack/).
4 | #
5 | # The approach follows that taken for the autoconf macro file, acx_lapack.m4
6 | # (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
7 | #
8 | # This module sets the following variables:
9 | # LAPACK_FOUND - set to true if a library implementing the LAPACK interface
10 | # is found
11 | # LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
12 | # and -L).
13 | # LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
14 | # link against to use LAPACK
15 | # BLA_STATIC if set on this determines what kind of linkage we do (static)
16 | # BLA_VENDOR if set checks only the specified vendor, if not set checks
17 | # all the possibilities
18 | ### List of vendors (BLA_VENDOR) valid in this module
19 | ## Intel(mkl), ACML,Apple, NAS, Generic
20 |
21 | #=============================================================================
22 | # Copyright 2007-2009 Kitware, Inc.
23 | #
24 | # Distributed under the OSI-approved BSD License (the "License");
25 | # see accompanying file Copyright.txt for details.
26 | #
27 | # This software is distributed WITHOUT ANY WARRANTY; without even the
28 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29 | # See the License for more information.
30 | #=============================================================================
31 | # (To distribute this file outside of CMake, substitute the full
32 | # License text for the above reference.)
33 |
34 | find_library(LAPACK_LIBRARY NAMES lapack-3.1 lapack-3 lapack $ENV{LAPACKDIR}/lib $ENV{LAPACKDIR}/lib64)
35 |
36 | set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
37 |
38 | include(FindPackageHandleStandardArgs)
39 | find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARY)
40 |
41 | mark_as_advanced(LAPACK_LIBRARY)
42 |
43 |
--------------------------------------------------------------------------------
/CMakeModules/FindQHULL.cmake:
--------------------------------------------------------------------------------
1 | # Find qhull header and library.
2 | #
3 |
4 | # This module defines the following uncached variables:
5 | # QHULL_FOUND, if false, do not try to use qhull.
6 | # QHULL_INCLUDE_DIRS, where to find qhull/qhull_a.h.
7 | # QHULL_LIBRARIES, the libraries to link against to use the qhull library
8 | # QHULL_LIBRARY_DIRS, the directory where the qhull library is found.
9 |
10 | find_path(
11 | QHULL_INCLUDE_DIR
12 | qhull/qhull_a.h libqhull/qhull_a.h
13 | PATHS /usr/local/include /usr/include
14 | )
15 |
16 | if( QHULL_INCLUDE_DIR )
17 | find_library(
18 | QHULL_LIBRARY
19 | NAMES libqhullstatic libqhull qhullstatic qhull
20 | PATHS /usr/local/lib /usr/lib
21 | )
22 | if( QHULL_LIBRARY )
23 | set(QHULL_LIBRARY_DIR "")
24 | get_filename_component(QHULL_LIBRARY_DIRS ${QHULL_LIBRARY} PATH)
25 | # Set uncached variables as per standard.
26 | set(QHULL_FOUND ON)
27 | set(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIR})
28 | set(QHULL_LIBRARIES ${QHULL_LIBRARY})
29 | endif(QHULL_LIBRARY)
30 | else(QHULL_INCLUDE_DIR)
31 | message(FATAL_ERROR "FindQHull: Could not find qhull_a.h")
32 | endif(QHULL_INCLUDE_DIR)
33 |
34 | if(QHULL_FOUND)
35 | if(NOT QHULL_FIND_QUIETLY)
36 | message(STATUS "FindQHull: Found both qhull_a.h and libqhull.a")
37 | endif(NOT QHULL_FIND_QUIETLY)
38 | else(QHULL_FOUND)
39 | if(QHULL_FIND_REQUIRED)
40 | message(FATAL_ERROR "FindQHull: Could not find qhull_a.h and/or libqhull.a")
41 | endif(QHULL_FIND_REQUIRED)
42 | endif(QHULL_FOUND)
43 |
--------------------------------------------------------------------------------
/CMakeModules/FindQPOASES.cmake:
--------------------------------------------------------------------------------
1 | # Find qpOASES header and library.
2 | #
3 |
4 | # This module defines the following uncached variables:
5 | # QPOASES_FOUND, if false, do not try to use qpOASES.
6 | # QPOASES_INCLUDE_DIRS, where to find qpOASES/include
7 | # QPOASES_LIBRARIES, the libraries to link against to use the qpoases library
8 | # QPOASES_LIBRARY_DIRS, the directory where the qpoases library is found.
9 |
10 | # look for QPOASES
11 | find_library(QPOASES_LIBRARY qpOASES NAMES libqpOASES.a libqpOASES.dylib /usr/local/lib /usr/lib)
12 |
13 | find_path(QPOASES_INCLUDE_DIR qpOASES PATHS /usr/local/include /usr/include)
14 |
15 | if (USE_QPOASES)
16 | if (QPOASES_LIBRARY AND QPOASES_INCLUDE_DIR)
17 |
18 | set(QPOASES_LIBRARY_DIR "")
19 | get_filename_component(QPOASES_LIBRARY_DIRS ${QPOASES_LIBRARY} PATH)
20 | # Set uncached variables as per standard.
21 | set(QPOASES_FOUND ON)
22 | set(QPOASES_INCLUDE_DIRS ${QPOASES_INCLUDE_DIR})
23 | set(QPOASES_LIBRARIES ${QPOASES_LIBRARY})
24 | endif (QPOASES_FOUND AND QPOASES_INCLUDE_DIR)
25 | endif (USE_QPOASES)
26 |
27 | if(QPOASES_LIBRARY)
28 | if(NOT QPOASES_FIND_QUIETLY)
29 | message(STATUS "FindQPOASES: Found both include/qpoases and libqpOASES.a")
30 | endif(NOT QPOASES_FIND_QUIETLY)
31 | else(QPOASES_LIBRARY)
32 | if(QPOASES_INCLUDE_DIR)
33 | message(FATAL_ERROR "FindQPOASES: Could not find libqpoases.a")
34 | endif(QPOASES_INCLUDE_DIR)
35 | endif(QPOASES_LIBRARY)
36 |
37 |
--------------------------------------------------------------------------------
/CMakeModules/FindRavelin.cmake:
--------------------------------------------------------------------------------
1 | # Find Ravelin header and library.
2 | #
3 |
4 | # This module defines the following uncached variables:
5 | # RAVELIN_FOUND, if false, do not try to use Ravelin.
6 | # RAVELIN_INCLUDE_DIRS, where to find Ravelin/Ravelin_a.h.
7 | # RAVELIN_LIBRARIES, the libraries to link against to use the Ravelin library
8 | # RAVELIN_LIBRARY_DIRS, the directory where the Ravelin library is found.
9 |
10 | find_path(
11 | RAVELIN_INCLUDE_DIR
12 | Ravelin/VectorNd.h
13 | PATHS /usr/local/include /usr/include
14 | )
15 |
16 | if( RAVELIN_INCLUDE_DIR )
17 | find_library(
18 | RAVELIN_LIBRARY
19 | NAMES libRavelin Ravelin
20 | PATHS /usr/local/lib /usr/lib
21 | )
22 | if( RAVELIN_LIBRARY )
23 | set(RAVELIN_LIBRARY_DIR "")
24 | get_filename_component(RAVELIN_LIBRARY_DIRS ${RAVELIN_LIBRARY} PATH)
25 | # Set uncached variables as per standard.
26 | set(RAVELIN_FOUND ON)
27 | set(RAVELIN_INCLUDE_DIRS ${RAVELIN_INCLUDE_DIR})
28 | set(RAVELIN_LIBRARIES ${RAVELIN_LIBRARY})
29 | endif(RAVELIN_LIBRARY)
30 | else(RAVELIN_INCLUDE_DIR)
31 | message(FATAL_ERROR "FindRavelin: Could not find VectorNd.h")
32 | endif(RAVELIN_INCLUDE_DIR)
33 |
34 | if(RAVELIN_FOUND)
35 | if(NOT RAVELIN_FIND_QUIETLY)
36 | message(STATUS "FindRavelin: Found both VectorNd.h and libRavelin.a")
37 | endif(NOT RAVELIN_FIND_QUIETLY)
38 | else(RAVELIN_FOUND)
39 | if(RAVELIN_FIND_REQUIRED)
40 | message(FATAL_ERROR "FindRavelin: Could not find VectorNd.h and/or libRavelin.a")
41 | endif(RAVELIN_FIND_REQUIRED)
42 | endif(RAVELIN_FOUND)
43 |
--------------------------------------------------------------------------------
/CMakeModules/FindSuperLU.cmake:
--------------------------------------------------------------------------------
1 |
2 | # Umfpack lib usually requires linking to a blas library.
3 | # It is up to the user of this module to find a BLAS and link to it.
4 |
5 | if (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
6 | set(SUPERLU_FIND_QUIETLY TRUE)
7 | endif (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
8 |
9 | find_path(SUPERLU_INCLUDES
10 | NAMES
11 | supermatrix.h
12 | PATHS
13 | ${SUPERLU_PATH}/include
14 | $ENV{SUPERLUDIR}/include
15 | ${INCLUDE_INSTALL_DIR}
16 | PATH_SUFFIXES
17 | superlu
18 | )
19 |
20 | find_library(SUPERLU_LIBRARIES
21 | NAMES
22 | superlu
23 | superlu_4.3
24 | PATHS
25 | ${SUPERLU_PATH}/lib
26 | $ENV{SUPERLUDIR}/lib
27 | ${LIB_INSTALL_DIR})
28 |
29 | include(FindPackageHandleStandardArgs)
30 | find_package_handle_standard_args(SUPERLU DEFAULT_MSG
31 | SUPERLU_INCLUDES SUPERLU_LIBRARIES)
32 |
33 | mark_as_advanced(SUPERLU_INCLUDES SUPERLU_LIBRARIES)
34 |
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Moby
2 | ====
3 |
4 | The _Moby_ multi-rigid body dynamics simulator. See the [wiki](https://github.com/PositronicsLab/Moby/wiki) for proper documentation.
5 |
--------------------------------------------------------------------------------
/cmake_uninstall.cmake.in:
--------------------------------------------------------------------------------
1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
4 |
5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
6 | string(REGEX REPLACE "\n" ";" files "${files}")
7 | foreach(file ${files})
8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
10 | exec_program(
11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
12 | OUTPUT_VARIABLE rm_out
13 | RETURN_VALUE rm_retval
14 | )
15 | if(NOT "${rm_retval}" STREQUAL 0)
16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
17 | endif(NOT "${rm_retval}" STREQUAL 0)
18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
20 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
21 | endforeach(file)
22 |
23 |
--------------------------------------------------------------------------------
/example/bouncing-ball/bouncing-ball.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/contact-constrained-pendulum/contact-constrained-pendulum-init.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | * "Controller" for constrained pendulum example
3 | ****************************************************************************/
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | using boost::shared_ptr;
14 | using namespace Ravelin;
15 | using namespace Moby;
16 |
17 | Moby::RigidBodyPtr l1;
18 | boost::shared_ptr sim;
19 | boost::shared_ptr grav;
20 |
21 | // setup simulator callback
22 | void post_step_callback(Simulator* sim)
23 | {
24 | const unsigned Y = 1, Z = 2;
25 |
26 | // output the energy of the link
27 | std::ofstream out("energy.dat", std::ostream::app);
28 | Transform3d gTw = Pose3d::calc_relative_pose(l1->get_pose(), GLOBAL);
29 | double KE = l1->calc_kinetic_energy();
30 | double PE = l1->get_inertia().m*(gTw.x[Y]+1.0)*-grav->gravity[Y];
31 | out << KE << " " << PE << " " << (KE+PE) << std::endl;
32 | out.close();
33 | SVelocityd v = l1->get_velocity();
34 | }
35 |
36 | /// plugin must be "extern C"
37 | extern "C" {
38 |
39 | void init(void* separator, const std::map& read_map, double time)
40 | {
41 | const unsigned Z = 2;
42 |
43 | // kill the existing files
44 | std::ofstream out("energy.dat");
45 | out.close();
46 | out.open("cvio.dat");
47 | out.close();
48 |
49 | // get a reference to the ConstraintSimulator instance
50 | for (std::map::const_iterator i = read_map.begin();
51 | i !=read_map.end(); i++)
52 | {
53 | // Find the simulator reference
54 | if (!sim)
55 | sim = boost::dynamic_pointer_cast(i->second);
56 | if (i->first == "l1")
57 | l1 = boost::dynamic_pointer_cast(i->second);
58 | if (!grav)
59 | grav = boost::dynamic_pointer_cast(i->second);
60 | }
61 |
62 | sim->post_step_callback_fn = &post_step_callback;
63 | }
64 | } // end extern C
65 |
--------------------------------------------------------------------------------
/example/contact-constrained-pendulum/contact-constrained-pendulum.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/example/events/rotating-box.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/example/gears/pendulum-gears.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/joint-limits/limit-double-pendulum.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/example/joint-limits/limit-pendulum.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/example/mrobot/mrobot.pacer:
--------------------------------------------------------------------------------
1 |
2 | ERROR
3 |
4 |
5 |
6 | true
7 | 0 0 0.0 0 0 0
8 |
9 |
10 |
11 | 0left_wheel_hinge 0right_wheel_hinge
12 | 0 0
13 | true true
14 | 1000000 1000000
15 |
16 |
17 |
18 | left_wheel right_wheel chassis
19 | 0 0 0 0 0 0 0 0 0
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/example/mrobot/mrobot.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
33 |
34 |
35 |
36 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/example/parts-feeder/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 |
3 | project(test)
4 |
5 | include (CheckIncludeFiles)
6 | include (CheckLibraryExists)
7 |
8 | set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
9 | set (PROJECT_SRC_DIR .)
10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
11 | find_package(Boost REQUIRED)
12 |
13 | # you may have to add additional includes in here...
14 | add_definitions(-DBUILD_DOUBLE)
15 | add_definitions(-DUSE_OSG)
16 | add_definitions(-DSAFESTATIC=static)
17 | add_definitions(-DUSE_GLPK)
18 |
19 | include_directories(
20 | .
21 | ../../include
22 | /usr/include
23 | /usr/include/libxml2
24 | /usr/local/include
25 | ${Boost_INCLUDE_DIR}
26 | /opt/local/include
27 | /opt/X11/include
28 | )
29 |
30 | link_directories(
31 | /usr/local/lib
32 | /opt/X11/lib
33 | )
34 |
35 | add_library(${PROJECT_NAME}Plugin MODULE feeder.cpp)
36 | target_link_libraries(${PROJECT_NAME}Plugin Moby Ravelin)
37 |
--------------------------------------------------------------------------------
/example/parts-feeder/feeder.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | * Controller for LINKS robot
3 | ****************************************************************************/
4 | #include
5 | #include
6 |
7 | boost::shared_ptr sim;
8 | Moby::RCArticulatedBodyPtr slide;
9 |
10 | void controller_callback(Moby::ControlledBodyPtr dbp, double t, void*)
11 | {
12 | double p = 0.001*cos(t*(2.0*M_PI)*500.0);
13 | double v = -0.001*sin(t*1000.0) *(2.0*M_PI)*500.0;
14 | double Kp = 1e3
15 | ,Kv = 1e1
16 | ;
17 |
18 | for(int i=0;iget_joints().size();i++){
19 | if(slide->get_joints()[i]->num_dof() == 0) continue;
20 | static Ravelin::VectorNd U(1);
21 | U[0] = Kp*(p - slide->get_joints()[i]->q[0]) + Kv*(v - slide->get_joints()[i]->qd[0]);
22 | std::cout << "x = [ " << slide->get_joints()[i]->q[0] << " , " << slide->get_joints()[i]->qd[0] << " ];" << std::endl;
23 | std::cout << "x* = [ " << p << " , " << v << " ];" << std::endl;
24 | std::cout << "U = [ " << U[0] << " ];" << std::endl;
25 | slide->get_joints()[i]->add_force(U);
26 | }
27 | }
28 |
29 | // ============================================================================
30 | // ================================ CALLBACKS =================================
31 |
32 | /// plugin must be "extern C"
33 | extern "C" {
34 |
35 | void init(void* separator, const std::map& read_map, double time)
36 | {
37 | // If use robot is active also init dynamixel controllers
38 | // get a reference to the TimeSteppingSimulator instance
39 | for (std::map::const_iterator i = read_map.begin();
40 | i !=read_map.end(); i++)
41 | {
42 | // Find the simulator reference
43 | if (!sim)
44 | sim = boost::dynamic_pointer_cast(i->second);
45 |
46 | // find the robot reference
47 | if (!slide)
48 | {
49 | slide = boost::dynamic_pointer_cast(i->second);
50 | }
51 | }
52 |
53 | slide->controller = &controller_callback;
54 |
55 | }
56 | } // end extern C
57 |
--------------------------------------------------------------------------------
/example/passive-walker/walker.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
41 |
42 |
43 |
44 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/example/planar-joint/constrained.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/example/plugin-template.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | * Controller plugin template
3 | ****************************************************************************/
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | using boost::shared_ptr;
15 | using namespace Ravelin;
16 | using namespace Moby;
17 |
18 | // pointers to objects found within the XML file
19 | boost::shared_ptr sim;
20 |
21 | // post-simulation step callback
22 | void post_step_callback(Simulator* s)
23 | {
24 | }
25 |
26 | // control function
27 | void controller(ControlledBodyPtr body, double time, void* controller_data)
28 | {
29 |
30 | }
31 |
32 | /// plugin must be "extern C"
33 | extern "C" {
34 |
35 | // initialization function is called by Moby; setup callbacks here
36 | void init(void* separator, const std::map& read_map, double time)
37 | {
38 | // get a reference to the TimeSteppingSimulator instance
39 | for (std::map::const_iterator i = read_map.begin();
40 | i !=read_map.end(); i++)
41 | {
42 | // Find the simulator reference
43 | if (!sim)
44 | sim = boost::dynamic_pointer_cast(i->second);
45 |
46 | // example of looking for a body and setting up a callback function for it
47 | // if (i->first == "ground")
48 | // {
49 | // ControlledBodyPtr ground = boost::dynamic_pointer_cast(i->second);
50 | // assert(ground);
51 | // ground->controller = &controller;
52 | // }
53 | }
54 |
55 | sim->post_step_callback_fn = &post_step_callback;
56 | }
57 | } // end extern C
58 |
--------------------------------------------------------------------------------
/example/polyhedra/spinning-box-frictional.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/polyhedra/spinning-box-frictionless.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/reduced-coords/double-pendulum.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/example/reduced-coords/pendulum-gears-impact.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/example/reduced-coords/pendulum.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/example/relative-visualization/box-plane.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/example/rimless-wheel/params.h:
--------------------------------------------------------------------------------
1 | #ifndef _RIMLESS_WHEEL_PARAMS_H_
2 | #define _RIMLESS_WHEEL_PARAMS_H_
3 |
4 | const double R = 1.0; // radius from center of mass to end of blade
5 | const double W = 0; // width of a blade
6 | const unsigned N_SPOKES = 6; // number of spokes in the wheel
7 | const bool FIND_MAP = false;
8 |
9 | #endif
10 |
11 |
--------------------------------------------------------------------------------
/example/rolling-torus/torus.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/simple-contact/box-plugin.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | * "Controller" for outputting data from the simple box examples
3 | ****************************************************************************/
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | using boost::shared_ptr;
14 | using namespace Ravelin;
15 | using namespace Moby;
16 |
17 | Moby::RigidBodyPtr box;
18 | boost::shared_ptr sim;
19 | boost::shared_ptr grav;
20 |
21 | // setup simulator callback
22 | void post_step_callback(Simulator* sim)
23 | {
24 | // output the sliding velocity at the contact
25 | std::ofstream out("ke.dat", std::ostream::app);
26 | out << sim->current_time << " " << box->calc_kinetic_energy() << std::endl;
27 | out.close();
28 | }
29 |
30 | /// plugin must be "extern C"
31 | extern "C" {
32 |
33 | void init(void* separator, const std::map& read_map, double time)
34 | {
35 | const unsigned Z = 2;
36 |
37 | // wipe out existing file
38 | std::ofstream out("ke.dat");
39 | out.close();
40 |
41 | // get a reference to the TimeSteppingSimulator instance
42 | for (std::map::const_iterator i = read_map.begin();
43 | i !=read_map.end(); i++)
44 | {
45 | // Find the simulator reference
46 | if (!sim)
47 | sim = boost::dynamic_pointer_cast(i->second);
48 | if (i->first == "box")
49 | box = boost::dynamic_pointer_cast(i->second);
50 | if (!grav)
51 | grav = boost::dynamic_pointer_cast(i->second);
52 | }
53 |
54 | sim->post_step_callback_fn = &post_step_callback;
55 | }
56 | } // end extern C
57 |
--------------------------------------------------------------------------------
/example/simple-contact/cylinder.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/example/simple-contact/ramp.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/example/simple-contact/simplest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/example/simple-contact/spinning-box-frictional.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/simple-contact/spinning-box-frictionless.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/sims-in-code/block.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include "viewer.h"
9 |
10 | int main( void ) {
11 |
12 | boost::shared_ptr sim( new Moby::Simulator() );
13 |
14 | boost::shared_ptr g( new Moby::GravityForce() );
15 | g->gravity = Ravelin::Vector3d( 0, 0, -9.8 );
16 |
17 | Moby::PrimitivePtr box( new Moby::BoxPrimitive(1,1,1) );
18 | box->set_mass( 1000 );
19 |
20 | Moby::RigidBodyPtr rb( new Moby::RigidBody() );
21 | rb->id = "block";
22 | rb->set_visualization_data( box->create_visualization() );
23 | rb->set_inertia( box->get_inertia() );
24 | rb->set_enabled( true );
25 | rb->get_recurrent_forces().push_back( g );
26 |
27 | rb->set_pose( Ravelin::Pose3d( Ravelin::Quatd(0,0,0,1), Ravelin::Origin3d(0,0,0) ) );
28 |
29 | sim->add_dynamic_body( rb );
30 |
31 | Viewer viewer( sim, Ravelin::Origin3d(0,0,4), Ravelin::Origin3d(0,0,0), Ravelin::Origin3d(1,0,0) );
32 |
33 | while(true) {
34 | if( !viewer.update() ) break;
35 |
36 | sim->step( 0.001 );
37 | boost::shared_ptr pose = rb->get_pose();
38 | std::cout << "t: " << sim->current_time << " x: " << pose->x << std::endl;
39 | }
40 |
41 | return 0;
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/example/sims-in-code/viewer.h:
--------------------------------------------------------------------------------
1 | #ifndef _VIEWER_H_
2 | #define _VIEWER_H_
3 |
4 | #include
5 | #include
6 |
7 | #ifdef USE_OSG
8 | #include
9 | #include
10 | #include
11 | #include
12 | #endif
13 |
14 | class Viewer {
15 | public:
16 |
17 | Viewer( boost::shared_ptr sim, Ravelin::Origin3d camera_position, Ravelin::Origin3d camera_viewpoint, Ravelin::Origin3d camera_up ) : _sim(sim) {
18 |
19 | #ifdef USE_OSG
20 | // convert parameters to compatible osg types
21 | osg::Vec3d osg_eye(camera_position[0],camera_position[1],camera_position[2]);
22 | osg::Vec3d osg_center(camera_viewpoint[0], camera_viewpoint[1], camera_viewpoint[2]);
23 | osg::Vec3d osg_up(camera_up[0], camera_up[1], camera_up[2]);
24 |
25 | // initialize viewer
26 | _viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
27 |
28 | // initialize handlers
29 | _viewer.setCameraManipulator(new osgGA::TrackballManipulator());
30 | _viewer.addEventHandler(new osgGA::StateSetManipulator(_viewer.getCamera()->getOrCreateStateSet()));
31 | _viewer.addEventHandler(new osgViewer::WindowSizeHandler);
32 | _viewer.addEventHandler(new osgViewer::StatsHandler);
33 |
34 | // initialize window
35 | _viewer.setUpViewInWindow(0, 0, 1024, 1024);
36 |
37 | // initialize camera
38 | osg::Camera* camera = _viewer.getCamera();
39 | camera->setViewMatrixAsLookAt(osg_eye, osg_center, osg_up);
40 | _viewer.getCameraManipulator()->setHomePosition(osg_eye, osg_center, osg_up);
41 |
42 | // establish the scene data
43 | _root = new osg::Group;
44 | _root->addChild(sim->get_persistent_vdata());
45 | _root->addChild(sim->get_transient_vdata());
46 | _viewer.setSceneData(_root);
47 | _viewer.realize();
48 | #endif // USE_OSG
49 | }
50 |
51 | virtual ~Viewer( void ) {
52 |
53 | }
54 |
55 | bool update( void ) {
56 | _sim->update_visualization();
57 |
58 | #ifdef USE_OSG
59 | if( _viewer.done() ) return false;
60 | _viewer.frame();
61 | #endif // USE_OSG
62 |
63 | return true;
64 | }
65 |
66 | private:
67 | #ifdef USE_OSG
68 | osg::Group* _root; // the osg scene graph root node
69 | osgViewer::Viewer _viewer; // the osg viewer
70 | #endif // USE_OSG
71 |
72 | boost::shared_ptr _sim; // the simulator
73 | };
74 |
75 |
76 | #endif // _VIEWER_H_
77 |
--------------------------------------------------------------------------------
/example/stacks/stack2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/example/tare/pendulum.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/example/ur10/block.obj:
--------------------------------------------------------------------------------
1 | # cube.obj
2 | #
3 |
4 | g cube
5 | v -0.006 -0.0097 -0.012
6 | v -0.006 -0.0097 0.012
7 | v -0.006 0.0097 -0.012
8 | v -0.006 0.0097 0.012
9 | v 0.006 -0.0097 -.012
10 | v 0.006 -0.0097 0.012
11 | v 0.006 0.0097 -.012
12 | v 0.006 0.0097 0.012
13 |
14 | vn 0.0 0.0 1.0
15 | vn 0.0 0.0 -1.0
16 | vn 0.0 1.0 0.0
17 | vn 0.0 -1.0 0.0
18 | vn 1.0 0.0 0.0
19 | vn -1.0 0.0 0.0
20 |
21 | f 1//2 7//2 5//2
22 | f 1//2 3//2 7//2
23 | f 1//6 4//6 3//6
24 | f 1//6 2//6 4//6
25 | f 3//3 8//3 7//3
26 | f 3//3 4//3 8//3
27 | f 5//5 7//5 8//5
28 | f 5//5 8//5 6//5
29 | f 1//4 5//4 6//4
30 | f 1//4 6//4 2//4
31 | f 2//1 6//1 8//1
32 | f 2//1 8//1 4//1
33 |
--------------------------------------------------------------------------------
/example/ur10/meshes/Base.obj.mtl:
--------------------------------------------------------------------------------
1 | # File produced by Open Asset Import Library (http://www.assimp.sf.net)
2 | # (assimp v3.1.187496374)
3 |
4 | newmtl DefaultMaterial
5 | Kd 0.6 0.6 0.6
6 | illum 1
7 |
8 |
--------------------------------------------------------------------------------
/example/ur10/meshes/UpperArm.obj.mtl:
--------------------------------------------------------------------------------
1 | # File produced by Open Asset Import Library (http://www.assimp.sf.net)
2 | # (assimp v3.1.187496374)
3 |
4 | newmtl DefaultMaterial
5 | Kd 0.6 0.6 0.6
6 | illum 1
7 |
8 |
--------------------------------------------------------------------------------
/example/ur10/meshes/schunk_base.obj:
--------------------------------------------------------------------------------
1 | # cube.obj
2 | #
3 |
4 | g cube
5 | v -0.04 -0.035 -0.021
6 | v -0.04 -0.035 0.021
7 | v -0.04 0.035 -0.021
8 | v -0.04 0.035 0.021
9 | v 0.04 -0.035 -0.021
10 | v 0.04 -0.035 0.021
11 | v 0.04 0.035 -0.021
12 | v 0.04 0.035 0.021
13 |
14 | vn 0.0 0.0 1.0
15 | vn 0.0 0.0 -1.0
16 | vn 0.0 1.0 0.0
17 | vn 0.0 -1.0 0.0
18 | vn 1.0 0.0 0.0
19 | vn -1.0 0.0 0.0
20 |
21 | f 1//2 7//2 5//2
22 | f 1//2 3//2 7//2
23 | f 1//6 4//6 3//6
24 | f 1//6 2//6 4//6
25 | f 3//3 8//3 7//3
26 | f 3//3 4//3 8//3
27 | f 5//5 7//5 8//5
28 | f 5//5 8//5 6//5
29 | f 1//4 5//4 6//4
30 | f 1//4 6//4 2//4
31 | f 2//1 6//1 8//1
32 | f 2//1 8//1 4//1
33 |
--------------------------------------------------------------------------------
/example/ur10/meshes/schunk_left_finger.obj:
--------------------------------------------------------------------------------
1 | # cube.obj
2 | #
3 |
4 | g cube
5 | v -0.006 -0.0097 -0.012
6 | v -0.006 -0.0097 0.012
7 | v -0.006 0.0097 -0.012
8 | v -0.006 0.0097 0.012
9 | v 0.006 -0.0097 -.012
10 | v 0.006 -0.0097 0.012
11 | v 0.006 0.0097 -.012
12 | v 0.006 0.0097 0.012
13 |
14 | vn 0.0 0.0 1.0
15 | vn 0.0 0.0 -1.0
16 | vn 0.0 1.0 0.0
17 | vn 0.0 -1.0 0.0
18 | vn 1.0 0.0 0.0
19 | vn -1.0 0.0 0.0
20 |
21 | f 1//2 7//2 5//2
22 | f 1//2 3//2 7//2
23 | f 1//6 4//6 3//6
24 | f 1//6 2//6 4//6
25 | f 3//3 8//3 7//3
26 | f 3//3 4//3 8//3
27 | f 5//5 7//5 8//5
28 | f 5//5 8//5 6//5
29 | f 1//4 5//4 6//4
30 | f 1//4 6//4 2//4
31 | f 2//1 6//1 8//1
32 | f 2//1 8//1 4//1
33 |
--------------------------------------------------------------------------------
/example/ur10/meshes/schunk_right_finger.obj:
--------------------------------------------------------------------------------
1 | # cube.obj
2 | #
3 |
4 | g cube
5 | v -0.006 -0.0097 -0.012
6 | v -0.006 -0.0097 0.012
7 | v -0.006 0.0097 -0.012
8 | v -0.006 0.0097 0.012
9 | v 0.006 -0.0097 -.012
10 | v 0.006 -0.0097 0.012
11 | v 0.006 0.0097 -.012
12 | v 0.006 0.0097 0.012
13 |
14 | vn 0.0 0.0 1.0
15 | vn 0.0 0.0 -1.0
16 | vn 0.0 1.0 0.0
17 | vn 0.0 -1.0 0.0
18 | vn 1.0 0.0 0.0
19 | vn -1.0 0.0 0.0
20 |
21 | f 1//2 7//2 5//2
22 | f 1//2 3//2 7//2
23 | f 1//6 4//6 3//6
24 | f 1//6 2//6 4//6
25 | f 3//3 8//3 7//3
26 | f 3//3 4//3 8//3
27 | f 5//5 7//5 8//5
28 | f 5//5 8//5 6//5
29 | f 1//4 5//4 6//4
30 | f 1//4 6//4 2//4
31 | f 2//1 6//1 8//1
32 | f 2//1 8//1 4//1
33 |
--------------------------------------------------------------------------------
/example/ur10/model.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ur10_schunk_hybrid
5 | 1.0
6 | model.sdf
7 |
8 |
9 | ur10_schunk_hybrid
10 | ur10_schunk_hybrid
11 |
12 |
13 |
14 | The ur10 schunk hybrid model.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/example/ur10/schunk_mpg_80/driver.out-00000000-0.001000.mtl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PositronicsLab/Moby/a025fae7e8123a8bf0f21d78953f83ef3dd9737c/example/ur10/schunk_mpg_80/driver.out-00000000-0.001000.mtl
--------------------------------------------------------------------------------
/example/ur10/schunk_mpg_80/model.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SCHUNK MPG 80
5 | 1.0
6 | model.sdf
7 |
8 |
9 | James Taylor
10 | jrt@gwu.edu
11 |
12 |
13 |
14 | The SCHUNK MPG 80 model
15 |
16 |
17 |
--------------------------------------------------------------------------------
/example/ur10/schunk_mpg_80/schunk.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/example/ur10/ur10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/ur10/ur10/model.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ur10
5 | 1.0
6 | ur10.sdf
7 |
8 |
9 | ur10
10 | ur10
11 |
12 |
13 |
14 | The ur10 model.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/example/urdf/pendulum-urdf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/example/urdf/pendulum.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/include/Moby/AABB.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright 2010 Evan Drumwright
3 | * This library is distributed under the terms of the Apache V2.0
4 | * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5 | ****************************************************************************/
6 |
7 | #ifndef _MOBY_AABB_H_
8 | #define _MOBY_AABB_H_
9 |
10 | #include
11 | #include
12 |
13 | namespace Moby {
14 |
15 | /// An axis-aligned bounding box
16 | class AABB : public BV
17 | {
18 | public:
19 | AABB() {}
20 |
21 | template
22 | AABB(InputIterator begin, InputIterator end);
23 |
24 | virtual void transform(const Ravelin::Transform3d& T, BV* result) const;
25 | virtual bool outside(const Point3d& point, double tol = NEAR_ZERO) const { return AABB::outside(*this, point, tol); }
26 | virtual bool intersects(const LineSeg3& seg, double& tmin, double tmax, Point3d& q) const { return AABB::intersects(*this, seg, tmin, tmax, q); }
27 | virtual std::ostream& to_vrml(std::ostream& out, const Ravelin::Pose3d& T) const;
28 | virtual BVPtr calc_swept_BV(CollisionGeometryPtr g, const Ravelin::SVelocityd& v) const;
29 | virtual double calc_volume() const;
30 | virtual boost::shared_ptr get_relative_pose() const { return minp.pose; }
31 | virtual Point3d get_lower_bounds() const;
32 | virtual Point3d get_upper_bounds() const;
33 | OBB get_OBB() const;
34 | static bool intersects(const AABB& a, const AABB& b);
35 | static bool intersects(const AABB& a, const AABB& b, const Ravelin::Transform3d& aTb);
36 | static bool outside(const AABB& a, const Point3d& point, double tol = NEAR_ZERO);
37 | static bool intersects(const AABB& a, const LineSeg3& seg, double& tmin, double tmax, Point3d& q);
38 | static void get_closest_point(const AABB& a, const Point3d& p, Point3d& closest);
39 | static double get_farthest_point(const AABB& a, const Point3d& p, Point3d& farthest);
40 | AABB& operator=(const AABB& a);
41 |
42 | /// The lower corner of the AABB
43 | Point3d minp;
44 |
45 | /// The upper corner of the AABB;
46 | Point3d maxp;
47 | }; // end class
48 |
49 | #include "AABB.inl"
50 |
51 | } // end namespace
52 |
53 | #endif
54 |
55 |
--------------------------------------------------------------------------------
/include/Moby/AABB.inl:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright 2010 Evan Drumwright
3 | * This library is distributed under the terms of the Apache V2.0
4 | * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5 | ****************************************************************************/
6 |
7 | // For outputting description of AABB (primarily for debugging purposes)
8 | inline std::ostream& operator<<(std::ostream& out, const AABB& a)
9 | {
10 | out << " (address): " << &a << std::endl;
11 | out << " lower corner: " << a.minp << std::endl;
12 | out << " upper corner: " << a.maxp << std::endl;
13 | out << " volume: " << a.calc_volume() << std::endl;
14 | out << " children:";
15 | BOOST_FOREACH(BVPtr child, a.children)
16 | out << " " << child;
17 | out << std::endl;
18 |
19 | return out;
20 | }
21 |
22 | /// Constructs an axis-aligned bounding box using a set of points
23 | /**
24 | * \param begin an iterator to the beginning of a container of type Ravelin::Vector3
25 | * \param end an iterator to the end of a container of type Ravelin::Vector3
26 | */
27 | template
28 | AABB::AABB(InputIterator begin, InputIterator end)
29 | {
30 | const unsigned THREE_D = 3;
31 |
32 | // init the corners of the box
33 | minp = *begin;
34 | begin++;
35 | maxp = minp;
36 |
37 | while (begin != end)
38 | {
39 | for (unsigned i=0; i< THREE_D; i++)
40 | {
41 | if ((*begin)[i] < minp[i])
42 | minp[i] = (*begin)[i];
43 | if ((*begin)[i] > maxp[i])
44 | maxp[i] = (*begin)[i];
45 | }
46 | begin++;
47 | }
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/include/Moby/ArticulatedBody.inl:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright 2011 Evan Drumwright
3 | * This library is distributed under the terms of the Apache V2.0
4 | * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5 | ****************************************************************************/
6 |
7 | /// Gets joint limit constraints
8 | template
9 | OutputIterator ArticulatedBody::find_limit_constraints(OutputIterator output_begin) const
10 | {
11 | for (unsigned i=0; i< _joints.size(); i++)
12 | {
13 | boost::shared_ptr joint = boost::dynamic_pointer_cast(_joints[i]);
14 | for (unsigned j=0; j< joint->num_dof(); j++)
15 | {
16 |
17 | // get the current joint position and velocity
18 | double q = joint->q[j] + joint->_q_tare[j];
19 |
20 | // setup an constraint for this joint/dof in case we need it
21 | UnilateralConstraint e;
22 | e.constraint_type = UnilateralConstraint::eLimit;
23 | e.limit_joint = joint;
24 | e.limit_dof = j;
25 | e.limit_epsilon = joint->limit_restitution;
26 |
27 | // check whether we are already at a limit
28 | if (q >= joint->hilimit[j])
29 | {
30 | // add constraint for upper limit
31 | e.limit_upper = true;
32 | *output_begin++ = e;
33 | }
34 | if (q <= joint->lolimit[j])
35 | {
36 | e.limit_upper = false;
37 | *output_begin++ = e;
38 | }
39 | }
40 | }
41 |
42 | return output_begin;
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/include/Moby/Base.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | * Copyright 2005 Evan Drumwright
3 | * This library is distributed under the terms of the Apache V2.0
4 | * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5 | ****************************************************************************/
6 |
7 | #ifndef _BASE_H
8 | #define _BASE_H
9 |
10 | #include
11 | #include
12 | #include
13 | #include