Revision d140fd71 scout/libscout/src/Behavior.cpp

View differences:

scout/libscout/src/Behavior.cpp
48 48
 * @param scoutname If nonempty, specifies which scout in the simulator
49 49
 *                  will be controlled by this behavior.
50 50
 */
51
Behavior::Behavior(string scoutname, string my_name)
51
Behavior::Behavior(string scoutname, string my_name, Sensors * sensors)
52 52
{
53
    name = my_name;
54

  
55
    motors = new MotorControl(node, scoutname);
56
    buttons = new ButtonControl(node, scoutname);
57
    sonar = new SonarControl(node, scoutname);
58
    //cliffsensor = new CliffsensorControl(node, scoutname);
59
    encoders = new EncodersControl(node, scoutname);
60
    linesensor = new LinesensorControl(node, scoutname);
61
    wl_sender = new WirelessSender(node);
62
    wl_receiver = new WirelessReceiver(node);
63 53

  
54
    name = my_name;
55
    sensors->init(&motors, &buttons, &sonar, &encoders, &linesensor,
56
                        &wl_sender, &wl_receiver);
64 57
    loop_rate = new ros::Rate(10);
65 58
}
66 59

  

Also available in: Unified diff