Project

General

Profile

Revision c467de4f

IDc467de4f9e41e5657d599e92915437c6f6880934
Parent ab8736ac
Child 94ec93e0

Added by Yuyang Guo about 11 years ago

running libscout behaviors without specifying a name should
make everything publish directly (e.g., to /set_motor instead of
/scout1/set_motor) and thus should work on hardware.

View differences:

scout/libscout/src/BehaviorProcess.cpp
46 46

  
47 47
    // Running with no arguments only supports one scout. Check in case
48 48
    // the user meant to specify a scout in the arguments.
49
    if (argc < 3)
49
    if (argc < 2)
50 50
    {
51 51
        cout << "You have started this behavior in hardware mode." << endl
52 52
             << "To start in software mode, use: " << argv[0]
53
             << " <scoutname> <behavior#> " << endl;
53
             << " <behavior#> <scoutname> " << endl;
54 54
    }
55 55
    else
56 56
    {
57 57
        // Use the provided scoutname for simulator messages
58
        scoutname = argv[1];
59
        behavior_num = atoi(argv[2]);
58
        //scoutname = argv[1];
59
        behavior_num = atoi(argv[1]);
60
        if (argc == 3) {
61
            scoutname = argv[2];
62
        }
60 63

  
61
        ros::init(argc, argv, scoutname + "_behavior");
64
        ros::init(argc, argv, scoutname + "Behavior");
62 65
        // one Sensor instance per-class
63 66
        Sensors* sensors = new Sensors(scoutname);
64 67
        BehaviorList* list = new BehaviorList();

Also available in: Unified diff