~shadowrobot/sr-ros-interface/stable

« back to all changes in this revision

Viewing changes to sr_movements/include/sr_movements/partial_movement.hpp

  • Committer: Ugo Cupcic
  • Date: 2011-09-27 16:23:25 UTC
  • mto: (1.39.1 sr-ros-interface)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: ugo@shadowrobot.com-20110927162325-1864bw3axyhk93g2
sr_movements: This package reads a specified bitmap and send targets by replaying the drawn movement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file   partial_movement.hpp
 
3
 * @author Ugo Cupcic <ugo@shadowrobot.com>
 
4
 * @date   Tue Sep 27 10:05:01 2011
 
5
 *
 
6
*
 
7
* Copyright 2011 Shadow Robot Company Ltd.
 
8
*
 
9
* This program is free software: you can redistribute it and/or modify it
 
10
* under the terms of the GNU General Public License as published by the Free
 
11
* Software Foundation, either version 2 of the License, or (at your option)
 
12
* any later version.
 
13
*
 
14
* This program is distributed in the hope that it will be useful, but WITHOUT
 
15
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
16
* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
17
* more details.
 
18
*
 
19
* You should have received a copy of the GNU General Public License along
 
20
* with this program.  If not, see <http://www.gnu.org/licenses/>.
 
21
*
 
22
 * @brief  This is the main class from which all the different types of movement
 
23
 *         will inherit.
 
24
 *
 
25
 */
 
26
 
 
27
 
 
28
#ifndef _PARTIAL_MOVEMENT_HPP_
 
29
#define _PARTIAL_MOVEMENT_HPP_
 
30
 
 
31
#include <vector>
 
32
 
 
33
namespace shadowrobot
 
34
{
 
35
  class PartialMovement
 
36
  {
 
37
  public:
 
38
    PartialMovement();
 
39
    virtual ~PartialMovement();
 
40
 
 
41
    /**
 
42
     * Returns a target for the given percentage.
 
43
     *
 
44
     * @param percentage must be between 0 and 1
 
45
     *
 
46
     * @return target from this movement.
 
47
     */
 
48
    double get_target(double percentage);
 
49
 
 
50
  protected:
 
51
    /**
 
52
     * A vector containing the steps for this movement, in percentage
 
53
     * of the range. Contains -1 if no target for this point.
 
54
     */
 
55
    std::vector<double> steps;
 
56
  };
 
57
}
 
58
 
 
59
/* For the emacs weenies in the crowd.
 
60
Local Variables:
 
61
   c-basic-offset: 2
 
62
End:
 
63
*/
 
64
 
 
65
#endif