Defines | Typedefs | Functions | Variables
monitor.cpp File Reference
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <float.h>
#include <fstream>
#include <iostream>
#include <string>
#include <ros/ros.h>
#include <ros/package.h>
#include <move_base_msgs/MoveBaseAction.h>
#include <actionlib/client/simple_action_client.h>
#include <tf/transform_broadcaster.h>
#include <tf/transform_listener.h>
#include <std_msgs/Int16MultiArray.h>
#include <std_msgs/String.h>
#include "getgraph.h"
#include "message_types.h"
#include "patrolling_sim/GoToStartPosSrv.h"
Include dependency graph for monitor.cpp:

Go to the source code of this file.

Defines

#define DEAD_ROBOT_TIME   300.0
#define EXTENDED_STAGE   0
#define FOREVER   true
#define LOG_MONITOR   0
#define MAX_COMPLETE_PATROL   100
#define MAX_DIMENSION   200
#define MAX_EXPERIMENT_TIME   86400
#define MAXIDLENESS   500.0
#define NUM_MAX_ROBOTS   32
#define RESOLUTION   1.0
#define SAVE_HYSTOGRAMS   0
#define TIMEOUT_WRITE_RESULTS   180.0

Typedefs

typedef unsigned int uint

Functions

uint calculate_patrol_cycle (int *nr_visits, uint dimension)
bool check_dead_robots ()
void dolog (const char *str)
void finish_simulation ()
double get_last_goal_reached (int k)
int main (int argc, char **argv)
double Median (double *a, uint dimension)
void resultsCB (const std_msgs::Int16MultiArray::ConstPtr &msg)
void scenario_name (char *name, const char *graph_file, const char *teamsize_str)
void set_last_goal_reached (int k, double val)
void update_stats (int id_robot, int goal)
void write_results (double *avg_idleness, double *stddev_idleness, int *number_of_visits, uint complete_patrol, uint dimension, double worst_avg_idleness, double avg_graph_idl, double median_graph_idl, double stddev_graph_idl, double min_idleness, double gavg, double gstddev, double max_idleness, uint interference_cnt, uint tot_visits, float avg_visits, const char *graph_file, const char *teamsize_str, double duration, double real_duration, double comm_delay, string filename)

Variables

string algorithm
string algparams
double avg_graph_idl
double avg_idleness [MAX_DIMENSION]
double avg_stddev_graph_idl
uint cnt = 0
double comm_delay
uint complete_patrol = 0
double current_idleness [MAX_DIMENSION]
size_t dimension
double gavg
int goal
bool goal_reached = false
double goal_reached_wait
bool goto_start_pos = false
ros::ServiceServer GotoStartPosMethod
double gstddev
double gT0 = 0.0
double gT1 = 0.0
double gT2 = 0.0
FILE * idlfile
bool init_robots [NUM_MAX_ROBOTS]
string initial_positions
bool initialize = true
uint interference_cnt = 0
double last_goal_reached [NUM_MAX_ROBOTS]
double last_report_time
double last_visit [MAX_DIMENSION]
pthread_mutex_t lock_last_goal_reached
FILE * logfile = NULL
double lost_message_rate
double max_idleness = 0.0
double median_graph_idl
double min_idleness = 0.0
string nav_mod
int number_of_visits [MAX_DIMENSION]
uint patrol_cnt = 1
double previous_avg_graph_idl = DBL_MAX
const std::string PS_path = ros::package::getPath("patrolling_sim")
time_t real_time_zero
ros::Publisher results_pub
ros::Subscriber results_sub
ros::Publisher screenshot_pub
double stddev_graph_idl
double stddev_idleness [MAX_DIMENSION]
uint teamsize
double time_zero
double total_0 [MAX_DIMENSION]
double total_1 [MAX_DIMENSION]
double total_2 [MAX_DIMENSION]
double worst_avg_idleness

Define Documentation

#define DEAD_ROBOT_TIME   300.0

Definition at line 66 of file monitor.cpp.

#define EXTENDED_STAGE   0

Definition at line 75 of file monitor.cpp.

#define FOREVER   true

Definition at line 68 of file monitor.cpp.

#define LOG_MONITOR   0

Definition at line 73 of file monitor.cpp.

#define MAX_COMPLETE_PATROL   100

Definition at line 64 of file monitor.cpp.

#define MAX_DIMENSION   200

Definition at line 110 of file monitor.cpp.

#define MAX_EXPERIMENT_TIME   86400

Definition at line 65 of file monitor.cpp.

#define MAXIDLENESS   500.0

Definition at line 71 of file monitor.cpp.

#define NUM_MAX_ROBOTS   32

Definition at line 63 of file monitor.cpp.

#define RESOLUTION   1.0

Definition at line 70 of file monitor.cpp.

#define SAVE_HYSTOGRAMS   0

Definition at line 74 of file monitor.cpp.

#define TIMEOUT_WRITE_RESULTS   180.0

Definition at line 67 of file monitor.cpp.


Typedef Documentation

typedef unsigned int uint

Definition at line 81 of file monitor.cpp.


Function Documentation

uint calculate_patrol_cycle ( int *  nr_visits,
uint  dimension 
)

Definition at line 424 of file monitor.cpp.

Definition at line 513 of file monitor.cpp.

void dolog ( const char *  str)

Definition at line 142 of file monitor.cpp.

Definition at line 280 of file monitor.cpp.

double get_last_goal_reached ( int  k)

Definition at line 152 of file monitor.cpp.

int main ( int  argc,
char **  argv 
)

D.Portugal: needed in case you "rosrun" from another folder

YOU MIGHT WANT TO IGNORE THIS IN REAL ROBOT EXPERIMENTS (RUN INDEFINITELY)

YOU MIGHT WANT TO IGNORE THIS IN REAL ROBOT EXPERIMENTS (RUN INDEFINITELY)

Definition at line 619 of file monitor.cpp.

double Median ( double *  a,
uint  dimension 
)

Definition at line 298 of file monitor.cpp.

void resultsCB ( const std_msgs::Int16MultiArray::ConstPtr &  msg)

Definition at line 168 of file monitor.cpp.

void scenario_name ( char *  name,
const char *  graph_file,
const char *  teamsize_str 
)

Definition at line 438 of file monitor.cpp.

void set_last_goal_reached ( int  k,
double  val 
)

Definition at line 160 of file monitor.cpp.

void update_stats ( int  id_robot,
int  goal 
)

Definition at line 541 of file monitor.cpp.

void write_results ( double *  avg_idleness,
double *  stddev_idleness,
int *  number_of_visits,
uint  complete_patrol,
uint  dimension,
double  worst_avg_idleness,
double  avg_graph_idl,
double  median_graph_idl,
double  stddev_graph_idl,
double  min_idleness,
double  gavg,
double  gstddev,
double  max_idleness,
uint  interference_cnt,
uint  tot_visits,
float  avg_visits,
const char *  graph_file,
const char *  teamsize_str,
double  duration,
double  real_duration,
double  comm_delay,
string  filename 
)

Definition at line 465 of file monitor.cpp.


Variable Documentation

string algorithm

Definition at line 105 of file monitor.cpp.

string algparams

Definition at line 105 of file monitor.cpp.

double avg_graph_idl

Definition at line 118 of file monitor.cpp.

Definition at line 113 of file monitor.cpp.

Definition at line 118 of file monitor.cpp.

uint cnt = 0

Definition at line 90 of file monitor.cpp.

double comm_delay

Definition at line 104 of file monitor.cpp.

Definition at line 125 of file monitor.cpp.

Definition at line 113 of file monitor.cpp.

size_t dimension

Definition at line 116 of file monitor.cpp.

double gavg

Definition at line 121 of file monitor.cpp.

int goal

Definition at line 101 of file monitor.cpp.

bool goal_reached = false

Definition at line 99 of file monitor.cpp.

Definition at line 104 of file monitor.cpp.

bool goto_start_pos = false

Definition at line 89 of file monitor.cpp.

Definition at line 85 of file monitor.cpp.

double gstddev

Definition at line 121 of file monitor.cpp.

double gT0 = 0.0

Definition at line 122 of file monitor.cpp.

double gT1 = 0.0

Definition at line 122 of file monitor.cpp.

double gT2 = 0.0

Definition at line 122 of file monitor.cpp.

FILE* idlfile

Definition at line 137 of file monitor.cpp.

Definition at line 92 of file monitor.cpp.

Definition at line 105 of file monitor.cpp.

bool initialize = true

Definition at line 88 of file monitor.cpp.

Definition at line 124 of file monitor.cpp.

Definition at line 93 of file monitor.cpp.

Definition at line 102 of file monitor.cpp.

Definition at line 113 of file monitor.cpp.

pthread_mutex_t lock_last_goal_reached

Definition at line 96 of file monitor.cpp.

FILE* logfile = NULL

Definition at line 140 of file monitor.cpp.

Definition at line 104 of file monitor.cpp.

double max_idleness = 0.0

Definition at line 120 of file monitor.cpp.

Definition at line 118 of file monitor.cpp.

double min_idleness = 0.0

Definition at line 120 of file monitor.cpp.

string nav_mod

Definition at line 105 of file monitor.cpp.

Definition at line 115 of file monitor.cpp.

Definition at line 126 of file monitor.cpp.

double previous_avg_graph_idl = DBL_MAX

Definition at line 118 of file monitor.cpp.

const std::string PS_path = ros::package::getPath("patrolling_sim")

Definition at line 107 of file monitor.cpp.

Definition at line 103 of file monitor.cpp.

Definition at line 84 of file monitor.cpp.

Definition at line 83 of file monitor.cpp.

Definition at line 84 of file monitor.cpp.

Definition at line 118 of file monitor.cpp.

Definition at line 113 of file monitor.cpp.

Definition at line 91 of file monitor.cpp.

double time_zero

Definition at line 102 of file monitor.cpp.

Definition at line 114 of file monitor.cpp.

Definition at line 114 of file monitor.cpp.

Definition at line 114 of file monitor.cpp.

Definition at line 118 of file monitor.cpp.



patrolling_sim
Author(s):
autogenerated on Mon Oct 2 2017 03:13:50