StudentSubscriber.h 1.54 KB
Newer Older
flashingx's avatar
flashingx committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//    Class to handle subscription to students to receive position data.
//
//    Copyright (C) 2018
//          Yvan Bosshard           byvan       @ee.ethz.ch
//          Michael Rogenmoser      michaero    @ee.ethz.ch
//          Tiago Salzmann          tiagos      @ee.ethz.ch
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef STUDENTSUBSCRIBER_H
#define STUDENTSUBSCRIBER_H

namespace d_fall_pps
{
	class StudentSubscriber
	{
	public:
		// Constructor
		StudentSubscriber(int id, std::string address);

		// Somehow the subscription didn't work inside the constructor
		void subscribe(ros::NodeHandle& handle);

		// Just to cleanly unsubscribe from the topics
		void unsubscribe();

		// The callback once data arrives from this node
flashingx's avatar
flashingx committed
39
		void callback(const CrazyflieData& data); // make this private?
40
41
42
43
44
45
46
47
48

	private:	
		int _studentID;
		std::string _address;
		ros::Subscriber _subscriber;

	};
}

flashingx's avatar
flashingx committed
49
#endif //	STUDENTSUBSCRIBER_H included