KrisLibrary  1.0.0
RigidBodyCSpace.h
1 #ifndef PLANNING_RIGID_BODY_CSPACE_H
2 #define PLANNING_RIGID_BODY_CSPACE_H
3 
4 #include "CSpaceHelpers.h"
6 
11 class R2CSpace : public BoxCSpace
12 {
13 public:
14  R2CSpace(const Math3D::Vector2& bmin,const Math3D::Vector2& bmax);
15  virtual std::string VariableName(int i);
16  void SetDomain(const Math3D::Vector2& bmin,const Math3D::Vector2& bmax);
17  void GetDomain(Math3D::Vector2& bmin,Math3D::Vector2& bmax);
18 };
19 
24 class R3CSpace : public BoxCSpace
25 {
26 public:
27  R3CSpace(const Math3D::Vector3& bmin,const Math3D::Vector3& bmax);
28  virtual std::string VariableName(int i);
29  void SetDomain(const Math3D::Vector3& bmin,const Math3D::Vector3& bmax);
30  void GetDomain(Math3D::Vector3& bmin,Math3D::Vector3& bmax);
31 };
32 
37 class SO2CSpace : public GeodesicCSpace
38 {
39 public:
40  virtual int NumDimensions() { return 1; }
41  virtual std::string VariableName(int i);
42  virtual void Sample(Config& x);
43  virtual void SampleNeighborhood(const Config& c,Real r,Config& x);
44  virtual void Interpolate(const Config& a,const Config& b,Real u,Config& out);
45  virtual Real Distance(const Config& a,const Config& b);
46  virtual void Properties(PropertyMap& pmap);
47 
48  static void GetRotation(const Config& x,Math3D::Matrix2& R);
49  static void SetRotation(const Math3D::Matrix2& R,Config& x);
50 
51  void InterpolateDeriv(const Config& a,const Config& b,Real u,Vector& dx);
52  void Integrate(const Config& a,const Vector& da,Config& b);
53 };
54 
58 class SE2CSpace : public MultiCSpace
59 {
60 public:
61  SE2CSpace(Real bmin=-Inf,Real bmax=Inf);
62  SE2CSpace(const Math3D::Vector2& bmin,const Math3D::Vector2& bmax);
63 
64  void SetAngleWeight(Real weight);
65  void SetDomain(const Math3D::Vector2& bmin,const Math3D::Vector2& bmax);
66 
67  static void GetTransform(const Config& x,Math3D::RigidTransform2D& T);
68  static void SetTransform(const Math3D::RigidTransform2D& T,Config& x);
69 };
70 
75 class SO3CSpace : public GeodesicCSpace
76 {
77 public:
78  virtual int NumDimensions() { return 3; }
79  virtual std::string VariableName(int i);
80  virtual void Sample(Config& x);
81  virtual void SampleNeighborhood(const Config& c,Real r,Config& x);
82  virtual void Interpolate(const Config& a,const Config& b,Real u,Config& out);
83  virtual Real Distance(const Config& a,const Config& b);
84  virtual void Properties(PropertyMap& pmap);
85 
86  void InterpolateDeriv(const Config& a,const Config& b,Real u,Vector& dx);
87  void Integrate(const Config& a,const Vector& da,Config& b);
88 
89  static void GetRotation(const Config& x,Math3D::Matrix3& R);
90  static void SetRotation(const Math3D::Matrix3& R,Config& x);
91 };
92 
96 class SE3CSpace : public MultiCSpace
97 {
98 public:
99  SE3CSpace(Real bmin=-Inf,Real bmax=Inf);
100  SE3CSpace(const Math3D::Vector3& bmin,const Math3D::Vector3& bmax);
101 
102  void SetAngleWeight(Real weight);
103  void SetDomain(const Math3D::Vector3& bmin,const Math3D::Vector3& bmax);
104 
105  static void GetTransform(const Config& x,Math3D::RigidTransform& T);
106  static void SetTransform(const Math3D::RigidTransform& T,Config& x);
107 };
108 
109 
110 #endif
Definition: CSpaceHelpers.h:110
A 2x2 matrix class.
Definition: math3d/primitives.h:333
The space of rotations S0(3). The representation is a MomentRotation. Still need to implement IsFeasi...
Definition: RigidBodyCSpace.h:75
A 3D vector class.
Definition: math3d/primitives.h:136
Vector Config
an alias for Vector
Definition: RobotKinematics3D.h:14
Definition: CSpaceHelpers.h:11
The space of rotations SO(2). The representation is a single angle. Still need to implement IsFeasibl...
Definition: RigidBodyCSpace.h:37
Class declarations for useful 3D math types.
A rigid-body transformation.
Definition: math3d/primitives.h:820
virtual Real Distance(const Config &x, const Config &y)
optionally overrideable (default uses euclidean space)
Definition: CSpaceHelpers.h:50
virtual void Properties(PropertyMap &)
Returns properties of the space that might be useful for planners.
Definition: CSpaceHelpers.cpp:165
An axis-aligned subset of the space R^3 with convenient casts from Math3d::Vector3, and with variable names x,y,z.
Definition: RigidBodyCSpace.h:24
The space of rigid body transforms SE(3). Still need to implement IsFeasible, PathChecker.
Definition: RigidBodyCSpace.h:96
A 3x3 matrix class.
Definition: math3d/primitives.h:469
Vector bmin
The domain. NOTE: modifing these does not directly affect the constraints! Use SetDomain instead...
Definition: CSpaceHelpers.h:77
An axis-aligned subset of the space R^2 with convenient casts from Math3d::Vector2, and with variable names x,y.
Definition: RigidBodyCSpace.h:11
A 2D vector class.
Definition: math3d/primitives.h:41
The space of rigid body transforms SE(2). Still need to implement IsFeasible, PathChecker.
Definition: RigidBodyCSpace.h:58
A simple map from keys to values.
Definition: PropertyMap.h:27
Same as above, but in 2D.
Definition: math3d/primitives.h:902
Definition: CSpaceHelpers.h:63