Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: gather ik failure information in IkReturn #985

Merged
merged 162 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
407225d
added IKFO_FillFailureInformation and IkFailureInfo
Puttichai Apr 27, 2021
9f9e9e4
modified FindIKSolutions (bindings) to consider IKFO_FillFailureInfor…
Puttichai Apr 27, 2021
0632a74
added Append function for IkFailureInfo
Puttichai Apr 28, 2021
9109ef3
added IkFailureAccumulator
Puttichai May 3, 2021
c11518d
updated IkFailureAccumulator; no need to pass paccumulator to functio…
Puttichai May 4, 2021
4d2add5
added python bindings for IkFailureAccumulator; updated py FindIKSolu…
Puttichai May 4, 2021
08401f4
updated python bindings for FindIKSolution/FindIKSolutions
Puttichai May 4, 2021
a725c53
added functions and python bindings to IkFailureInfo
Puttichai May 5, 2021
81893b6
now can store ik failure infos in plannerStatus
Puttichai May 5, 2021
3612560
added _bIkParamValid for cache validation
Puttichai May 6, 2021
a132d77
added IkFailureInfo::Init
Puttichai May 6, 2021
6da33b1
cleaned up
Puttichai May 6, 2021
4b061da
Merge branch 'production' into fill_vikreturns
Puttichai May 6, 2021
d77bd67
added comments
Puttichai May 6, 2021
de03d7a
added PyIkFailureInfo::SerializeJSON
Puttichai May 6, 2021
1b8723f
fixed problem when creating ikFailureInfoPtr
Puttichai May 11, 2021
6611429
fixed creating IkFailureAccumulatorPtr
Puttichai May 11, 2021
9399c91
removed unused ik option
Puttichai May 11, 2021
beb27e7
added SaveToJson for CollisionReport
Puttichai May 12, 2021
bd735df
Merge branch 'production' into fill_vikreturns
Puttichai May 13, 2021
4c0ad75
incremented minor version due to changes in headers
Puttichai May 19, 2021
3a4a290
added SerializeJSON for TriMesh
Puttichai May 21, 2021
112fbf2
Merge branch 'production' into fill_vikreturns
Puttichai Jun 2, 2021
7d2cff2
Merge branch 'production' into fill_vikreturns
Puttichai Jun 11, 2021
de51c7c
Merge branch 'production' into fill_vikreturns
Puttichai Jul 6, 2021
1127efa
Merge branch 'production' into fill_vikreturns
Puttichai Jul 19, 2021
d2248c8
save geom names to json for CollisionReport
Puttichai Jul 27, 2021
ff16238
initialize _action to IKRA_Reject
Puttichai Aug 2, 2021
3bdf3b3
Merge branch 'production' into fill_vikreturns
Puttichai Aug 2, 2021
e0bc246
collect jitterer statistics
Puttichai Aug 6, 2021
1085925
can break from the loop early when failing so don't need to continue …
Puttichai Aug 6, 2021
8e8501c
added functions to retrieve current jitterer parameters
Puttichai Aug 6, 2021
dfbc82e
fixed typos
Puttichai Aug 6, 2021
781cf9a
export full dof values and local tool pose
Puttichai Aug 10, 2021
0675d66
check first if manip is set since it may not be
Puttichai Aug 10, 2021
176851a
allow CollisionReport to store body names since cannot be retrieved o…
Puttichai Aug 11, 2021
eee7e69
Merge branch 'production' into fill_vikreturns
Puttichai Aug 17, 2021
3055bbd
Merge branch 'fill_vikreturns' of https://github.com/rdiankov/openrav…
Puttichai Aug 17, 2021
b1eaef0
store a vector of IkFailureInfoPtr instead for efficiency
Puttichai Aug 17, 2021
3709b11
Merge branch 'fill_vikreturns' of https://github.com/rdiankov/openrav…
Puttichai Aug 17, 2021
af8c4b4
pgeom1 and 2 are not for vLinkColliding
Puttichai Aug 27, 2021
58885d4
added vGeomColliding and vBodyColliding to CollisionReport
Puttichai Aug 27, 2021
04c75a7
fixed problems with dumping collision report json
Puttichai Aug 27, 2021
2fd7fe3
updated __str__ to also print info from vGeomColliding and vBodyColli…
Puttichai Aug 27, 2021
6dd67b8
updated DumpTree commands
Puttichai Aug 31, 2021
ab8f221
Merge branch 'production' into fill_vikreturns
Puttichai Sep 15, 2021
1afab2c
Merge branch 'production' into fill_vikreturns
Puttichai Sep 24, 2021
f4d25d4
Merge branch 'production' of https://github.com/rdiankov/openrave int…
yoshikikanemoto Oct 2, 2021
bd8c526
Merge branch 'production' of https://github.com/rdiankov/openrave int…
yoshikikanemoto Oct 8, 2021
5b74bde
Merge branch 'production' into fill_vikreturns
Puttichai Oct 15, 2021
045dc8a
Merge branch 'production' of github.com:rdiankov/openrave into fill_v…
yoshikikanemoto Oct 25, 2021
205d991
Merge branch 'production' into fill_vikreturns
Puttichai Oct 27, 2021
0a24118
Merge branch 'production' of https://github.com/rdiankov/openrave int…
yoshikikanemoto Nov 4, 2021
01a262c
Merge branch 'production' into fill_vikreturns
Puttichai Nov 10, 2021
ad83e0a
avoid using duplicate variable names
Puttichai Nov 10, 2021
6295e4b
Merge branch 'production' into fill_vikreturns
Puttichai Nov 24, 2021
537ffde
Merge branch 'production' into fill_vikreturns
Puttichai Dec 7, 2021
7ec7107
Merge branch 'production' into fill_vikreturns
Puttichai Dec 10, 2021
0fb8932
Merge branch 'production' into fill_vikreturns
Puttichai Dec 23, 2021
93e8d58
Merge branch 'production' into fill_vikreturns
Puttichai Jan 21, 2022
97cd7dd
Merge branch 'production' into fill_vikreturns
Puttichai Feb 4, 2022
76b1607
Merge branch 'production' into fill_vikreturns
Puttichai Feb 9, 2022
99545b5
Merge branch 'production' into fill_vikreturns
Puttichai Feb 22, 2022
827e67e
Merge branch 'production' into fill_vikreturns
Puttichai Mar 4, 2022
71b601a
Merge branch 'production' into fill_vikreturns
Puttichai Mar 8, 2022
99f1a07
Merge branch 'production' into fill_vikreturns
Puttichai Mar 18, 2022
8293f47
Merge branch 'production' into fill_vikreturns
Puttichai Mar 24, 2022
308f6d8
Merge branch 'production' into fill_vikreturns
Puttichai Mar 31, 2022
74c4278
Merge branch 'production' into fill_vikreturns
Puttichai Apr 12, 2022
33edfc7
can still save bodyname if it is available even though linkptr is not…
Puttichai Apr 13, 2022
aeab0f1
Merge branch 'production' into fill_vikreturns
Puttichai Apr 19, 2022
ead7fdb
fixed include
Puttichai Apr 19, 2022
6d77c27
moved PySpaceSamplerBase class def into a header file
Puttichai Apr 19, 2022
d85ab25
added missing OPENRAVEPY_API
Puttichai Apr 20, 2022
006ab76
applied correct scaling when deserializing readable interfaces
Puttichai Apr 20, 2022
2c504cf
Merge branch 'production' into fill_vikreturns
Puttichai Apr 26, 2022
6a0b643
Merge branch 'production' into fill_vikreturns
Puttichai Apr 27, 2022
4494416
Merge branch 'production' into fill_vikreturns
Puttichai May 5, 2022
92b2716
Merge branch 'production' of github.com:rdiankov/openrave into fill_v…
May 10, 2022
93f999a
Merge branch 'production' of github.com:rdiankov/openrave into fill_v…
May 10, 2022
e8cecac
Merge branch 'production' into fill_vikreturns
Puttichai May 19, 2022
fac663c
Merge branch 'production' into fill_vikreturns
Puttichai May 30, 2022
92d03a5
Merge branch 'production' into fill_vikreturns
Puttichai Jun 7, 2022
d0f7710
Merge branch 'production' of https://github.com/rdiankov/openrave int…
Jun 20, 2022
1c3348c
fix bad merge
Jun 21, 2022
8ea5b70
Merge branch 'production' of github.com:rdiankov/openrave into fill_v…
Jun 27, 2022
eebf995
todo comment for the case of pgeom in collision report being nullptr
Jun 27, 2022
0de8adc
Merge branch 'production' of https://github.com/rdiankov/openrave int…
Jun 28, 2022
ae6db51
Merge branch 'fill_vikreturns' of github.com:rdiankov/openrave into f…
Jun 28, 2022
c263520
Merge branch 'production' into fill_vikreturns
Puttichai Jul 8, 2022
10107f6
fix missing return causing random segfault
Jul 19, 2022
5d9e327
Merge branch 'production' of https://github.com/rdiankov/openrave int…
yoshikikanemoto Aug 8, 2022
c16a207
Merge branch 'production' into fill_vikreturns
Puttichai Sep 2, 2022
8e4e40e
Merge branch 'production' into fill_vikreturns
Puttichai Apr 12, 2023
641e287
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai May 2, 2023
24ae3fd
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai May 9, 2023
602a181
fixed undefined symbol
Puttichai May 17, 2023
2e89284
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai May 18, 2023
8dfc833
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 2, 2023
634d27a
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 2, 2023
fe86e6d
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 7, 2023
f4e2efe
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 8, 2023
0d24f03
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 9, 2023
9bfd179
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 13, 2023
5fbcf6e
Merge branch 'production' into fill_vikreturns
Puttichai Jun 14, 2023
a327436
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 16, 2023
051976c
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 19, 2023
b169f74
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 20, 2023
fc9765c
store CollisionReportInfo instead of CollisionReport in IkFailureInfo
Puttichai Jun 20, 2023
3d6afa9
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 20, 2023
f49ca3b
Merge branch 'production' into fill_vikreturns
Puttichai Jun 22, 2023
3f3b174
added __str__ for PyCollisionReportInfo
Puttichai Jun 22, 2023
fd296c6
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 26, 2023
6b047de
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jun 28, 2023
f2ca71a
added save/load json value for RaveAxisAlignedBox
Puttichai Jun 30, 2023
32772d1
Merge branch 'production' of github.com:rdiankov/openrave into fill_v…
Jul 1, 2023
8b7cfae
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 3, 2023
94595cf
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 4, 2023
81d846e
Merge branch 'production' of https://github.com/rdiankov/openrave int…
Jul 5, 2023
be3f440
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 6, 2023
d0b8b29
make IkFailureInfo JsonSerializable for testability
Jul 6, 2023
85b0085
Merge branch 'fill_vikreturns' of github.com:rdiankov/openrave into f…
Jul 6, 2023
0a756ad
Merge branch 'fix_openravejson_20230706' of github.com:rdiankov/openr…
Jul 6, 2023
cec0b96
Merge branch 'production' into fill_vikreturns
Puttichai Jul 6, 2023
9480b99
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 7, 2023
734ec0a
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 10, 2023
6b066c7
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 12, 2023
b5f1b8a
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 14, 2023
49704b6
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Jul 19, 2023
5068129
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Aug 4, 2023
e841008
Fixes problem when parsing a very big number
Puttichai Aug 4, 2023
7c70c28
Do not print log here since we never manage _vecbodies when erasing s…
Puttichai Aug 7, 2023
9ea393e
Disables noisy message
Puttichai Aug 7, 2023
28eb53c
Checks with the correct condition before printing warning
Puttichai Aug 7, 2023
59f98ed
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Aug 8, 2023
3efe024
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Aug 17, 2023
bd27081
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Aug 21, 2023
ecefe14
Merge branch 'production' of https://github.com/rdiankov/openrave int…
yoshikikanemoto Sep 6, 2023
9ff367c
Merge branch 'production' of https://github.com/rdiankov/openrave int…
yoshikikanemoto Sep 8, 2023
4c83e51
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Sep 14, 2023
844504f
Merge remote-tracking branch 'origin/production' into fill_vikreturns
Puttichai Sep 27, 2023
a2a3741
Merge branch 'production' into fill_vikreturns
Oct 6, 2023
4052ec8
major clean ups for CollisionReport, making it more memory friendly
Oct 7, 2023
34a7cf7
Merge branch 'production' into fill_vikreturns
Oct 7, 2023
9c31175
restructure CollisionReport to be more memory friendly
Oct 8, 2023
9f36bc6
Merge branch 'production' of github.com:rdiankov/openrave into fill_v…
Oct 9, 2023
d42e626
clean up storing the robot in the cache tree
Oct 9, 2023
22f9258
Merge branch 'fill_vikreturns' of ssh://github.com/rdiankov/openrave …
Oct 9, 2023
a3e0b9d
check for targetbody
Oct 9, 2023
0e650f2
fix GetIkFailureInfo
Oct 11, 2023
65a82f8
Merge branch 'production' into fill_vikreturns
Oct 12, 2023
8e91243
make IkFailureAccumulator abstract
Oct 12, 2023
ee6df1b
Merge branch 'production' into fill_vikreturns
Oct 17, 2023
60c9232
Merge branch 'production' into fill_vikreturns
Oct 21, 2023
8782a88
Merge branch 'production' into fill_vikreturns
Nov 6, 2023
3a6dd58
Merge branch 'production' into fill_vikreturns
Feb 20, 2024
09d6870
remove const
Feb 21, 2024
dea677e
Merge branch 'fill_vikreturns' into fill_vikreturns2
Feb 21, 2024
627f65f
cleanup ik failure info usage
Feb 25, 2024
7e9535c
add SetIkFailureAccumulator to allow IkFailureAccumulatorBasePtr to b…
Feb 26, 2024
c4246f6
update minor due to virtual function change
Feb 26, 2024
0594c63
Merge branch 'production' of ssh://github.com/rdiankov/openrave into …
Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/openrave/collisionchecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class OPENRAVE_API CollisionReport
Vector pos; ///< where the contact occured
Vector norm; ///< the normals of the faces
dReal depth; ///< the penetration depth, positive means the surfaces are penetrating, negative means the surfaces are not colliding (used for distance queries)

void SaveToJson(rapidjson::Value& rContact, rapidjson::Document::AllocatorType& alloc) const;
};

CollisionReport() {
Expand All @@ -79,9 +81,15 @@ class OPENRAVE_API CollisionReport
virtual void Reset(int coloptions = 0);
virtual std::string __str__() const;

virtual void FillBodyNames();

void SaveToJson(rapidjson::Value& rCollisionReport, rapidjson::Document::AllocatorType& alloc) const;

KinBody::LinkConstPtr plink1, plink2; ///< the colliding links if a collision involves a bodies. Collisions do not always occur with 2 bodies like ray collisions, so these fields can be empty.

std::vector<std::pair<KinBody::LinkConstPtr, KinBody::LinkConstPtr> > vLinkColliding; ///< all link collision pairs. Set when CO_AllCollisions is enabled.
std::vector<std::pair<KinBody::GeometryConstPtr, KinBody::GeometryConstPtr> > vGeomColliding; ///< all colliding geometry pairs. Each pair corresponds to a colliding link pair in vLinkColliding so vGeomColliding.size() == vLinkColliding.size() should always evaluate to true. Set when CO_AllCollisions is enabled.
std::vector<std::pair<std::string, std::string> > vBodyColliding; ///< vBodyColliding[index] is a pair of kinbody names to which the links in vLinkColliding[index] belong. Not automatically generated. Can be initialized by CollisionReport::FillBodyNames.

KinBody::GeometryConstPtr pgeom1, pgeom2; ///< the specified geometries hit for the given links

Expand All @@ -94,6 +102,7 @@ class OPENRAVE_API CollisionReport

uint8_t nKeepPrevious; ///< if 1, will keep all previous data when resetting the collision checker. otherwise will reset

std::string bodyName1, bodyName2; /// the names of the bodies plink1 and plink2 belong to. Directly store the names here since if the parent has been destroyed, the parent's name cannot be obtained from plink.
};

typedef CollisionReport COLLISIONREPORT RAVE_DEPRECATED;
Expand Down
106 changes: 101 additions & 5 deletions include/openrave/iksolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ enum IkFilterOptions
IKFO_IgnoreEndEffectorCollisions=0x10, ///< \see IKFO_IgnoreEndEffectorEnvCollisions
IKFO_IgnoreEndEffectorEnvCollisions=0x10, ///< will not check collision with the environment and the end effector links and bodies attached to the end effector links. The end effector links are defined by \ref RobotBase::Manipulator::GetChildLinks. Use this option when \ref RobotBase::Manipulator::CheckEndEffectorCollision has already been called, or it is ok for the end effector to collide given the IK constraints. Self-collisions between the moving links and end effector are still checked.
IKFO_IgnoreEndEffectorSelfCollisions=0x20, ///< will not check self-collisions with the end effector. The end effector links are defined by \ref RobotBase::Manipulator::GetChildLinks. Use this option if it is ok for the end effector to collide given the IK constraints. Collisions between the moving links and end effector are still checked.
//IKFO_FillCollisionReports=0x1000, ///< if set, will fill the collision reports of the IkReturn structure (TODO)
};

/// \brief Return value for the ik filter that can be optionally set on an ik solver.
Expand Down Expand Up @@ -70,6 +69,100 @@ static const IkReturnAction IKFR_Reject RAVE_DEPRECATED = IKRA_Reject;
static const IkReturnAction IKFR_Quit RAVE_DEPRECATED = IKRA_Quit;
typedef IkReturnAction IkFilterReturn RAVE_DEPRECATED;

class OPENRAVE_API IkFailureInfo
{
public:
IkFailureInfo()
{
}

inline void Init(const IkFailureInfo& ikFailureInfo)
{
_action = ikFailureInfo._action;
_vconfig = ikFailureInfo._vconfig;
_description = ikFailureInfo._description;
_mapdata = ikFailureInfo._mapdata;
InitCollisionReport(ikFailureInfo._preport);
if( ikFailureInfo.HasValidIkParam() ) {
SetIkParam(ikFailureInfo.GetIkParam());
}
else {
_bIkParamValid = false;
}
}

/// \brief clears the data. _action is left unchanged.
void Clear();

/// \brief initializes _preport according to the passed in report.
void InitCollisionReport(const CollisionReportPtr& preport);

void SetDescription(const std::string& description);

void SaveToJson(rapidjson::Value& rIkFailureInfo, rapidjson::Document::AllocatorType& alloc) const;

inline void SetIkParam(const IkParameterization& ikparam) {
if( ikparam.GetType() != IKP_None ) {
_ikparam = ikparam;
_bIkParamValid = true;
}
else {
_bIkParamValid = false;
}
}
inline bool HasValidIkParam() const {
return _bIkParamValid;
}
inline const IkParameterization& GetIkParam() const {
return _ikparam;
}

int GetIndex() const {
return _index;
}

typedef std::map<std::string, std::vector<dReal> > CustomData;
IkReturnAction _action = IKRA_Reject; ///< the IkReturnAction corresponding to this failure
std::vector< dReal > _vconfig; ///< the robot configuration that does not pass the checks.
CollisionReportPtr _preport; ///< the collision report from when some collision checking fails.
std::string _description; ///< a string describing the failure
CustomData _mapdata; ///< stored additional information that does not fit elsewhere
int _index; // for debugging

private:
IkParameterization _ikparam; ///< the ikparam that fails (could be different from the ikparam given to FindIKSolutions call).
bool _bIkParamValid=false; ///< a flag determining whether _ikparam is valid.
};

class OPENRAVE_API IkFailureAccumulator
{
public:
IkFailureAccumulator();

inline const size_t GetCurrentSize() const
{
return _nextIndex;
}

inline void ResetIndex(const size_t nextIndex=0)
{
_nextIndex = nextIndex;
}

/// \brief Retrieve ikFailureInfo from the specified index. Assume the input index is valid.
inline const IkFailureInfo& GetIkFailureInfo(size_t index) const
{
return *_vIkFailureInfos[index];
}

/// \brief Get the next available IkFailureInfo to fill in failure information.
IkFailureInfoPtr GetNextAvailableIkFailureInfoPtr();

private:
std::vector<IkFailureInfoPtr> _vIkFailureInfos;
size_t _nextIndex = 0;
};

class OPENRAVE_API IkReturn
{
public:
Expand All @@ -86,12 +179,10 @@ class OPENRAVE_API IkReturn
/// \brief appends the data of one IkReturn to this structure
///
/// _action is untouched, _vsolution is overridden if non-empty
/// \return If data clashes, will output text and return false
/// \return true if data clashes. Also outputs text in such cases.
bool Append(const IkReturn& r);

/// \brief clears the data, leaves the _action unchanged
///
/// if _preport is set, will call Reset on it.
void Clear();

typedef std::map<std::string, std::vector<dReal> > CustomData;
Expand All @@ -100,6 +191,7 @@ class OPENRAVE_API IkReturn
CustomData _mapdata; ///< name/value pairs for custom data computed in the filters. Cascading filters using the same name will overwrite this until the last executed filter (with lowest priority).
UserDataPtr _userdata; ///< if the name/value pairs are not enough, can further use a pointer to custom data. Cascading filters with valid _userdata pointers will overwrite this until the last executed filter (with lowest priority).
//std::vector<CollisionReport> _reports; ///< all the reports that are written with the collision information if ik failed due to collisions. Only valid if _action has IKRA_RejectSelfCollision or IKRA_RejectEnvCollision set. (TODO)
std::vector<IkFailureInfoPtr> _vIkFailureInfos;
};

/** \brief <b>[interface]</b> Base class for all Inverse Kinematic solvers. <b>If not specified, method is not multi-thread safe.</b> See \ref arch_iksolver.
Expand Down Expand Up @@ -207,6 +299,7 @@ class OPENRAVE_API IkSolverBase : public InterfaceBase
\return true if solution is found
*/
virtual bool Solve(const IkParameterization& param, const std::vector<dReal>& q0, int filteroptions, IkReturnPtr ikreturn);
virtual bool Solve(const IkParameterization& param, const std::vector<dReal>& q0, int filteroptions, IkFailureAccumulatorPtr paccumulator, IkReturnPtr ikreturn);

/** \brief Return all joint configurations for the given end effector transform.

Expand All @@ -230,6 +323,7 @@ class OPENRAVE_API IkSolverBase : public InterfaceBase
\return true if at least one solution is found
*/
virtual bool SolveAll(const IkParameterization& param, int filteroptions, std::vector<IkReturnPtr>& ikreturns);
virtual bool SolveAll(const IkParameterization& param, int filteroptions, IkFailureAccumulatorPtr paccumulator, std::vector<IkReturnPtr>& ikreturns);

/** Return a joint configuration for the given end effector transform.

Expand All @@ -254,6 +348,7 @@ class OPENRAVE_API IkSolverBase : public InterfaceBase
\return true if solution is found
*/
virtual bool Solve(const IkParameterization& param, const std::vector<dReal>& q0, const std::vector<dReal>& vFreeParameters, int filteroptions, IkReturnPtr ikreturn);
virtual bool Solve(const IkParameterization& param, const std::vector<dReal>& q0, const std::vector<dReal>& vFreeParameters, int filteroptions, IkFailureAccumulatorPtr paccumulator, IkReturnPtr ikreturn);

/** \brief Return all joint configurations for the given end effector transform.

Expand Down Expand Up @@ -281,6 +376,7 @@ class OPENRAVE_API IkSolverBase : public InterfaceBase
\return true at least one solution is found
*/
virtual bool SolveAll(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, int filteroptions, std::vector<IkReturnPtr>& ikreturns);
virtual bool SolveAll(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, int filteroptions, IkFailureAccumulatorPtr paccumulator, std::vector<IkReturnPtr>& ikreturns);

/// \brief returns true if the solver supports a particular ik parameterization as input.
virtual bool Supports(IkParameterizationType iktype) const OPENRAVE_DUMMY_IMPLEMENTATION;
Expand All @@ -301,7 +397,7 @@ class OPENRAVE_API IkSolverBase : public InterfaceBase

/// \brief returns the kinematics structure hash this ik solver is encoded to. Checked with \ref RobotBase::Manipulator::GetKinematicsStructureHash()
virtual const std::string& GetKinematicsStructureHash() const OPENRAVE_DUMMY_IMPLEMENTATION;

protected:
inline IkSolverBasePtr shared_iksolver() {
return boost::static_pointer_cast<IkSolverBase>(shared_from_this());
Expand Down
6 changes: 6 additions & 0 deletions include/openrave/openrave.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class SpaceSamplerBase;
class IkParameterization;
class ConfigurationSpecification;
class IkReturn;
class IkFailureInfo;
class IkFailureAccumulator;
class Readable;

typedef boost::shared_ptr<CollisionReport> CollisionReportPtr;
Expand Down Expand Up @@ -298,6 +300,8 @@ typedef boost::weak_ptr<Readable> ReadableWeakPtr;
typedef boost::shared_ptr<IkReturn> IkReturnPtr;
typedef boost::shared_ptr<IkReturn const> IkReturnConstPtr;
typedef boost::weak_ptr<IkReturn> IkReturnWeakPtr;
typedef boost::shared_ptr<IkFailureInfo> IkFailureInfoPtr;
typedef boost::shared_ptr<IkFailureAccumulator> IkFailureAccumulatorPtr;

class BaseXMLReader;
typedef boost::shared_ptr<BaseXMLReader> BaseXMLReaderPtr;
Expand Down Expand Up @@ -2386,6 +2390,8 @@ class OPENRAVE_API TriMesh
AABB ComputeAABB() const;
void serialize(std::ostream& o, int options=0) const;

void SerializeJSON(rapidjson::Value& rTriMesh, rapidjson::Document::AllocatorType& allocator, dReal fUnitScale, int options=0) const;

friend OPENRAVE_API std::ostream& operator<<(std::ostream& O, const TriMesh &trimesh);
friend OPENRAVE_API std::istream& operator>>(std::istream& I, TriMesh& trimesh);

Expand Down
5 changes: 4 additions & 1 deletion include/openrave/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class OPENRAVE_API PlannerParameters : public BaseXMLReader, public Readable
{
return false;
}

/// \brief output the planner parameters in a string (in XML format)
///
/// \param options if 1 will skip writing the extra parameters
Expand Down Expand Up @@ -523,6 +523,8 @@ class OPENRAVE_API PlannerStatus
PlannerStatus(const std::string& description, const uint32_t statusCode, CollisionReportPtr& report);
PlannerStatus(const std::string& description, const uint32_t statusCode, const IkParameterization& ikparam);
PlannerStatus(const std::string& description, const uint32_t statusCode, const IkParameterization& ikparam, CollisionReportPtr& report);
PlannerStatus(const std::string& description, const uint32_t statusCode, const IkParameterization& ikparam, const std::vector<IkFailureInfoPtr>& vIkFailureInfos);
PlannerStatus(const std::string& description, const uint32_t statusCode, const std::vector<IkFailureInfoPtr>& vIkFailureInfos);
PlannerStatus(const std::string& description, const uint32_t statusCode, const std::vector<dReal>& jointValues);
PlannerStatus(const std::string& description, const uint32_t statusCode, const std::vector<dReal>& jointValues, CollisionReportPtr& report);

Expand Down Expand Up @@ -551,6 +553,7 @@ class OPENRAVE_API PlannerStatus
std::vector<dReal> jointValues; // Optional, the robot's joint values in rad or m
CollisionReportPtr report; ///< Optional, collision report at the time of the error. Ideally should contents contacts information.
std::string errorOrigin; // Auto, a string representing the code path of the error.
std::vector<IkFailureInfoPtr> vIkFailureInfos; ///< Optional, ikFailureInfos collected from the run.

std::map< std::pair<KinBody::LinkConstPtr,KinBody::LinkConstPtr>, unsigned int > mCollidingLinksCount; // Counter for colliding links
uint32_t numPlannerIterations; ///< number of planner iterations before failure
Expand Down
10 changes: 6 additions & 4 deletions include/openrave/robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,22 @@ class OPENRAVE_API RobotBase : public KinBody
/// \param param The transformation of the end-effector in the global coord system
/// \param solution Will be of size GetArmIndices().size() and contain the best solution
/// \param[in] filteroptions A bitmask of \ref IkFilterOptions values controlling what is checked for each ik solution.
/// \return true if there is a valid ik solution.
bool FindIKSolution(const IkParameterization& param, std::vector<dReal>& solution, int filteroptions) const;
bool FindIKSolution(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, std::vector<dReal>& solution, int filteroptions) const;
bool FindIKSolution(const IkParameterization& param, int filteroptions, IkReturnPtr ikreturn) const;
bool FindIKSolution(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, int filteroptions, IkReturnPtr ikreturn) const;
bool FindIKSolution(const IkParameterization& param, int filteroptions, IkReturnPtr ikreturn, IkFailureAccumulatorPtr paccumulator = nullptr) const;
bool FindIKSolution(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, int filteroptions, IkReturnPtr ikreturn, IkFailureAccumulatorPtr paccumulator = nullptr) const;

/// \brief Find all the IK solutions for the given end effector transform
///
/// \param param The transformation of the end-effector in the global coord system
/// \param solutions An array of all solutions, each element in solutions is of size GetArmIndices().size()
/// \param[in] filteroptions A bitmask of \ref IkFilterOptions values controlling what is checked for each ik solution.
/// \return true if there is at least one valid ik solution.
bool FindIKSolutions(const IkParameterization& param, std::vector<std::vector<dReal> >& solutions, int filteroptions) const;
bool FindIKSolutions(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, std::vector<std::vector<dReal> >& solutions, int filteroptions) const;
bool FindIKSolutions(const IkParameterization& param, int filteroptions, std::vector<IkReturnPtr>& vikreturns) const;
bool FindIKSolutions(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, int filteroptions, std::vector<IkReturnPtr>& vikreturns) const;
bool FindIKSolutions(const IkParameterization& param, int filteroptions, std::vector<IkReturnPtr>& vikreturns, IkFailureAccumulatorPtr paccumulator = nullptr) const;
bool FindIKSolutions(const IkParameterization& param, const std::vector<dReal>& vFreeParameters, int filteroptions, std::vector<IkReturnPtr>& vikreturns, IkFailureAccumulatorPtr paccumulator = nullptr) const;

/** \brief returns the parameterization of a given IK type for the current manipulator position.

Expand Down
Loading