Skip to content

Commit

Permalink
Fix ikfast implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jul 29, 2020
1 parent 7c9a934 commit e3f6d85
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
30 changes: 15 additions & 15 deletions descartes_ikfast/include/descartes_ikfast/external/ikfast.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ DESCARTES_IGNORE_WARNINGS_POP

#include <descartes_light/visibility_control.h>

#ifndef DESCARTES_IKFAST_HEADER_COMMON
#define DESCARTES_IKFAST_HEADER_COMMON
#ifndef IKFAST_HEADER_COMMON
#define IKFAST_HEADER_COMMON

/// should be the same as ikfast.__version__
#define IKFAST_VERSION 61
Expand Down Expand Up @@ -303,7 +303,7 @@ class IkSolutionList : public IkSolutionListBase<T>
#ifdef _MSC_VER
#define IKFAST_API extern "C" __declspec(dllexport)
#else
#define IKFAST_API extern "C"
#define IKFAST_API extern "C" __attribute__((visibility("default")))
#endif
#else
#define IKFAST_API
Expand Down Expand Up @@ -331,34 +331,34 @@ typedef double IkReal;
- For **TranslationLocalGlobal6D**, the diagonal elements ([0],[4],[8]) are the local translation inside the end
effector coordinate system.
*/
DESCARTES_PUBLIC IKFAST_API bool ComputeIk(const IkReal* eetrans,
const IkReal* eerot,
const IkReal* pfree,
ikfast::IkSolutionListBase<IkReal>& solutions);
IKFAST_API bool ComputeIk(const IkReal* eetrans,
const IkReal* eerot,
const IkReal* pfree,
ikfast::IkSolutionListBase<IkReal>& solutions);

/// \brief Computes the end effector coordinates given the joint values. This function is used to double check ik.
DESCARTES_PUBLIC IKFAST_API void ComputeFk(const IkReal* joints, IkReal* eetrans, IkReal* eerot);
IKFAST_API void ComputeFk(const IkReal* joints, IkReal* eetrans, IkReal* eerot);

/// \brief returns the number of free parameters users has to set apriori
DESCARTES_PUBLIC IKFAST_API int GetNumFreeParameters();
IKFAST_API int GetNumFreeParameters();

/// \brief the indices of the free parameters indexed by the chain joints
DESCARTES_PUBLIC IKFAST_API int* GetFreeParameters();
IKFAST_API int* GetFreeParameters();

/// \brief the total number of indices of the chain
DESCARTES_PUBLIC IKFAST_API int GetNumJoints();
IKFAST_API int GetNumJoints();

/// \brief the size in bytes of the configured number type
DESCARTES_PUBLIC IKFAST_API int GetIkRealSize();
IKFAST_API int GetIkRealSize();

/// \brief the ikfast version used to generate this file
DESCARTES_PUBLIC IKFAST_API const char* GetIkFastVersion();
IKFAST_API const char* GetIkFastVersion();

/// \brief the ik type ID
DESCARTES_PUBLIC IKFAST_API int GetIkType();
IKFAST_API int GetIkType();

/// \brief a hash of all the chain values used for double checking that the correct IK is used.
DESCARTES_PUBLIC IKFAST_API const char* GetKinematicsHash();
IKFAST_API const char* GetKinematicsHash();

#ifdef IKFAST_NAMESPACE
}
Expand Down
2 changes: 0 additions & 2 deletions descartes_ikfast/include/descartes_ikfast/ikfast_kinematics.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class IKFastKinematics : public KinematicsInterface<FloatType>
std::vector<FloatType>& solution_set) const;
};

#include <descartes_ikfast/impl/ikfast_kinematics.hpp>

using IKFastKinematicsD = IKFastKinematics<double>;
using IKFastKinematicsF = IKFastKinematics<float>;

Expand Down
1 change: 1 addition & 0 deletions descartes_ikfast/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ add_library(${PROJECT_NAME}_robot SHARED descartes_ikfast_fanuc_m20ia10l_manipul
target_link_libraries(${PROJECT_NAME}_robot PUBLIC ${PROJECT_NAME})
target_cxx_version(${PROJECT_NAME}_robot PUBLIC VERSION 11)
descartes_target_compile_options(${PROJECT_NAME}_robot PUBLIC)
target_compile_definitions(${PROJECT_NAME}_robot PUBLIC -DIKFAST_NO_MAIN -DIKFAST_CLIBRARY -DIKFAST_HAS_LIBRARY)
if(NOT MSVC)
target_clang_tidy(${PROJECT_NAME}_robot ENABLE ${DESCARTES_ENABLE_TESTING} ARGUMENTS ${CLANG_ARGS})
target_code_coverage(${PROJECT_NAME}_robot ALL ENABLE ${DESCARTES_ENABLE_TESTING})
Expand Down

0 comments on commit e3f6d85

Please sign in to comment.