Commit 9aaac1c1 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Add operator== for requests + bind StdVec of requests.

parent 58c08c80
...@@ -157,6 +157,14 @@ struct HPP_FCL_DLLAPI QueryRequest ...@@ -157,6 +157,14 @@ struct HPP_FCL_DLLAPI QueryRequest
{} {}
void updateGuess(const QueryResult& result); void updateGuess(const QueryResult& result);
/// @brief whether two QueryRequest are the same or not
inline bool operator ==(const QueryRequest& other) const
{
return enable_cached_gjk_guess == other.enable_cached_gjk_guess
&& cached_gjk_guess == other.cached_gjk_guess
&& cached_support_func_guess == other.cached_support_func_guess;
}
}; };
/// @brief base class for all query results /// @brief base class for all query results
...@@ -234,6 +242,17 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest ...@@ -234,6 +242,17 @@ struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
} }
bool isSatisfied(const CollisionResult& result) const; bool isSatisfied(const CollisionResult& result) const;
/// @brief whether two CollisionRequest are the same or not
inline bool operator ==(const CollisionRequest& other) const
{
return QueryRequest::operator==(other)
&& num_max_contacts == other.num_max_contacts
&& enable_contact == other.enable_contact
&& enable_distance_lower_bound == other.enable_distance_lower_bound
&& security_margin == other.security_margin
&& break_distance == other.break_distance;
}
}; };
/// @brief collision result /// @brief collision result
...@@ -354,6 +373,15 @@ struct HPP_FCL_DLLAPI DistanceRequest : QueryRequest ...@@ -354,6 +373,15 @@ struct HPP_FCL_DLLAPI DistanceRequest : QueryRequest
} }
bool isSatisfied(const DistanceResult& result) const; bool isSatisfied(const DistanceResult& result) const;
/// @brief whether two DistanceRequest are the same or not
inline bool operator ==(const DistanceRequest& other) const
{
return QueryRequest::operator==(other)
&& enable_nearest_points == other.enable_nearest_points
&& rel_err == other.rel_err
&& abs_err == other.abs_err;
}
}; };
/// @brief distance result /// @brief distance result
......
...@@ -102,6 +102,13 @@ void exposeCollisionAPI () ...@@ -102,6 +102,13 @@ void exposeCollisionAPI ()
; ;
} }
if(!eigenpy::register_symbolic_link_to_registered_type< std::vector<CollisionRequest> >())
{
class_< std::vector<CollisionRequest> >("StdVec_CollisionRequest")
.def(vector_indexing_suite< std::vector<CollisionRequest> >())
;
}
if(!eigenpy::register_symbolic_link_to_registered_type<Contact>()) if(!eigenpy::register_symbolic_link_to_registered_type<Contact>())
{ {
class_ <Contact> ("Contact", class_ <Contact> ("Contact",
......
...@@ -89,6 +89,13 @@ void exposeDistanceAPI () ...@@ -89,6 +89,13 @@ void exposeDistanceAPI ()
; ;
} }
if(!eigenpy::register_symbolic_link_to_registered_type< std::vector<DistanceRequest> >())
{
class_< std::vector<DistanceRequest> >("StdVec_DistanceRequest")
.def(vector_indexing_suite< std::vector<DistanceRequest> >())
;
}
if(!eigenpy::register_symbolic_link_to_registered_type<DistanceResult>()) if(!eigenpy::register_symbolic_link_to_registered_type<DistanceResult>())
{ {
class_ <DistanceResult, bases<QueryResult> > ("DistanceResult", class_ <DistanceResult, bases<QueryResult> > ("DistanceResult",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment