Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
svwilliams committed Apr 17, 2019
1 parent cc91396 commit 46e8c98
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
3 changes: 0 additions & 3 deletions fuse_core/CMakeLists.txt
Expand Up @@ -198,12 +198,9 @@ if(CATKIN_ENABLE_TESTING)
target_include_directories(test_local_parameterization
PRIVATE
include
${CERES_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(test_local_parameterization
${PROJECT_NAME}
${CERES_LIBRARIES}
)

# Message Buffer Tests
Expand Down
21 changes: 5 additions & 16 deletions fuse_core/include/fuse_core/autodiff_local_parameterization.h
Expand Up @@ -55,7 +55,9 @@ namespace fuse_core
*
* And the second functor should compute the inverse operation:
*
* Minus(x1, x2) -> delta, such that Minus(x, Plus(x, delta)) = delta
* Minus(x1, x2) -> delta
*
* Minus() should be defined such that if Plus(x1, delta) -> x2, then Minus(x1, x2) -> delta
*
* The autodiff framework substitutes appropriate "Jet" objects for the template parameter T in order to compute
* the derivative when necessary, but this is hidden, and you should write the function as if T were a scalar type
Expand Down Expand Up @@ -173,17 +175,8 @@ bool AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLoca
const double* x,
double* jacobian) const
{
double zero_delta[kLocalSize];
for (int i = 0; i < kLocalSize; ++i)
{
zero_delta[i] = 0.0;
}

double zero_delta[kLocalSize] = {}; // zero-initialize
double x_plus_delta[kGlobalSize];
for (int i = 0; i < kGlobalSize; ++i)
{
x_plus_delta[i] = 0.0;
}

const double* parameter_ptrs[2] = {x, zero_delta};
double* jacobian_ptrs[2] = { NULL, jacobian };
Expand All @@ -205,11 +198,7 @@ bool AutoDiffLocalParameterization<PlusFunctor, MinusFunctor, kGlobalSize, kLoca
const double* x,
double* jacobian) const
{
double delta[kLocalSize];
for (int i = 0; i < kLocalSize; ++i)
{
delta[i] = 0.0;
}
double delta[kLocalSize] = {}; // zero-initialize

const double* parameter_ptrs[2] = {x, x};
double* jacobian_ptrs[2] = { NULL, jacobian };
Expand Down
6 changes: 3 additions & 3 deletions fuse_core/include/fuse_core/local_parameterization.h
Expand Up @@ -56,11 +56,11 @@ class LocalParameterization : public ceres::LocalParameterization
/**
* @brief Generalization of the subtraction operation
*
* delta = Minus(x1, x2)
* Minus(x1, x2) -> delta
*
* with the conditions that:
* Minus(x, x) = 0
* Minus(x, Plus(x, delta)) = delta
* - Minus(x, x) -> 0
* - if Plus(x1, delta) -> x2, then Minus(x1, x2) -> delta
*
* @param[in] x1 The value of the first variable, of size \p GlobalSize()
* @param[in] x2 The value of the second variable, of size \p GlobalSize()
Expand Down

0 comments on commit 46e8c98

Please sign in to comment.