Classes | Defines | Functions | Variables
main.cpp File Reference
#include <stdio.h>
#include <getopt.h>
#include <execinfo.h>
#include <signal.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <pthread.h>
#include <diagnostic_updater/DiagnosticStatusWrapper.h>
#include <pr2_controller_manager/controller_manager.h>
#include <ethercat_hardware/ethercat_hardware.h>
#include <ros/ros.h>
#include <std_srvs/Empty.h>
#include <realtime_tools/realtime_publisher.h>
#include <std_msgs/Float64.h>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/mean.hpp>
Include dependency graph for main.cpp:

Go to the source code of this file.

Classes

class  RTLoopHistory

Defines

#define CLOCK_PRIO   0
#define CONTROL_PRIO   0

Functions

static void cleanupPidFile (const char *interface)
void * controlLoop (void *)
void * diagnosticLoop (void *args)
std::string generatePIDFilename (const char *interface)
bool haltMotorsService (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
static int lock_fd (int fd)
int main (int argc, char *argv[])
static double now ()
static void publishDiagnostics (realtime_tools::RealtimePublisher< diagnostic_msgs::DiagnosticArray > &publisher)
bool publishTraceService (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
void quitRequested (int sig)
bool resetMotorsService (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
static int setupPidFile (const char *interface)
static void timespecInc (struct timespec &tick, int nsec)
void Usage (string msg="")

Variables

static pthread_t controlThread
static pthread_attr_t controlThreadAttr
static bool g_halt_motors = false
static bool g_halt_requested = false
struct {
   bool   allow_unprogrammed_
   char *   interface_
   char *   program_
   char *   rosparam_
   bool   stats_
   char *   xml_
g_options
static volatile bool g_publish_trace_requested = false
static int g_quit = 0
static bool g_reset_motors = true
std::string g_robot_desc
struct {
   accumulator_set< double, stats
< tag::max, tag::mean > >   cm_acc
   accumulator_set< double, stats
< tag::max, tag::mean > >   ec_acc
   double   halt_rt_loop_frequency
   accumulator_set< double, stats
< tag::max, tag::mean > >   jitter_acc
   int   last_overrun
   int   last_severe_overrun
   accumulator_set< double, stats
< tag::max, tag::mean > >   loop_acc
   double   overrun_cm
   double   overrun_ec
   double   overrun_loop_sec
   int   overruns
   int   recent_overruns
   double   rt_loop_frequency
   bool   rt_loop_not_making_timing
g_stats
static const std::string name = "pr2_ethercat"
static const int NSEC_PER_SECOND = 1e+9
static const char * PIDDIR = "/var/tmp/run/"
static const int USEC_PER_SECOND = 1e6

Define Documentation

#define CLOCK_PRIO   0

Definition at line 690 of file main.cpp.

#define CONTROL_PRIO   0

Definition at line 691 of file main.cpp.


Function Documentation

static void cleanupPidFile ( const char *  interface) [static]

Definition at line 684 of file main.cpp.

void* controlLoop ( void *  )

Definition at line 275 of file main.cpp.

void* diagnosticLoop ( void *  args)

Definition at line 212 of file main.cpp.

std::string generatePIDFilename ( const char *  interface)

Definition at line 588 of file main.cpp.

bool haltMotorsService ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)

Definition at line 558 of file main.cpp.

static int lock_fd ( int  fd) [static]

Definition at line 571 of file main.cpp.

int main ( int  argc,
char *  argv[] 
)

Definition at line 695 of file main.cpp.

static double now ( ) [inline, static]

Definition at line 204 of file main.cpp.

static void publishDiagnostics ( realtime_tools::RealtimePublisher< diagnostic_msgs::DiagnosticArray > &  publisher) [static]

Definition at line 126 of file main.cpp.

bool publishTraceService ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)

Definition at line 564 of file main.cpp.

void quitRequested ( int  sig)

Definition at line 547 of file main.cpp.

bool resetMotorsService ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)

Definition at line 552 of file main.cpp.

static int setupPidFile ( const char *  interface) [static]

Definition at line 606 of file main.cpp.

static void timespecInc ( struct timespec &  tick,
int  nsec 
) [static]

Definition at line 225 of file main.cpp.

void Usage ( string  msg = "")

Definition at line 77 of file main.cpp.


Variable Documentation

Definition at line 71 of file main.cpp.

accumulator_set<double, stats<tag::max, tag::mean> > cm_acc

Definition at line 109 of file main.cpp.

pthread_t controlThread [static]

Definition at line 693 of file main.cpp.

pthread_attr_t controlThreadAttr [static]

Definition at line 694 of file main.cpp.

accumulator_set<double, stats<tag::max, tag::mean> > ec_acc

Definition at line 108 of file main.cpp.

bool g_halt_motors = false [static]

Definition at line 100 of file main.cpp.

bool g_halt_requested = false [static]

Definition at line 101 of file main.cpp.

struct { ... } g_options [static]
volatile bool g_publish_trace_requested = false [static]

Definition at line 102 of file main.cpp.

int g_quit = 0 [static]

Definition at line 98 of file main.cpp.

bool g_reset_motors = true [static]

Definition at line 99 of file main.cpp.

std::string g_robot_desc

Definition at line 75 of file main.cpp.

struct { ... } g_stats [static]

Definition at line 122 of file main.cpp.

char* interface_

Definition at line 68 of file main.cpp.

accumulator_set<double, stats<tag::max, tag::mean> > jitter_acc

Definition at line 111 of file main.cpp.

Definition at line 114 of file main.cpp.

Definition at line 115 of file main.cpp.

accumulator_set<double, stats<tag::max, tag::mean> > loop_acc

Definition at line 110 of file main.cpp.

const std::string name = "pr2_ethercat" [static]

Definition at line 62 of file main.cpp.

const int NSEC_PER_SECOND = 1e+9 [static]

Definition at line 103 of file main.cpp.

double overrun_cm

Definition at line 118 of file main.cpp.

double overrun_ec

Definition at line 117 of file main.cpp.

Definition at line 116 of file main.cpp.

int overruns

Definition at line 112 of file main.cpp.

const char* PIDDIR = "/var/tmp/run/" [static]

Definition at line 586 of file main.cpp.

char* program_

Definition at line 67 of file main.cpp.

Definition at line 113 of file main.cpp.

char* rosparam_

Definition at line 70 of file main.cpp.

Definition at line 123 of file main.cpp.

Definition at line 121 of file main.cpp.

bool stats_

Definition at line 72 of file main.cpp.

const int USEC_PER_SECOND = 1e6 [static]

Definition at line 104 of file main.cpp.

char* xml_

Definition at line 69 of file main.cpp.



pr2_ethercat
Author(s): Rob Wheeler
autogenerated on Thu Jun 6 2019 20:28:56