Пример #1
0
void 
RosCommandAdapter::runMUSIC()
{
  std::cout << "running command adapter with update rate of " << command_rate << std::endl;
  RTClock clock(timestep / rtf);

  runtime = new MUSIC::Runtime (setup, timestep);
    
  for (int t = 0; runtime->time() < stoptime; t++)
    {
      clock.sleepNext();
      runtime->tick();
    }

#if MEASUREMENT_OUTPUT
  saveRuntime(clock.time ());
#endif

  std::cout << "command: total simtime: " << clock.time () << " s" <<  std::endl;
}
void
RosCommandAdapter::runROSMUSIC()
{
    MPI::COMM_WORLD.Barrier();
    std::cout << "running command adapter with update rate of " << command_rate << std::endl;
    RTClock clock( 1. / (command_rate * rtf));

    runtime = new MUSIC::Runtime (setup, timestep);
    ros::spinOnce();
    
    for (int t = 0; runtime->time() < stoptime; t++)
    {
        sendROS();
        clock.sleepNext();
        runtime->tick();
	    ros::spinOnce();
    }

#if MEASUREMENT_OUTPUT
    saveRuntime(clock.time ());
#endif

    std::cout << "command: total simtime: " << clock.time () << " s" <<  std::endl;
}