Directory: | ./ |
---|---|
File: | include/sot/core/feature-visual-point.hh |
Date: | 2024-11-13 12:35:17 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 1 | 3 | 33.3% |
Branches: | 2 | 6 | 33.3% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * Copyright 2010, | ||
3 | * François Bleibel, | ||
4 | * Olivier Stasse, | ||
5 | * | ||
6 | * CNRS/AIST | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef __SOT_FEATURE_VISUALPOINT_HH__ | ||
11 | #define __SOT_FEATURE_VISUALPOINT_HH__ | ||
12 | |||
13 | /* --------------------------------------------------------------------- */ | ||
14 | /* --- INCLUDE --------------------------------------------------------- */ | ||
15 | /* --------------------------------------------------------------------- */ | ||
16 | |||
17 | /* SOT */ | ||
18 | #include <sot/core/exception-task.hh> | ||
19 | #include <sot/core/feature-abstract.hh> | ||
20 | |||
21 | /* --------------------------------------------------------------------- */ | ||
22 | /* --- API ------------------------------------------------------------- */ | ||
23 | /* --------------------------------------------------------------------- */ | ||
24 | |||
25 | #if defined(WIN32) | ||
26 | #if defined(feature_visual_point_EXPORTS) | ||
27 | #define SOTFEATUREVISUALPOINT_EXPORT __declspec(dllexport) | ||
28 | #else | ||
29 | #define SOTFEATUREVISUALPOINT_EXPORT __declspec(dllimport) | ||
30 | #endif | ||
31 | #else | ||
32 | #define SOTFEATUREVISUALPOINT_EXPORT | ||
33 | #endif | ||
34 | |||
35 | /* --------------------------------------------------------------------- */ | ||
36 | /* --- CLASS ----------------------------------------------------------- */ | ||
37 | /* --------------------------------------------------------------------- */ | ||
38 | |||
39 | namespace dynamicgraph { | ||
40 | namespace sot { | ||
41 | |||
42 | /*! | ||
43 | \class FeatureVisualPoint | ||
44 | \brief Class that defines 2D visualPoint visual feature | ||
45 | */ | ||
46 | class SOTFEATUREVISUALPOINT_EXPORT FeatureVisualPoint | ||
47 | : public FeatureAbstract, | ||
48 | public FeatureReferenceHelper<FeatureVisualPoint> { | ||
49 | public: | ||
50 | static const std::string CLASS_NAME; | ||
51 | ✗ | virtual const std::string &getClassName(void) const { return CLASS_NAME; } | |
52 | |||
53 | protected: | ||
54 | dynamicgraph::Matrix L; | ||
55 | |||
56 | /* --- SIGNALS ------------------------------------------------------------ */ | ||
57 | public: | ||
58 | dynamicgraph::SignalPtr<dynamicgraph::Vector, int> xySIN; | ||
59 | /** FeatureVisualPoint depth (required to compute the interaction matrix) | ||
60 | * default Z = 1m. */ | ||
61 | dynamicgraph::SignalPtr<double, int> ZSIN; | ||
62 | dynamicgraph::SignalPtr<dynamicgraph::Matrix, int> articularJacobianSIN; | ||
63 | |||
64 | using FeatureAbstract::errorSOUT; | ||
65 | using FeatureAbstract::jacobianSOUT; | ||
66 | using FeatureAbstract::selectionSIN; | ||
67 | |||
68 |
2/6✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
|
8 | DECLARE_REFERENCE_FUNCTIONS(FeatureVisualPoint); |
69 | |||
70 | public: | ||
71 | FeatureVisualPoint(const std::string &name); | ||
72 | ✗ | virtual ~FeatureVisualPoint(void) {} | |
73 | |||
74 | virtual unsigned int &getDimension(unsigned int &dim, int time); | ||
75 | |||
76 | virtual dynamicgraph::Vector &computeError(dynamicgraph::Vector &res, | ||
77 | int time); | ||
78 | virtual dynamicgraph::Matrix &computeJacobian(dynamicgraph::Matrix &res, | ||
79 | int time); | ||
80 | |||
81 | /** Static Feature selection. */ | ||
82 | inline static Flags selectX(void) { return Flags("10"); } | ||
83 | inline static Flags selectY(void) { return Flags("01"); } | ||
84 | |||
85 | virtual void display(std::ostream &os) const; | ||
86 | }; | ||
87 | |||
88 | } /* namespace sot */ | ||
89 | } /* namespace dynamicgraph */ | ||
90 | |||
91 | #endif // #ifndef __SOT_FEATURE_VISUALPOINT_HH__ | ||
92 | |||
93 | /* | ||
94 | * Local variables: | ||
95 | * c-basic-offset: 2 | ||
96 | * End: | ||
97 | */ | ||
98 |