Project

General

Profile

Statistics
| Branch: | Revision:

root / scout / libscout / src / HeadlightControl.h @ a8480867

History | View | Annotate | Download (2.16 KB)

1
/**
2
 * Copyright (c) 2011 Colony Project
3
 * 
4
 * Permission is hereby granted, free of charge, to any person
5
 * obtaining a copy of this software and associated documentation
6
 * files (the "Software"), to deal in the Software without
7
 * restriction, including without limitation the rights to use,
8
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the
10
 * Software is furnished to do so, subject to the following
11
 * conditions:
12
 * 
13
 * The above copyright notice and this permission notice shall be
14
 * included in all copies or substantial portions of the Software.
15
 * 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
 * OTHER DEALINGS IN THE SOFTWARE.
24
 */
25

    
26
/**
27
 * @file HeadlightControl.h
28
 * @brief Contains headlights declarations and functions
29
 * 
30
 * Contains functions and definitions for the use of
31
 * headlights
32
 *
33
 * @author Colony Project, CMU Robotics Club
34
 * @author Ben Wasserman
35
 * @author Alex Zirbel
36
 */
37

    
38
#ifndef _HEADLIGHT_CONTROL_H_
39
#define _HEADLIGHT_CONTROL_H_
40

    
41
#include <ros/ros.h>
42
#include <libscout/constants.h>
43
#include <headlights/set_headlights.h>
44

    
45
/* Defines */
46
#define WHITE                0xFFFFFF
47
#define OFF                        0x000000
48
#define RED                 0xFF0000
49
#define GREEN             0x00FF00
50
#define BLUE                0x0000FF
51
#define YELLOW            0xFFFF00
52
#define CYAN                0x00FFFF
53
#define PINK                0xFF00FF
54

    
55
#define HL_RIGHT        0x1
56
#define HL_LEFT                0x2
57
#define HL_BOTH                0x3
58

    
59
#define NO_SET        -1
60

    
61
#define REDSHIFT                 16
62
#define GREENSHIFT             8
63
#define BLUESHIFT                0
64

    
65
class HeadlightControl
66
{
67
    public:
68
        HeadlightControl(const ros::NodeHandle& libscout_node);
69

    
70
        void set(int color, int which);
71
        void set_rgb(int red, int green, int blue, int which);
72

    
73
    private:
74
        ros::NodeHandle node;
75

    
76
        ros::Publisher set_headlights_pub;
77
};
78

    
79
#endif
80