Attachment 'nodeTemplate.h'
Download 1 // node template
2
3 #ifndef nodeTemplate_H
4 #define nodeTemplate_H
5 // nodeTemplate is a template for building ROS nodes with wxWidgets
6
7 #include <wx/wx.h>
8 #include <ros/node.h>
9
10
11 // include node-specific header files here
12 #include "wxWidgetsNodeTemplate/ROS_Node_Template.h" //This is our autogenerated msg
13 #include "serverNode/nodeTemplateServer.h" // and our autogenerated srv
14
15 using namespace ros;
16
17 class nodeTemplate
18 {
19 private:
20 wxTextCtrl *m_pTextBox;
21 Node *m_pNode;
22 wxString m_AdvertiseNodeBusOut, m_SubscribeMonitorNodeBus, m_AdvertiseServiceDataBus;
23 void initNode();
24
25
26 // node-specific service and subscribe callbacks
27 wxWidgetsNodeTemplate::ROS_Node_Template monitorNodeBus;
28 wxWidgetsNodeTemplate::ROS_Node_Template nodeBusOut;
29
30 void monitorNodeBusCallback();
31 bool serviceTemplateCallback(serverNode::nodeTemplateServer::Request &req,
32 serverNode::nodeTemplateServer::Response &res );
33
34 public:
35 nodeTemplate(wxTextCtrl *TextBox);
36 virtual ~nodeTemplate();
37
38 // node-specific publish method
39 void Publish();
40
41
42
43
44 // node-specfic routines and variables
45 private:
46 // node specific values
47 wxString m_MessageIn;
48 uint8_t m_Value8;
49 uint16_t m_Value16;
50 uint32_t m_Value32;
51 uint64_t m_Value64;
52
53
54 public:
55
56 // node-specific methods
57 void setValuesMonitorNodeBus( wxString messageIn, uint8_t Value8, uint16_t Value16, uint32_t Value32, uint64_t Value64);
58 void getValuesNodeBusOut( wxString *pMessageOut, uint8_t *pValue8, uint16_t *pValue16, uint32_t *pValue32, uint64_t *pValue64);
59
60 };
61
62
63 #endif //nodeTemplate_H
64
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.