Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[submodule "wrap"]

15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,20 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
# Process source subdirs
add_subdirectory(gpmp2)

# Find current wrap repository
find_package(gtwrap)

#if(NOT GPMP2_TOOLBOX_INSTALL_PATH)
#set(GPMP2_TOOLBOX_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/gpmp2_toolbox")
#sendif()
#set(GPMP2_TOOLBOX_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/gpmp2_toolbox")
#set(WRAP_TOOLBOX_INSTALL_PATH "${GTSAM_TOOLBOX_INSTALL_PATH}")

# Wrapping to MATLAB
if(GPMP2_BUILD_MATLAB_TOOLBOX)
# wrap
include(GtsamMatlabWrap)
wrap_and_install_library(gpmp2.h ${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}" "")

include(MatlabWrap)
matlab_wrap(gpmp2.h ${PROJECT_NAME} "gtsam;${PROJECT_NAME}" "" "" "")

# install matlab functions and scripts
add_subdirectory(matlab)
Expand Down
38 changes: 2 additions & 36 deletions gpmp2.h
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
// gpmp2 matlab wrapper declarations

/* * Forward declarations and class definitions for Cython:
* - Need to specify the base class (both this forward class and base
class are declared in an external cython header)
* This is so Cython can generate proper inheritance.
* Example when wrapping a gtsam-based project:
* // forward declarations
* virtual class gtsam::NonlinearFactor
* virtual class gtsam::NoiseModelFactor : gtsam::NonlinearFactor
* // class definition
* #include <MyFactor.h>
* virtual class MyFactor : gtsam::NoiseModelFactor {...};
* - *DO NOT* re-define overriden function already declared in the external (forward-declared) base class
* - This will cause an ambiguity problem in Cython pxd header file*/

// gtsam deceleration
class gtsam::Vector6;
class gtsam::Vector3;
class gtsam::Point3;
class gtsam::Pose3;
class gtsam::Point2;
class gtsam::Pose2;
//class gtsam::Vector;

class gtsam::GaussianFactorGraph;
class gtsam::Values;
virtual class gtsam::noiseModel::Base;
virtual class gtsam::NonlinearFactor;
virtual class gtsam::NonlinearFactorGraph;
virtual class gtsam::NoiseModelFactor : gtsam::NonlinearFactor;
//virtual class gtsam::NoiseModelFactor;
virtual class gtsam::NoiseModelFactor;

namespace gpmp2 {

Expand All @@ -56,21 +40,11 @@ class Pose2Vector {
////////////////////////////////////////////////////////////////////////////////

// prior factor

//template<class VALUE1, class VALUE2, class VALUE3, class VALUE4>
//template<Vector, Vector, Vector, Vector>
//virtual class gtsam::NoiseModelFactor4: gtsam::NoiseModelFactor;

#include <gpmp2/gp/GaussianProcessPriorLinear.h>
//template<gtsam::Vector, gtsam::Vector, gtsam::Vector, gtsam::Vector>

virtual class GaussianProcessPriorLinear : gtsam::NoiseModelFactor {
GaussianProcessPriorLinear(size_t key1, size_t key2, size_t key3, size_t key4,
double delta, const gtsam::noiseModel::Base* Qc_model);
//Vector evaluateError(Vector pose) const;
Vector evaluateError(const Vector& pose1, const Vector& vel1,
const Vector& pose2, const Vector& vel2);
// enabling serialization functionality
void serialize() const;
};

#include <gpmp2/gp/GaussianProcessPriorPose2.h>
Expand Down Expand Up @@ -495,7 +469,6 @@ virtual class ObstaclePlanarSDFFactorArm : gtsam::NoiseModelFactor {
size_t posekey, const gpmp2::ArmModel& arm,
const gpmp2::PlanarSDF& sdf, double cost_sigma, double epsilon);
Vector evaluateError(Vector pose) const;
void serialize() const;
};


Expand Down Expand Up @@ -684,13 +657,6 @@ virtual class ObstacleSDFFactorGPPose2MobileVetLin2Arms : gtsam::NoiseModelFacto
double delta_t, double tau);
};

// self collision Arm
#include <gpmp2/obstacle/SelfCollisionArm.h>
virtual class SelfCollisionArm : gtsam::NoiseModelFactor {
SelfCollisionArm(size_t poseKey, const gpmp2::ArmModel& arm, Matrix data);
Vector evaluateError(Vector pose) const;
};

////////////////////////////////////////////////////////////////////////////////
// planner
////////////////////////////////////////////////////////////////////////////////
Expand Down
16 changes: 16 additions & 0 deletions gpmp2/CMakeFiles/CMakeDirectoryInformation.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16

# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/matt/Documents/gpmp2")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/matt/Documents/gpmp2")

# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)


# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
Loading