Revision 3ec16d35

View differences:

scout/headlights/msg/set_headlights.msg
1 1
Header header
2
int8 left_red
3
int8 left_green
4
int8 left_blue
5
int8 right_red
6
int8 right_green
7
int8 right_blue
2
int16 left_red
3
int16 left_green
4
int16 left_blue
5
int16 right_red
6
int16 right_green
7
int16 right_blue
scout/libscout/CMakeLists.txt
29 29
#rosbuild_add_executable(example examples/example.cpp)
30 30
#target_link_libraries(example ${PROJECT_NAME})
31 31

  
32
rosbuild_add_executable(libscout_node src/behavior.cpp src/libscout.cpp src/libmotors.cpp)
32
rosbuild_add_executable(libscout_node src/behavior.cpp src/libscout.cpp src/libmotors.cpp src/libheadlights.cpp)
scout/libscout/src/libheadlights.cpp
96 96
 
97 97
	if(which & HL_LEFT)
98 98
	{
99
		left_red = red;
100
		left_green = green;
101
		left_blue = blue;
99
		msg.left_red = red;
100
		msg.left_green = green;
101
		msg.left_blue = blue;
102
	}
103
	else
104
	{
105
		msg.left_red = NO_SET;
106
		msg.left_green = NO_SET;
107
		msg.left_blue = NO_SET;
102 108
	}
103 109
	if(which & HL_RIGHT)
104 110
	{
105
		right_red = red;
106
		right_green = green;
107
		right_blue = blue;
111
		msg.right_red = red;
112
		msg.right_green = green;
113
		msg.right_blue = blue;
114
	}
115
	else
116
	{
117
		msg.right_red = NO_SET;
118
		msg.right_green = NO_SET;
119
		msg.right_blue = NO_SET;
108 120
	}
109 121
	
110 122
  /* Publishes message to set_motors topic */
scout/libscout/src/libheadlights.h
56 56
#define HL_LEFT		0x2
57 57
#define HL_BOTH		0x3
58 58

  
59
#define NO_SET	-1
60

  
59 61
#define REDSHIFT 		16
60 62
#define GREENSHIFT 	 8
61 63
#define BLUESHIFT		 0
scout/motors/src/motors.cpp
30 30
 * Implementation of functions for motor use.
31 31
 *
32 32
 * @author Colony Project, CMU Robotics Club
33
 * @author Benjamin Wasserman
33
 * @author Ben Wasserman
34 34
 **/
35 35

  
36 36
#include "ros/ros.h"

Also available in: Unified diff