Revision a2b7e8f1 scout/libscout/src/Behavior.cpp

View differences:

scout/libscout/src/Behavior.cpp
54 54
    name = my_name;
55 55
    sensors->init(&motors, &buttons, &sonar, &encoders, &linesensor,
56 56
                        &wl_sender, &wl_receiver);
57
    wl_receiver->register_callback(std::bind(&Behavior::default_callback,
58
        this, std::placeholders::_1));
59

  
57 60
    loop_rate = new ros::Rate(10);
58 61
}
59 62

  
60 63
/**
64
 * Cleans up after a behavior is killed.
65
 */
66
Behavior::~Behavior()
67
{
68
  motors->set_sides(0, 0, MOTOR_ABSOLUTE);
69
  delete wl_receiver;
70
  delete loop_rate;
71
}
72

  
73
/**
74
 * Empty callback used as default callback for wireless receiver.
75
 */
76
void Behavior::default_callback(vector<uint8_t> data)
77
{
78
  return;
79
}
80

  
81
/**
61 82
 * Allows the behavior to check ros::ok(), without being aware of ROS.
62 83
 */
63 84
bool Behavior::ok()

Also available in: Unified diff