hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
car-like.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 // Authors: Florent Lamiraux
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_STEERING_METHOD_CAR_LIKE_HH
20 # define HPP_CORE_STEERING_METHOD_CAR_LIKE_HH
21 
22 # include <hpp/util/debug.hh>
23 # include <hpp/util/pointer.hh>
24 
25 # include <hpp/core/fwd.hh>
26 # include <hpp/core/config.hh>
29 
30 namespace hpp {
31  namespace core {
32  namespace steeringMethod {
35 
39  class HPP_CORE_DLLAPI CarLike : public SteeringMethod
40  {
41  public:
42 
43  virtual ~CarLike () {}
44 
46  void setWheelJoints (const std::vector<JointPtr_t> wheels)
47  {
48  wheels_ = wheels;
49  }
50 
59  void computeRadius ();
60 
61  protected:
63  CarLike (const Problem& problem);
64 
66  CarLike (const Problem& problem,
67  const value_type turningRadius,
68  JointPtr_t xyJoint, JointPtr_t rzJoint,
69  std::vector <JointPtr_t> wheels);
70 
72  CarLike (const CarLike& other);
73 
75  void init (CarLikeWkPtr_t weak)
76  {
78  weak_ = weak;
79  }
80 
84  size_type xyId_, rzId_;
85  std::vector<JointPtr_t> wheels_;
86  private:
87  value_type computeAngle(const JointPtr_t wheel) const;
88  void guessWheels();
89  CarLikeWkPtr_t weak_;
90  }; // CarLike
92  } // namespace steeringMethod
93  } // namespace core
94 } // namespace hpp
95 #endif // HPP_CORE_STEERING_METHOD_CAR_LIKE_HH
void setWheelJoints(const std::vector< JointPtr_t > wheels)
Set the wheels.
Definition: car-like.hh:46
virtual ~CarLike()
Definition: car-like.hh:43
Definition: problem.hh:48
Definition: steering-method.hh:38
pinocchio::DeviceWkPtr_t DeviceWkPtr_t
Definition: fwd.hh:115
pinocchio::size_type size_type
Definition: fwd.hh:156
Definition: car-like.hh:39
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:133
size_type xyId_
Definition: car-like.hh:84
std::vector< JointPtr_t > wheels_
Definition: car-like.hh:85
void init(SteeringMethodWkPtr_t weak)
Store weak pointer to itself.
Definition: steering-method.hh:114
pinocchio::value_type value_type
Definition: fwd.hh:157
void init(CarLikeWkPtr_t weak)
Store weak pointer to itself.
Definition: car-like.hh:75
value_type rho_
Definition: car-like.hh:82
JointPtr_t xy_
Definition: car-like.hh:83
DeviceWkPtr_t device_
Definition: car-like.hh:81