~goby-dev/goby/acomms_protobuf_rework

« back to all changes in this revision

Viewing changes to src/moos/pAcommsHandler/pAcommsHandler.moos

  • Committer: toby
  • Date: 2011-02-04 03:46:10 UTC
  • Revision ID: tes.aubergine@gmail.com-20110204034610-si6hs33wtuxb93lo
partial progress towards protobuf configuration in pAcommsHandler and goby

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
modem_id = 1    
 
2
modem_id_lookup_path = modem_id_lookup.txt
2
3
 
3
4
ProcessConfig = pAcommsHandler
4
5
{
5
 
  // available to all moos processes.
 
6
  //////////////////////
 
7
  // MOOSApp reads this
 
8
  //////////////////////
6
9
  AppTick    = 10
7
 
  CommsTick  = 10
8
 
  
9
 
  // verbose, terse, quiet
10
 
  verbosity = verbose
11
 
 
12
 
  //////////////////////
13
 
  // MAC (must be using internal driver)
14
 
  //////////////////////
15
 
  mac = slotted // or polled or none
16
 
 
17
 
  // for slotted
18
 
  slot_time = 15 // seconds for the width of each slot
19
 
  rate = 0    // modem rate (0, 2, 3, 5 or auto [not implemented])
20
 
 
21
 
  // for polled
22
 
  // initializer.string = ACOMMS_POLLER_UPDATE = update_type=ADD,poll_type1=data,poll_from_id1=1,poll_to_id1=0,poll_rate1=0,poll_wait1=15
23
 
  // initializer.string = ACOMMS_POLLER_UPDATE = update_type=ADD,poll_type1=data,poll_from_id1=2,poll_to_id1=0,poll_rate1=0,poll_wait1=15
24
 
 
25
 
  //////////////////////
26
 
  // time sync (not implemented)
27
 
  //////////////////////
28
 
  //  time_sync = true // do automatic "ntp-like" sync of clocks - requires permission to call settimeofday()
29
 
  // analogous to ntp numbers
30
 
  // set to none or empty if this machine does not have any external clock sync
31
 
  // eventually this will be incorporated with ntp
32
 
  // low stratum numbers will be used to send clock sync messages
33
 
  //  stratum = 1
34
 
 
35
 
  //////////////////////
36
 
  // Driver configuration
37
 
  //////////////////////
38
 
  serial_port = /dev/ttyS0
39
 
  baud = 19200  
40
 
 
41
 
  // set all CFG values to factory defaults at the start before sending our CFG values
42
 
  // true is the default
43
 
 
44
 
  cfg_to_defaults = true
45
 
 
46
 
  // modem CFG values
47
 
  cfg = src,1
48
 
  cfg = snr,1
49
 
  cfg = rev,0
50
 
 
51
 
  //////////////////////
52
 
  // Queuing configuration
53
 
  //////////////////////
54
 
  
55
 
  // send = DestID, VarName, VariableID, [Ack], [BlackoutTime], [MaxQueue], [NewestFirst], [Priority], [Priority Time Constant]
56
 
  // defaults are send = mandatory,mandatory,mandatory,0,0,0,0,0,0,(blank)
57
 
  // for all outgoing messages
58
 
  //     VarName - local variable to subscribe to
59
 
  //     VariableID - 4 bit number (0 - 15) to allow the receiver to publish the variable in a specific remote variable (this number must match receiver's 'receive'
60
 
  //                VariableID).
61
 
  //     Ack - 0: no ack, 1: request acknowledgement (if no ack received, message will be queued to send again)
62
 
  //     BlackoutTime - do not send from this variable more than once per this number of seconds (default 0).
63
 
  //     MaxQueue - max number of messages in the queue before no more are added (newest first deletes oldest)
64
 
  //     NewestFirst - 0 (default): FIFO stack (messages sent in order received), 1: FILO stack (newest messages sent first)
65
 
  //     Priority - highest priority number sent first (default 0). equal priority messages interleaved in queue.
66
 
  //     Dynamic Priority Time Constant:
67
 
         // p = p' * exp(t-t'/T) where
68
 
         // p = calculated priority (used when figuring messages)
69
 
         // p' = priority set in previous parameter
70
 
         // t = current time
71
 
         // t'= last send time
72
 
         // T = dynamic priority time constant (what you're setting here)
73
 
         //     0 is a special case that means do not use dynamic priorities (T = infinity)
74
 
 
75
 
  // send = VarName,
76
 
                             //     VariableID 
77
 
                             //         [Ack]
78
 
                             //             [BlackoutTime]
79
 
                             //                 [MaxQueue] 
80
 
                             //                      [NewestFirst]
81
 
                             //                          [Priority]
82
 
                             //                               [Priority Time Constant]
83
 
  send = OUT_CTD_HEX_30B,           1,  0,  0,  100, 1,  0.3, 0 
84
 
 
85
 
  // send_CCL all parameters same EXCEPT variable ID should be the CCL header (in hex)
86
 
  send_CCL = OUT_DEPLOY_HEX_32B,    1a, 1,  0,  1,   1,  10,  120
87
 
  send_CCL = OUT_PROSECUTE_HEX_32B, 1a, 1,  0,  1,   1,  10,  120
88
 
 
89
 
  send_CCL = OUT_STATUS_HEX_32B,    1b, 0,  0,  1,   1,  1,   120
90
 
  send_CCL = OUT_CONTACT_HEX_32B,   1b, 0,  0,  1,   1,  2,   120
91
 
  send_CCL = OUT_TRACK_HEX_32B,     1b, 0,  0,  1,   1,  4,   120
92
 
 
93
 
  // receive = VarName, VariableID
94
 
  receive = IN_CTD_HEX_30B, 1
95
 
 
96
 
  // receive = VarName, CCL ID
97
 
  receive_CCL = IN_PLUS_COMMANDS_HEX_32B, 1a
98
 
  receive_CCL = IN_PLUS_MESSAGES_HEX_32B, 1b
99
 
 
100
 
  //////////////////////
101
 
  // DCCL Codec configuration
102
 
  //////////////////////
103
 
  
104
 
  // or you could use pGeneralCodec if you set these to "false"
105
 
  // default (for legacy support) is false for both
106
 
  encode = true
107
 
  decode = true
108
 
 
109
 
  //////////////////////
110
 
  // XML files (used for both Queuing and DCCL encoding)
111
 
  //////////////////////
112
 
  
113
 
  message_file = ../../../data/acomms/acoustic_moospoke.xml
114
 
 
115
 
  // manipulators go between "message_file = " and "somexml.xml". comma separate multiple manipulators
116
 
  // allowed manipulators:
117
 
     // no_encode - do not encode this message
118
 
     // no_decode - do not decode this message
119
 
     // no_queue  - do not queue this message
120
 
     // loopback - decode this message internally immediately following encode (used to command youself)
121
 
     // on_demand - encode immediately upon a data request command (use for time sensitive messages like STATUS)
122
 
     // tcp_share - send any messages received of this type onto the given clients
123
 
  // encodes on demand, always assuming one is available in the queue
124
 
  message_file = on_demand = ../../../data/acomms/simple_status.xml
125
 
  message_file = loopback,no_queue = ../../../data/acomms/simple_deploy.xml
 
10
  CommsTick  = 10  
 
11
 
 
12
  //////////////////////
 
13
  // pAcommsHandler Config
 
14
  //////////////////////
 
15
  
 
16
  \begin{pAcommsHandler_config}
 
17
  
 
18
  
 
19
 
 
20
  
126
21
 
127
 
 
128
 
  //////////////////////
129
 
  // TCP share
130
 
  //////////////////////
131
 
  tcp_share_enable = true
132
 
  tcp_share_port = 11000
133
 
  tcp_share_to_ip = 192.168.1.12:12045
134
 
  tcp_share_to_ip = 192.168.1.15
135
 
 
136
 
  //////////////////////
137
 
  // Misc
138
 
  //////////////////////
139
 
 
140
 
  // initialize variable at the top of the moos file  
141
 
  global_initializer.double = LAT_ORIGIN = LatOrigin
142
 
  global_initializer.double = LONG_ORIGIN = LongOrigin
143
 
  global_initializer.string = MODEM_ID_PATH = modem_id_lookup_path
144
 
 
145
 
  // initialize variable here
146
 
  initializer.string = VEHICLE_NAME = unicorn
147
 
  initializer.string = VEHICLE_TYPE = auv
 
22
  \end{pAcommsHandler_config} 
 
23
 
 
24
  
148
25
}