void musicCallback(const std_msgs::Float64::ConstPtr& msg)
 {
     float read_value = -1;
     read_value = msg->data;
     if (read_value == 1)
     {
         shut_down = 0;
         thereIsMusic = 1;
         publish_step(reader->get_next_step());
         ROS_INFO("I heard a peak!");
     }
     else if (read_value == 0)
     {
         shut_down = 0;
         change_dance();
         if (thereIsMusic)
         {
             start = std::clock();
             random_timer();
         }
         thereIsMusic = 0;
     }
     else if (read_value == 2)
     {
         shut_down = 1;
     }
 }
Exemple #2
0
void
random_start ()
{
  if (!initialized) {
    initialized = true;
    random_update ();
    arandom_fn = random_word;
    random_timer ();
  }
}