Revision 2bd58ddb
ID | 2bd58ddb37ca8f91b0127148c33b47f3673adb42 |
updated teleop; now works for multiple scoutsim robots
scout/scoutsim/src/scout_teleop.cpp | ||
---|---|---|
1 | 1 |
#include "scout_teleop.h" |
2 | 2 |
|
3 |
TeleopScout::TeleopScout(std::string scoutname) |
|
3 |
using namespace std; |
|
4 |
|
|
5 |
TeleopScout::TeleopScout(string scoutname) |
|
4 | 6 |
{ |
5 | 7 |
fl_set = fr_set = bl_set = br_set = true; |
6 | 8 |
fl_speed = fr_speed = bl_speed = br_speed = 0; |
... | ... | |
89 | 91 |
|
90 | 92 |
int main(int argc, char** argv) |
91 | 93 |
{ |
92 |
ros::init(argc, argv, "scout_teleop"); |
|
93 |
TeleopScout teleop_scout = TeleopScout("scout1"); |
|
94 |
string scoutname = ""; |
|
95 |
if(argc != 2) |
|
96 |
{ |
|
97 |
cout << "Opens up a teleop process to send input to the motors" << endl; |
|
98 |
cout << "(Remember to create a scout_teleop_userinput process as well to actually capture keyboard input!)" << endl; |
|
99 |
cout << "Usage: " << argv[0] <<" <scoutname>" << endl; |
|
100 |
exit(0); |
|
101 |
} |
|
102 |
|
|
103 |
scoutname = argv[1]; |
|
104 |
ros::init(argc, argv, scoutname+"_scout_teleop"); |
|
105 |
TeleopScout teleop_scout = TeleopScout(scoutname); |
|
94 | 106 |
|
95 | 107 |
teleop_scout.keyListenerLoop(); |
96 | 108 |
|
Also available in: Unified diff