hpp-core 9.3.0
Implement basic classes for canonical path planning for kinematic chains.
Loading...
Searching...
No Matches
solid-solid-collision.hh
Go to the documentation of this file.
1//
2// Copyright (c) 2014,2015,2016,2018 CNRS
3// Authors: Florent Lamiraux, Joseph Mirabel, Diane Bury
4//
5
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met:
9//
10// 1. Redistributions of source code must retain the above copyright
11// notice, this list of conditions and the following disclaimer.
12//
13// 2. Redistributions in binary form must reproduce the above copyright
14// notice, this list of conditions and the following disclaimer in the
15// documentation and/or other materials provided with the distribution.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28// DAMAGE.
29
30#ifndef HPP_CORE_CONTINUOUS_VALIDATION_SOLID_SOLID_COLLISION_HH
31#define HPP_CORE_CONTINUOUS_VALIDATION_SOLID_SOLID_COLLISION_HH
32
34
35namespace hpp {
36namespace core {
37namespace continuousValidation {
43}; // struct CoefficientVelocity
44typedef std::vector<CoefficientVelocity> CoefficientVelocities_t;
45
55class HPP_CORE_DLLAPI SolidSolidCollision : public BodyPairCollision {
56 public:
64 const JointPtr_t& joint_a, const ConstObjectStdVector_t& objects_b,
66
72 const JointPtr_t& joint_b,
74
77 const SolidSolidCollisionPtr_t& other);
78
80
82
86
87 std::string name() const;
88
89 std::ostream& print(std::ostream& os) const;
90
95 const CollisionObjectConstPtr_t& right);
96
102 const JointConstPtr_t& parent, value_type distance);
103
104 // Get coefficients and joints
106 return m_->coefficients;
107 }
108
110 const JointPtr_t& joint_a() const { return m_->joint_a; }
112 const JointPtr_t& joint_b() const { return m_->joint_b; }
113
116 return (m_->joint_a ? m_->joint_a->index() : 0);
117 }
118
120 return (m_->joint_b ? m_->joint_b->index() : 0);
121 }
122
124
125 protected:
133
141 const ConstObjectStdVector_t& objects_b,
143
146 : BodyPairCollision(other), m_(other.m_) {}
147
148 void init(const SolidSolidCollisionWkPtr_t& weak);
149
150 private:
151 typedef pinocchio::JointIndex JointIndex;
152 typedef std::vector<JointIndex> JointIndices_t;
153
154 struct Model {
155 struct Bound {
156 Bound() : joint(0), radius(0) {}
157 JointIndex joint;
159 };
160 JointPtr_t joint_a;
161 JointPtr_t joint_b;
162 Bound bound_a;
163 Bound bound_b;
164 CoefficientVelocities_t coefficients;
165 CoefficientVelocities_t coefficients_reverse;
166 JointIndices_t computeSequenceOfJoints(JointIndex joint_a,
167 JointIndex joint_b) const;
168 CoefficientVelocities_t computeCoefficients(const JointIndices_t& joints,
169 value_type radius) const;
170 void setCoefficients();
171 };
172 shared_ptr<Model> m_;
173 SolidSolidCollisionWkPtr_t weak_;
174}; // class SolidSolidCollision
175} // namespace continuousValidation
176} // namespace core
177} // namespace hpp
178#endif // HPP_CORE_CONTINUOUS_VALIDATION_SOLID_SOLID_COLLISION_HH
BodyPairCollision(value_type tolerance)
Definition body-pair-collision.hh:128
value_type tolerance() const
Definition interval-validation.hh:95
SolidSolidCollision(const JointPtr_t &joint_a, const JointPtr_t &joint_b, value_type tolerance)
size_type indexJointA() const
Returns joint A index or -1 if no such joint exists.
Definition solid-solid-collision.hh:115
const JointPtr_t & joint_b() const
Get joint b.
Definition solid-solid-collision.hh:112
SolidSolidCollision(const JointPtr_t &joint_a, const ConstObjectStdVector_t &objects_b, value_type tolerance)
bool removeObjectTo_b(const CollisionObjectConstPtr_t &object)
static SolidSolidCollisionPtr_t createCopy(const SolidSolidCollisionPtr_t &other)
Copy instance and return shared pointer.
std::ostream & print(std::ostream &os) const
const JointPtr_t & joint_a() const
Get joint a.
Definition solid-solid-collision.hh:110
static SolidSolidCollisionPtr_t create(const JointPtr_t &joint_a, const JointPtr_t &joint_b, value_type tolerance)
void init(const SolidSolidCollisionWkPtr_t &weak)
static SolidSolidCollisionPtr_t create(const JointPtr_t &joint_a, const ConstObjectStdVector_t &objects_b, value_type tolerance)
value_type computeMaximalVelocity(vector_t &Vb) const
size_type indexJointB() const
Returns joint B index or -1 if no such joint exists.
Definition solid-solid-collision.hh:119
void addCollisionPair(const CollisionObjectConstPtr_t &left, const CollisionObjectConstPtr_t &right)
const CoefficientVelocities_t & coefficients() const
Definition solid-solid-collision.hh:105
void setVirtualParent(const JointConstPtr_t &joint, const JointConstPtr_t &parent, value_type distance)
SolidSolidCollision(const SolidSolidCollision &other)
Copy constructor.
Definition solid-solid-collision.hh:145
Definition body-pair-collision.hh:43
shared_ptr< IntervalValidation > IntervalValidationPtr_t
Definition fwd.hh:270
std::vector< CoefficientVelocity > CoefficientVelocities_t
Definition solid-solid-collision.hh:44
shared_ptr< SolidSolidCollision > SolidSolidCollisionPtr_t
Definition fwd.hh:273
Definition reeds-shepp.hh:38
Definition bi-rrt-planner.hh:36
pinocchio::value_type value_type
Definition fwd.hh:175
pinocchio::JointConstPtr_t JointConstPtr_t
Definition fwd.hh:151
std::vector< CollisionObjectConstPtr_t > ConstObjectStdVector_t
Definition fwd.hh:186
pinocchio::vector_t vector_t
Definition fwd.hh:221
pinocchio::JointPtr_t JointPtr_t
Definition fwd.hh:152
pinocchio::size_type size_type
Definition fwd.hh:174
pinocchio::CollisionObjectConstPtr_t CollisionObjectConstPtr_t
Definition fwd.hh:101
::pinocchio::JointIndex JointIndex
JointPtr_t joint_
Joint the degrees of freedom of which the bounds correspond to.
Definition solid-solid-collision.hh:41
CoefficientVelocity()
Definition solid-solid-collision.hh:39
value_type value_
Definition solid-solid-collision.hh:42
JointIndex joint
Definition solid-solid-collision.hh:157
value_type radius
Definition solid-solid-collision.hh:158