Revision 15b7e607
ID | 15b7e607c9ec3704c7866011e2536b0f000777c4 |
Chaned libscout sonar code so that it turned sonar on and off when necessary.
scout/libscout/src/SonarControl.cpp | ||
---|---|---|
72 | 72 |
*/ |
73 | 73 |
void SonarControl::set_range(int start_pos, int end_pos) |
74 | 74 |
{ |
75 |
//TODO Enable some checks of start and end position |
|
75 |
/** Turn sonar on */ |
|
76 |
sonar::sonar_toggle on_msg; |
|
77 |
on_msg.set_on = true; |
|
78 |
sonar_toggle_pub.publish(on_msg); |
|
79 |
|
|
80 |
/** Set scan range */ |
|
76 | 81 |
sonar::sonar_set_scan msg; |
77 | 82 |
|
83 |
//TODO Enable some checks of start and end position |
|
78 | 84 |
msg.stop_l = start_pos; |
79 | 85 |
msg.stop_r = end_pos; |
80 | 86 |
|
... | ... | |
83 | 89 |
} |
84 | 90 |
|
85 | 91 |
/** |
92 |
* @brief Turn off sonar readings |
|
93 |
* |
|
94 |
* Stops sonar from panning and taking readings. |
|
95 |
* |
|
96 |
* @return NONE |
|
97 |
*/ |
|
98 |
float SonarControl::set_off() |
|
99 |
{ |
|
100 |
/** Turn sonar off */ |
|
101 |
sonar::sonar_toggle on_msg; |
|
102 |
on_msg.set_on = false; |
|
103 |
sonar_toggle_pub.publish(on_msg); |
|
104 |
} |
|
105 |
/** |
|
86 | 106 |
* @brief Query the current front sonar readings |
87 | 107 |
* |
88 | 108 |
* Sends a request to the query_sonar service which will reply with the |
Also available in: Unified diff