Surface.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
7 #include <mc_rbdyn/api.h>
8 
9 #include <RBDyn/MultiBodyConfig.h>
10 
11 #include <SpaceVecAlg/SpaceVecAlg>
12 
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 namespace mc_rbdyn
18 {
19 
20 struct Robot;
21 
22 struct SurfaceImpl;
23 
25 {
26 public:
27  Surface(const std::string & name,
28  const std::string & bodyName,
29  const sva::PTransformd & X_b_s,
30  const std::string & materialName);
31 
32  virtual ~Surface();
33 
34  const std::string & name() const;
35 
36  void name(const std::string & name);
37 
38  const std::string & bodyName() const;
39 
40  const std::string & materialName() const;
41 
42  const std::vector<sva::PTransformd> & points() const;
43 
44  unsigned int bodyIndex(const mc_rbdyn::Robot & robot) const;
45 
46  sva::PTransformd X_0_s(const mc_rbdyn::Robot & robot) const;
47 
48  sva::PTransformd X_0_s(const mc_rbdyn::Robot & robot, const rbd::MultiBodyConfig & mbc) const;
49 
50  const sva::PTransformd & X_b_s() const;
51 
52  void X_b_s(const sva::PTransformd & X_b_s);
53 
54  virtual void computePoints() = 0;
55 
56  std::string toStr();
57 
58  virtual std::shared_ptr<Surface> copy() const = 0;
59 
60  virtual std::string type() const = 0;
61 
62  bool operator==(const Surface & rhs);
63  bool operator!=(const Surface & rhs);
64 
65 protected:
66  std::vector<sva::PTransformd> & points();
67 
68 private:
69  std::unique_ptr<SurfaceImpl> impl;
70 };
71 
72 typedef std::shared_ptr<Surface> SurfacePtr;
73 
74 } // namespace mc_rbdyn
mc_rbdyn::SurfacePtr
std::shared_ptr< Surface > SurfacePtr
Definition: Surface.h:72
mc_rbdyn::Robot
Definition: Robot.h:62
mc_rbdyn::computePoints
MC_RBDYN_DLLAPI std::vector< sva::PTransformd > computePoints(const mc_rbdyn::Surface &robotSurface, const mc_rbdyn::Surface &envSurface, const sva::PTransformd &X_es_rs)
api.h
mc_rbdyn::Surface
Definition: Surface.h:24
MC_RBDYN_DLLAPI
#define MC_RBDYN_DLLAPI
Definition: api.h:50
mc_rbdyn::operator==
bool operator==(const mc_rbdyn::BodySensor &lhs, const mc_rbdyn::BodySensor &rhs)
Definition: BodySensor.h:147
mc_rbdyn
Definition: generic_gripper.h:14
mc_rtc::gui::Robot
auto Robot(const std::string &name, GetT get_fn)
Definition: Robot.h:56