~shadowrobot/sr-ros-interface/stable

« back to all changes in this revision

Viewing changes to sr_movements/include/sr_movements/movement_publisher.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   movement_publisher.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  Publishes a sequence of movements.
 
23
 *
 
24
 */
 
25
 
 
26
 
 
27
#ifndef _MOVEMENT_PUBLISHER_HPP_
 
28
#define _MOVEMENT_PUBLISHER_HPP_
 
29
 
 
30
#include <ros/ros.h>
 
31
#include <boost/thread.hpp>
 
32
 
 
33
#include "sr_movements/partial_movement.hpp"
 
34
 
 
35
namespace shadowrobot
 
36
{
 
37
  class MovementPublisher
 
38
  {
 
39
  public:
 
40
    MovementPublisher( double min_value = 0.0, double max_value = 1.5,
 
41
                       double rate=100.0 );
 
42
    virtual ~MovementPublisher();
 
43
 
 
44
    void start();
 
45
    void stop();
 
46
 
 
47
    void add_movement(PartialMovement mvt);
 
48
 
 
49
  protected:
 
50
    std::vector<PartialMovement> partial_movements;
 
51
    ros::NodeHandle nh_tilde;
 
52
    ros::Publisher pub;
 
53
 
 
54
    ros::Rate publishing_rate;
 
55
    double min, max;
 
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