Revision c5901d9a
Added Metal Detector to the sensor class. Now behaviors can access it. Also made it directly return the bool from messages.
scout/libscout/src/MetalDetectorControl.cpp | ||
---|---|---|
53 | 53 |
bool MetalDetectorControl::query() |
54 | 54 |
{ |
55 | 55 |
::messages::query_metal_detector srv; |
56 |
bool metal; |
|
57 | 56 |
|
58 | 57 |
if (!query_client.call(srv)) |
59 | 58 |
{ |
60 | 59 |
ROS_ERROR("MetalDetectorControl query failed."); |
61 | 60 |
} |
62 |
metal = srv.response.metal; |
|
63 |
|
|
64 |
return metal; |
|
61 |
return srv.response.metal; |
|
65 | 62 |
} |
scout/libscout/src/MetalDetectorControl.h | ||
---|---|---|
36 | 36 |
|
37 | 37 |
#include <ros/ros.h> |
38 | 38 |
#include <messages/query_metal_detector.h> |
39 |
|
|
39 | 40 |
class MetalDetectorControl |
40 | 41 |
{ |
41 | 42 |
public: |
scout/libscout/src/Sensors.h | ||
---|---|---|
50 | 50 |
#include "WirelessSender.h" |
51 | 51 |
#include "WirelessReceiver.h" |
52 | 52 |
#include "PaintBoardControl.h" |
53 |
#include "MetalDetectorControl.h" |
|
53 | 54 |
|
54 | 55 |
class Sensors |
55 | 56 |
{ |
... | ... | |
72 | 73 |
LinesensorControl * linesensor; |
73 | 74 |
WirelessSender * wl_sender; |
74 | 75 |
WirelessReceiver * wl_receiver; |
75 |
PaintBoardControl * paintboard; |
|
76 |
PaintBoardControl * paintboard; |
|
77 |
MetalDetectorControl * metal_detector; |
|
76 | 78 |
}; |
77 | 79 |
|
78 | 80 |
|
Also available in: Unified diff