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 <vector>
#include <string>
#include <sstream>
#include <stdarg.h>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <stdexcept>
#include "duration.h"
#include <sys/time.h>
#include "ros/time.h"
#include <log4cxx/logger.h>
#include "ros/console.h"
#include <boost/static_assert.hpp>
#include <cassert>
#include <stdint.h>
#include <assert.h>
#include <stddef.h>
#include "ros/assert.h"
#include <map>
#include <set>
#include <list>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/function.hpp>
#include "exceptions.h"
#include <boost/shared_array.hpp>
#include "ros/types.h"
#include "ros/forwards.h"
#include "ros/common.h"
#include "ros/macros.h"
#include <string.h>
#include <boost/array.hpp>
#include "serialized_message.h"
#include "message_forward.h"
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include "message_traits.h"
#include "ros/exception.h"
#include <boost/call_traits.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>
#include <cstring>
#include <boost/bind.hpp>
#include <typeinfo>
#include <ros/message.h>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/make_shared.hpp>
#include <ros/static_assert.h>
#include "ros/message_traits.h"
#include "ros/builtin_message_traits.h"
#include "ros/serialization.h"
#include "ros/message_event.h"
#include "forwards.h"
#include "timer_options.h"
#include "wall_timer_options.h"
#include "ros/service_traits.h"
#include <boost/lexical_cast.hpp>
#include "subscription_callback_helper.h"
#include "ros/spinner.h"
#include <time.h>
#include "ros/publisher.h"
#include <boost/utility.hpp>
#include "ros/service_server.h"
#include "ros/subscriber.h"
#include "ros/node_handle.h"
#include "ros/init.h"
#include "XmlRpcValue.h"
#include "node_handle.h"
#include "ros/names.h"
#include <ostream>
#include "ros/message_operations.h"
#include "ros/ros.h"
#include <ctype.h>
#include <stdlib.h>
#include "tinystr.h"
#include "link.h"
#include <tinyxml/tinyxml.h>
#include "pose.h"
#include "pr2_mechanism_model/joint.h"
#include "pr2_hardware_interface/hardware_interface.h"
#include <boost/circular_buffer.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include <boost/accumulators/statistics/variance.hpp>
#include <pr2_mechanism_model/robot.h>
#include <boost/thread/thread.hpp>
#include <boost/thread/condition.hpp>
#include <pr2_controller_interface/controller_provider.h>
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include <errno.h>
#include "Poco/MetaObject.h"
#include "Poco/Mutex.h"
#include "boost/algorithm/string.hpp"
#include "class_loader_imp.h"
#include "std_msgs/Header.h"
#include "ethercat/ethercat_defs.h"
#include "ethercat_telegram.h"
#include "ethercat/ethercat_datastruct.h"
#include "dll/ethercat_slave_memory.h"
#include <al/ethercat_slave_handler.h>
#include <diagnostic_updater/DiagnosticStatusWrapper.h>
#include "diagnostic_msgs/DiagnosticStatus.h"
#include <al/ethercat_AL.h>
#include <al/ethercat_master.h>
#include "Poco/Manifest.h"
#include "ethercat_hardware/ethercat_com.h"
#include <realtime_tools/realtime_publisher.h>
#include <boost/thread/condition_variable.hpp>
#include <pluginlib/class_loader.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RTLoopHistory

Defines

#define CLOCK_PRIO   0
#define CONTROL_PRIO   0
#define PIDDIR   "/var/tmp/run/"
#define PIDFILE   "pr2_etherCAT.pid"

Functions

static void cleanupPidFile (void)
void * controlLoop (void *)
void * diagnosticLoop (void *args)
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 (void)
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_
   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 int USEC_PER_SECOND = 1e6

Define Documentation

#define CLOCK_PRIO   0

Definition at line 648 of file main.cpp.

#define CONTROL_PRIO   0

Definition at line 649 of file main.cpp.

#define PIDDIR   "/var/tmp/run/"

Definition at line 565 of file main.cpp.

#define PIDFILE   "pr2_etherCAT.pid"

Definition at line 566 of file main.cpp.


Function Documentation

static void cleanupPidFile ( void   )  [static]

Definition at line 643 of file main.cpp.

void* controlLoop ( void *   ) 

Definition at line 273 of file main.cpp.

void* diagnosticLoop ( void *  args  ) 

Definition at line 210 of file main.cpp.

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

Definition at line 538 of file main.cpp.

static int lock_fd ( int  fd  )  [static]

Definition at line 551 of file main.cpp.

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

Definition at line 653 of file main.cpp.

static double now (  )  [inline, static]

Definition at line 202 of file main.cpp.

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

Definition at line 124 of file main.cpp.

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

Definition at line 544 of file main.cpp.

void quitRequested ( int  sig  ) 

Definition at line 527 of file main.cpp.

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

Definition at line 532 of file main.cpp.

static int setupPidFile ( void   )  [static]

Definition at line 567 of file main.cpp.

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

Definition at line 223 of file main.cpp.

void Usage ( string  msg = ""  ) 

Definition at line 76 of file main.cpp.


Variable Documentation

Definition at line 70 of file main.cpp.

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

Definition at line 107 of file main.cpp.

pthread_t controlThread [static]

Definition at line 651 of file main.cpp.

pthread_attr_t controlThreadAttr [static]

Definition at line 652 of file main.cpp.

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

Definition at line 106 of file main.cpp.

bool g_halt_motors = false [static]

Definition at line 98 of file main.cpp.

bool g_halt_requested = false [static]

Definition at line 99 of file main.cpp.

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

Definition at line 100 of file main.cpp.

int g_quit = 0 [static]

Definition at line 96 of file main.cpp.

bool g_reset_motors = true [static]

Definition at line 97 of file main.cpp.

std::string g_robot_desc

Definition at line 74 of file main.cpp.

struct { ... } g_stats [static]

Definition at line 120 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 109 of file main.cpp.

Definition at line 112 of file main.cpp.

Definition at line 113 of file main.cpp.

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

Definition at line 108 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 101 of file main.cpp.

double overrun_cm

Definition at line 116 of file main.cpp.

double overrun_ec

Definition at line 115 of file main.cpp.

Definition at line 114 of file main.cpp.

int overruns

Definition at line 110 of file main.cpp.

char* program_

Definition at line 67 of file main.cpp.

Definition at line 111 of file main.cpp.

Definition at line 121 of file main.cpp.

Definition at line 119 of file main.cpp.

bool stats_

Definition at line 71 of file main.cpp.

const int USEC_PER_SECOND = 1e6 [static]

Definition at line 102 of file main.cpp.

char* xml_

Definition at line 69 of file main.cpp.

 All Classes Namespaces Files Functions Variables Defines


pr2_etherCAT
Author(s): Rob Wheeler/wheeler@willowgarage.com
autogenerated on Fri Jan 11 09:09:48 2013