Revision c492be62
Updated the licensing information in many files.
This is a broken commit because I decided to do this at a bad time. Sorry! The build will be working after next commit, I promise (and I won't push till then). This commit reflects the licensing in the files after I used my auto-add/remove script.
scout/libscout/src/SonarControl.h | ||
---|---|---|
21 | 21 |
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
22 | 22 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
23 | 23 |
* OTHER DEALINGS IN THE SOFTWARE. |
24 |
**/
|
|
24 |
*/ |
|
25 | 25 |
|
26 | 26 |
/** |
27 | 27 |
* @file SonarControl.h |
... | ... | |
46 | 46 |
{ |
47 | 47 |
public: |
48 | 48 |
/** Set up the motor node and prepare to communicate over ROS */ |
49 |
SonarControl(const ros::NodeHandle& libscout_node); |
|
49 |
SonarControl(const ros::NodeHandle& libscout_node, |
|
50 |
std::string scoutname); |
|
50 | 51 |
|
51 | 52 |
/** Sets sonar to a position (0-180 deg) specified by input */ |
52 |
void set(int position); |
|
53 |
void set_single(int position);
|
|
53 | 54 |
|
54 | 55 |
/** Sets sonar to scan a range in 0-180 specified by input */ |
55 | 56 |
void set_range(int start_pos, int end_pos); |
56 | 57 |
|
57 |
/** Stops sonar from panning and taking readings */ |
|
58 |
void set_off(); |
|
59 |
|
|
60 |
/** Returns the distance readings of sonars */ |
|
61 |
float query_front(void); |
|
62 |
float query_back(void); |
|
58 |
/** Stops sonar from panning and taking readings */ |
|
59 |
void set_off(); |
|
63 | 60 |
|
64 | 61 |
private: |
65 |
/** Converts between values output by sensor and physical distances */ |
|
66 |
float sonar_to_dist(float sonar_value); |
|
67 |
float dist_to_sonar(float distance); |
|
62 |
/** Record the new sonar distance measurement */ |
|
63 |
void distance_callback(const sonar::sonar_distance::ConstPtr& msg); |
|
68 | 64 |
|
69 |
/* Front and back distance values read by sonar. */
|
|
70 |
float front_dist;
|
|
71 |
float back_dist;
|
|
65 |
/** Converts between values output by sensor and physical distances */
|
|
66 |
//float sonar_to_dist(float sonar_value);
|
|
67 |
//float dist_to_sonar(float distance);
|
|
72 | 68 |
|
73 |
/** ROS publisher and client declaration */
|
|
69 |
/* ROS publisher and client declaration */ |
|
74 | 70 |
ros::Publisher sonar_set_scan_pub; |
75 | 71 |
ros::Publisher sonar_toggle_pub; |
76 |
ros::ServiceClient query_sonar;
|
|
72 |
ros::Subscriber sonar_distance_sub;
|
|
77 | 73 |
|
78 | 74 |
ros::NodeHandle node; |
79 | 75 |
}; |
Also available in: Unified diff