Revision cc558a8d
ID | cc558a8d1299b6a5034be4ea7035b58fe09581b8 |
Modified the Behaviors to take a scoutname.
Scoutname now specifies which scout the behavior will affect. Scoutname must be passed to the constructors of each control module (some of which are now in need of modification), so that they can publish to the correct topic.
I also modified the constants file so that it is no longer exported. We should consider making this a full class with static exported functions (or a namespace).
scout/libscout/src/priya_behavior_process.cpp | ||
---|---|---|
33 | 33 |
* @author Alex Zirbel |
34 | 34 |
**/ |
35 | 35 |
|
36 |
|
|
37 | 36 |
#include <ros/ros.h> |
38 | 37 |
#include "PriyaBehavior.h" |
39 | 38 |
|
... | ... | |
41 | 40 |
|
42 | 41 |
int main (int argc, char **argv) |
43 | 42 |
{ |
43 |
string scoutname = ""; |
|
44 |
|
|
44 | 45 |
if (argc != 2) |
45 | 46 |
{ |
46 |
cout << "Usage: " << argv[0] << " <scoutname>" << endl; |
|
47 |
exit(1); |
|
47 |
cout << "You have started this behavior in hardware mode." << endl |
|
48 |
<< "To start in software mode, use: " << argv[0] |
|
49 |
<< " <scoutname>" << endl; |
|
50 |
} |
|
51 |
else |
|
52 |
{ |
|
53 |
// Use the provided scoutname for simulator messages |
|
54 |
scoutname = argv[1]; |
|
48 | 55 |
} |
49 | 56 |
|
50 | 57 |
ros::init(argc, argv, "libscout"); |
51 | 58 |
|
52 |
PriyaBehavior *behavior = new PriyaBehavior(argv[1]);
|
|
59 |
PriyaBehavior *behavior = new PriyaBehavior(scoutname);
|
|
53 | 60 |
behavior->run(); |
54 | 61 |
} |
Also available in: Unified diff