Project

General

Profile

Revision faa11f08

IDfaa11f08b06bf7e31069ba66d6bd28a308a5b730
Parent 360e3b6c
Child c15f2677

Added by Priya over 3 years ago

Changed it so that all behaviors are not instantiated immediately. Also changed pause so it does not spam (0, 0) motor speeds.

View differences:

scout/libscout/src/BehaviorProcess.cpp
61 61
        ros::init(argc, argv, scoutname + "_behavior");
62 62
        // one Sensor instance per-class
63 63
        Sensors* sensors = new Sensors(scoutname);
64
        BehaviorList* list = new BehaviorList(scoutname, sensors);
65
        vector<Behavior*> behavior_list = list->behavior_list;
64
        BehaviorList* list = new BehaviorList();
65
        vector<behavior_func> behavior_list = list->behavior_list;
66 66
        if (behavior_num < (int)behavior_list.size())
67 67
        {
68
            (behavior_list[behavior_num])->run();
68
            Behavior* b = behavior_list[behavior_num](scoutname, sensors);
69
            b->run();
69 70
        }
70 71
        else
71 72
        {

Also available in: Unified diff