source: flair-src/trunk/lib/FlairFilter/src/TrajectoryGenerator1D.h@ 205

Last change on this file since 205 was 205, checked in by Sanahuja Guillaume, 7 years ago

TrajectoryGenerator1D::GetPercentageOfCompletion

File size: 3.8 KB
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[7]5/*!
6 * \file TrajectoryGenerator1D.h
7 * \brief Class generating a trajectory in 1D
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2011/05/01
10 * \version 4.0
11 */
12
13#ifndef TRAJECTORYGENERATOR1D_H
14#define TRAJECTORYGENERATOR1D_H
15
16#include <IODevice.h>
17
[15]18namespace flair {
19namespace core {
20class cvmatrix;
[7]21}
[15]22namespace gui {
23class LayoutPosition;
24}
25}
[7]26
27class TrajectoryGenerator1D_impl;
28
[15]29namespace flair {
30namespace filter {
31/*! \class TrajectoryGenerator1D
32*
33* \brief Class generating a trajectory in 1D
34*
35* This class generates position and velocity references, given
36* an absolute maximum velocity and an absolute acceleration. \n
37* When trajectory is started (see StartTraj()), position and velocity will
38*increase
39* at the given acceleration. If the maximum velocity is reached,
40* velocity will not increase anymore. Then, velocity will decrease according
41* to the given acceleration until velocity is null and final position is
42*reached. \n
43* Manual inputs can be introduced using SetPositionOffset() and
44*SetSpeedOffset().
45*
46*/
47class TrajectoryGenerator1D : public core::IODevice {
48public:
49 /*!
50 * \brief Constructor
51 *
52 * Construct a TrajectoryGenerator1D at given position. \n
53 * The TrajectoryGenerator1D will automatically be child of
54 *position->getLayout() Layout. After calling this function,
55 * position will be deleted as it is no longer usefull. \n
56 *
57 * \param position position to display settings
58 * \param name name
59 * \param unit unit of the position (for exemple m, deg, etc). Its only used
60 *for display on ground station.
61 */
62 TrajectoryGenerator1D(const gui::LayoutPosition *position, std::string name,
63 std::string unit = "");
[7]64
[15]65 /*!
66 * \brief Destructor
67 *
68 */
69 ~TrajectoryGenerator1D();
[7]70
[15]71 /*!
72 * \brief Start trajectory
73 *
[177]74 * \param startPosition start position
75 * \param endPosition end position
76 * \param startVelocity start velocity, should be actual velocity. This value will be saturated
77 * max velocity defined in GCS.
[15]78 */
[177]79 void StartTraj(float startPosition, float endPosition,float startVelocity=0);
[7]80
[15]81 /*!
82 * \brief Stop trajectory
83 *
84 */
85 void StopTraj(void);
[7]86
[15]87 /*!
88 * \brief Reset
89 *
90 * Reset all outputs to 0. This can be done only when IsRunning()==false.
91 *
92 */
93 void Reset(void);
[7]94
[15]95 /*!
96 * \brief Is trajectory running?
97 *
98 * \return true if trajectory is running
99 */
100 bool IsRunning(void) const;
[7]101
[15]102 /*!
103 * \brief Set position offset
104 *
105 * \param value position offset
106 */
107 void SetPositionOffset(float value);
[7]108
[15]109 /*!
110 * \brief Set speed offset
111 *
112 * \param value speed offset
113 */
114 void SetSpeedOffset(float value);
[7]115
[15]116 /*!
117 * \brief Update using provided datas
118 *
119 * Uses values specified by StartTraj(),
120 * SetPositionOffset() and SetSpeedOffset().
121 *
122 * \param time time of the update
123 */
124 void Update(core::Time time);
[7]125
[15]126 /*!
127 * \brief Position
128 *
[205]129 * \return the actual position
[15]130 */
131 float Position(void) const;
[7]132
[15]133 /*!
134 * \brief Speed
135 *
[205]136 * \return the actual speed
[15]137 */
138 float Speed(void) const;
[205]139
140 /*!
141 * \brief Get percentage of completion
142 *
143 * Value is between 0 and 100.
144 *
145 * \return the percentage of completion (in position)
146 */
147 float GetPercentageOfCompletion(void) const;
[7]148
[15]149 /*!
150 * \brief Output matrix
151 *
152 * \return matrix
153 */
154 core::cvmatrix *Matrix(void) const;
[7]155
[15]156private:
157 /*!
158 * \brief Update using provided datas
159 *
160 * Reimplemented from IODevice. Nothing to do in this IODevice.
161 *
162 * \param data data from the parent to process
163 */
164 void UpdateFrom(const core::io_data *data){};
[7]165
[15]166 TrajectoryGenerator1D_impl *pimpl_;
167};
[7]168} // end namespace filter
169} // end namespace flair
170#endif // TRAJECTORYGENERATOR1D_H
Note: See TracBrowser for help on using the repository browser.