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>
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 PIDDIR "/var/tmp/run/" |
#define PIDFILE "pr2_etherCAT.pid" |
Function Documentation
static void cleanupPidFile |
( |
void |
|
) |
[static] |
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 |
) |
[static] |
int main |
( |
int |
argc, |
|
|
char * |
argv[] | |
|
) |
| | |
static double now |
( |
|
) |
[inline, static] |
static void publishDiagnostics |
( |
realtime_tools::RealtimePublisher< diagnostic_msgs::DiagnosticArray > & |
publisher |
) |
[static] |
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] |
static void timespecInc |
( |
struct timespec & |
tick, |
|
|
int |
nsec | |
|
) |
| | [static] |
void Usage |
( |
string |
msg = "" |
) |
|
Variable Documentation
accumulator_set<double, stats<tag::max, tag::mean> > cm_acc |
accumulator_set<double, stats<tag::max, tag::mean> > ec_acc |
accumulator_set<double, stats<tag::max, tag::mean> > jitter_acc |
accumulator_set<double, stats<tag::max, tag::mean> > loop_acc |
const std::string name = "pr2_etherCAT" [static] |