Home > src > BN_pol_rec > visualization > visualize_current_timestep.m

visualize_current_timestep

PURPOSE ^

VISUALIZE_CURRENT_TIMESTEP - display data

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 VISUALIZE_CURRENT_TIMESTEP - display data
 CREATED 2004
 ALTERED 2004-12-12 - minor change
 ALTERED 2004-12-21 - changed the order in which things are drawn
 ALTERED 2005-01-25 - added plot for sensor paths
 ALTERED 2005-02-02 - moved simulation time sign

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % VISUALIZE_CURRENT_TIMESTEP - display data
0002 % CREATED 2004
0003 % ALTERED 2004-12-12 - minor change
0004 % ALTERED 2004-12-21 - changed the order in which things are drawn
0005 % ALTERED 2005-01-25 - added plot for sensor paths
0006 % ALTERED 2005-02-02 - moved simulation time sign
0007 %
0008 
0009 global struct_own_forces;
0010 global image_struct; 
0011 global struct_own_forces;
0012 global struct_sensors;
0013 global struct_enemy_comps;
0014 global noOfOwn_forces;
0015 global noOfEnemyCompanies;
0016 global noOfSensors;
0017 global south_enemy;
0018 global north_enemy1;
0019 global north_enemy2;
0020 global simulationTime;
0021 a = 1;
0022 clf
0023 im_handle = image(image_struct.image); hold on
0024 text(150, 277, ['Simulation time = ' num2str(simulationTime)],'LineWidth', 2, 'BackgroundColor','y', 'EdgeColor', 'k', 'FontSize', 16) 
0025 
0026 %plot enemy
0027  for i = 1:noOfEnemyCompanies
0028 
0029         % show particles
0030     plts = struct_enemy_comps(i).plt;
0031     no_of_platoons = length(plts);
0032     for p=1:no_of_platoons
0033       format = '.';
0034       switch p
0035        case 1, 
0036         format = [format 'r'];
0037        case 2,
0038         format = [format 'b'];
0039        case 3,
0040         format = [format 'k'];
0041       end
0042       drawParticles( plts(p).particles, format );
0043     end
0044 
0045         % Ground truth enemy position
0046         [pos_enemy] = getGround_TruthPos(i);
0047         mean_pos_enemy = mean(pos_enemy);
0048         drowEnemy(mean_pos_enemy(2),mean_pos_enemy(1),1);
0049 
0050         %Estimated positions
0051         [struct_currentData] = getCurrentEsimatedData(1,i);
0052         mean_pos_enemy = mean(struct_currentData.enemy_pos);
0053         drowEnemy(mean_pos_enemy(2),mean_pos_enemy(1),0);
0054     
0055         %Plot estimate of radius
0056         % mean_radius_enemy = mean(struct_currentData.enemy_radius);
0057         %granularity = 1/mean_radius_enemy*100;
0058 
0059         %for theta = 0:0.01:2*pi
0060         %    x = mean_radius_enemy*cos(theta);
0061         %    y = mean_radius_enemy*sin(theta);
0062         %    plot((y + mean_pos_enemy(2)), (x + mean_pos_enemy(1)),'.','LineWidth',7,'MarkerEdgeColor','w', 'MarkerFaceColor','w','MarkerSize',7)
0063         %end;
0064     
0065         %plot connection between sensor tasks to targets (enemies)
0066         [comp_no] = showSensorTargetRelation(struct_enemy_comps(i).id);      
0067 end;
0068 
0069 %plot own forces
0070 for i = 1:noOfOwn_forces
0071     [pos_own] = struct_own_forces(i).pos;
0072     drowVi(pos_own(2), pos_own(1));
0073 end;
0074 
0075 %plot sensors
0076 for i = 1:noOfSensors
0077     [pos_sensor] = struct_sensors(i).pos;
0078     [id] = struct_sensors(i).id;
0079     id = char(id(1:3));
0080     plotSensors(pos_sensor(2), pos_sensor(1), id);
0081     if strcmp(id, 'UAV')
0082       visulalizeSensorPath( pos_sensor, struct_sensors(i).sensor_plan );
0083     end
0084 end;
0085 pause(1);

Generated on Wed 16-Mar-2005 09:17:47 by m2html © 2003