Synchronous mode bug demonstration

This commit is contained in:
Praveen Kumar 2020-03-09 17:37:14 +05:30 committed by Marc Garcia Puig
parent cfdbe8fb5e
commit 4f21f94ac0
2 changed files with 11 additions and 3 deletions

View File

@ -26,9 +26,9 @@ namespace traffic_manager {
const chr::duration<float> throughput_count_duration = current_time - throughput_clock;
if (throughput_count_duration.count() > 1.0f) {
//std::cout << "Stage: " + stage_name + ", throughput: " << throughput_counter
// << ", avg. cycle duration: " << 1000* inter_update_duration.count()
// << " ms" << std::endl;
std::cout << "Stage: " + stage_name + ", throughput: " << throughput_counter
<< ", avg. cycle duration: " << 1000* inter_update_duration.count()
<< " ms" << std::endl;
throughput_clock = current_time;
throughput_counter = 0u;

View File

@ -236,9 +236,17 @@ def main():
# example of how to use parameters
traffic_manager.global_percentage_speed_difference(30.0)
throughput_counter = 0
begining = time.time()
while True:
if args.sync and synchronous_master:
world.tick()
throughput_counter += 1
current = time.time()
if ((current - begining) > 1.0):
begining = current
print ('||||||||||| CARLA THROUGHPUT ||||||||||| >>> ' + str(throughput_counter))
throughput_counter = 0
else:
world.wait_for_tick()