Project

General

Profile

Revision 5d0687a9

ID5d0687a9991d806c94fc7c21405334e6717e3611

Added by Priya over 7 years ago

Small changes to wireless, and starting turning with line following.

View differences:

scout/libscout/src/WirelessReceiver.h
43 43
#include "messages/WirelessPacket.h"
44 44
#include "constants.h"
45 45

  
46
typedef void (*WirelessCallback)(const ::messages::WirelessPacketConstPtr&);
46
typedef void (*WirelessCallback)(std::vector<uint8_t>);
47 47

  
48 48
class WirelessReceiver
49 49
{
50
public:
51
    WirelessReceiver(WirelessCallback callback);
52
private:
53
    ros::NodeHandle nh;
54
    ros::Subscriber sub;
55
    WirelessCallback callback;
56
    void receive(const ::messages::WirelessPacketConstPtr&);
50
    public:
51
        /** Set up the class and prepare to communicate over ROS */
52
        WirelessReceiver(const ros::NodeHandle& libscout_node);
53

  
54
        /** Register a callback to be called every time a packet is received */
55
        void register_callback(WirelessCallback new_callback);
56

  
57
    private:
58
        ros::Subscriber sub;
59
        ros::NodeHandle node;
60
        WirelessCallback callback;
61
        void receive(const ::messages::WirelessPacketConstPtr&);
57 62
};
58 63

  
59 64
#endif

Also available in: Unified diff