dynamic_graph_manager
dynamic_graph Namespace Reference

this is this package namespace in order to avoid naming conflict More...

Namespaces

 specific
 Types dedicated to identify pairs of (dg,ros) data.
 

Classes

class  Device
 
class  DeviceSimulator
 
class  DgToRos
 DgToRos trait type. More...
 
struct  DgToRos< double >
 
struct  DgToRos< Matrix >
 
struct  DgToRos< MatrixHomogeneous >
 
struct  DgToRos< specific::Twist >
 
struct  DgToRos< specific::Vector3 >
 
struct  DgToRos< std::pair< MatrixHomogeneous, Vector > >
 
struct  DgToRos< std::pair< specific::Twist, Vector > >
 
struct  DgToRos< std::pair< specific::Vector3, Vector > >
 
struct  DgToRos< unsigned int >
 
struct  DgToRos< Vector >
 
class  DynamicGraphManager
 This class has for purpose to manage the different processes during run time. More...
 
class  ExceptionAbstract
 The ExceptionAbstract class. More...
 
class  ExceptionDynamic
 ExceptionDynamic. More...
 
class  ExceptionFactory
 The ExceptionFactory class. More...
 
class  ExceptionFeature
 
class  ExceptionSignal
 
class  ExceptionTask
 ExceptionTask. More...
 
class  ExceptionTools
 
class  ExceptionYamlCpp
 
struct  GlobalRos
 The GlobalRos struct is a structure that allows to gloabally handle the ROS objects. More...
 
class  PeriodicCall
 
class  RosPublish
 Publish dynamic-graph information into ROS. More...
 
class  RosPythonInterpreter
 This class wraps the implementation of the runCommand service. More...
 
class  RosQueuedSubscribe
 Publish ROS information in the dynamic-graph. More...
 
class  RosRobotStatePublisher
 This class define a dynamic graph wrapper around the vicon client. More...
 
struct  RosRobotStatePublisherInternal
 
class  RosRobotStatePublisherMt
 This class define a dynamic graph wrapper around the vicon client. More...
 
struct  RosRobotStatePublisherMtInternal
 
class  RosSubscribe
 Publish ROS information in the dynamic-graph. More...
 
class  RosTfListener
 
class  RosTime
 

Typedefs

typedef dynamicgraph::Signal< dynamicgraph::Vector, int > OutSignal
 
typedef dynamicgraph::SignalPtr< dynamicgraph::Vector, int > InSignal
 
typedef std::map< std::string, OutSignal * > DeviceOutSignalMap
 
typedef std::map< std::string, InSignal * > DeviceInSignalMap
 
typedef std::chrono::steady_clock clock
 clock is the std::chrono::high_resolution_clock object. More...
 
typedef std::map< std::string, dynamicgraph::Vector > VectorDGMap
 VectorDGMap is a shortcut for the very long type of the map.
 
typedef boost::posix_time::ptime ptime
 
typedef boost::posix_time::seconds seconds
 
typedef boost::posix_time::microseconds microseconds
 
typedef boost::posix_time::time_duration time_duration
 
typedef boost::gregorian::date date
 
typedef dynamicgraph::Vector Vector
 
typedef dynamicgraph::Matrix Matrix
 
typedef Eigen::Transform< double, 3, Eigen::Affine > MatrixHomogeneous
 
typedef Eigen::Matrix< double, 3, 3 > MatrixRotation
 
typedef Eigen::AngleAxis< double > VectorUTheta
 
typedef Eigen::Quaternion< double > VectorQuaternion
 
typedef Eigen::Vector3d VectorRotation
 
typedef Eigen::Vector3d VectorRollPitchYaw
 
typedef Eigen::Matrix< double, 6, 6 > MatrixForce
 
typedef Eigen::Matrix< double, 6, 6 > MatrixTwist
 
typedef dynamicgraph::SignalTimeDependent< int, int > SignalOUT
 Simple shortcut for code writing convenience.
 
typedef dynamicgraph::SignalPtr< dynamicgraph::Vector, int > SignalIN
 Simple shortcut for code writing convenience.
 
typedef boost::function< void(int)> callback_t
 Simple shortcut for code writing convenience.
 
typedef realtime_tools::RealtimePublisher< tf2_msgs::TFMessage > TfRtPublisher
 Renaming of the tf publisher type.
 
typedef realtime_tools::RealtimePublisher< sensor_msgs::JointState > JointStateRtPublisher
 Renaming of the joint position publisher type.
 

Functions

ros::NodeHandle & ros_init (std::string node_name)
 rosInit is a global method that uses the structure GlobalRos. More...
 
ros::AsyncSpinner & ros_spinner (std::string node_name)
 ros_spinner return the async_spinner_. More...
 
void ros_shutdown (std::string node_name)
 ros_shutdown shuts down ros and stop the ros spinner with the associate name
 
void ros_shutdown ()
 ros_shutdown shuts down ros and stop the ros spinners
 
bool ros_exist (std::string node_name)
 Check if a node handle has been created or not.
 
void parse_yaml_node (const YAML::Node &sensors_and_controls, VectorDGMap &out_sensors_map, VectorDGMap &out_motor_controls_map)
 parse_yaml_node allows to parse the yaml node to create the according maps of dynamicgraph::Vector. More...
 
void makeHeader (std_msgs::Header &header)
 
template<typename D , typename S >
void converter (D &dst, const S &src)
 Handle ROS <-> dynamic-graph conversion. More...
 
 DG_TO_ROS_IMPL (double)
 
 ROS_TO_DG_IMPL (double)
 
 DG_TO_ROS_IMPL (unsigned int)
 
 ROS_TO_DG_IMPL (unsigned int)
 
 DG_TO_ROS_IMPL (Vector)
 
 ROS_TO_DG_IMPL (Vector)
 
 DG_TO_ROS_IMPL (specific::Vector3)
 
 ROS_TO_DG_IMPL (specific::Vector3)
 
 DG_TO_ROS_IMPL (Matrix)
 
 ROS_TO_DG_IMPL (Matrix)
 
 DG_TO_ROS_IMPL (MatrixHomogeneous)
 
 ROS_TO_DG_IMPL (MatrixHomogeneous)
 
 DG_TO_ROS_IMPL (specific::Twist)
 
 ROS_TO_DG_IMPL (specific::Twist)
 
 DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (specific::Vector3, vector, ;)
 
 DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (MatrixHomogeneous, transform, dst.child_frame_id="";)
 
 DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (specific::Twist, twist, ;)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (double)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (unsigned int)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (Vector)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (specific::Vector3)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (Matrix)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (MatrixHomogeneous)
 
 DG_BRIDGE_MAKE_SHPTR_IMPL (specific::Twist)
 
 DG_BRIDGE_MAKE_STAMPED_IMPL (specific::Vector3, vector, ;)
 
 DG_BRIDGE_MAKE_STAMPED_IMPL (MatrixHomogeneous, transform, ;)
 
 DG_BRIDGE_MAKE_STAMPED_IMPL (specific::Twist, twist, ;)
 
 DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (specific::Vector3, vector, ;)
 
 DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (MatrixHomogeneous, transform, ;)
 
 DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (specific::Twist, twist, ;)
 
template<typename U , typename V >
void converter (U &dst, V &src)
 If an impossible/unimplemented conversion is required, fail. More...
 
boost::posix_time::ptime rosTimeToPtime (const ros::Time &rosTime)
 
ros::Time pTimeToRostime (const boost::posix_time::ptime &time)
 
std::string makeSignalString (const std::string &className, const std::string &instanceName, bool isInputSignal, const std::string &signalType, const std::string &signalName)
 
void buildFrom (const MatrixHomogeneous &MH, MatrixTwist &MT)
 
template<>
void RosPublish::sendData< std::pair< MatrixHomogeneous, Vector > > (boost::shared_ptr< realtime_tools::RealtimePublisher< DgToRos< std::pair< MatrixHomogeneous, Vector > >::ros_t > > publisher, boost::shared_ptr< DgToRos< std::pair< MatrixHomogeneous, Vector > >::signalIn_t > signal, int time)
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (DeviceSimulator, "DeviceSimulator")
 dynamic_graph::Device::CLASS_NAME must be the name as the actual device class.
 
ostream & operator<< (ostream &os, const ExceptionAbstract &error)
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosPublish, "RosPublish")
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosQueuedSubscribe, "RosQueuedSubscribe")
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosRobotStatePublisher, "RosRobotStatePublisher")
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosRobotStatePublisherMt, "RosRobotStatePublisherMt")
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosSubscribe, "RosSubscribe")
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosTfListener, "RosTfListener")
 
 DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (RosTime, "RosTime")
 

Variables

static std::map< std::string, std::unique_ptr< GlobalRos > > GLOBAL_ROS_VAR
 GLOBAL_ROS_VAR is global variable that acts as a singleton on the ROS node handle and the spinner. More...
 
static const int queueSize = 5
 

Detailed Description

this is this package namespace in order to avoid naming conflict

Typedef Documentation

◆ clock

typedef std::chrono::steady_clock dynamic_graph::clock

clock is the std::chrono::high_resolution_clock object.

This typedef is here as a shortcut to simplify the code readability.

Function Documentation

◆ converter() [1/2]

template<typename D , typename S >
void dynamic_graph::converter ( D &  dst,
const S &  src 
)

Handle ROS <-> dynamic-graph conversion.

Implements all ROS/dynamic-graph conversions required by the bridge.

Relies on the DgToRos type trait to make sure valid pair of types are used.

◆ converter() [2/2]

template<typename U , typename V >
void dynamic_graph::converter ( U &  dst,
V &  src 
)
inline

If an impossible/unimplemented conversion is required, fail.

IMPORTANT, READ ME:

If the compiler generates an error in the following function, this is /normal/.

This error means that either you try to use an undefined conversion. You can either fix your code or provide the wanted conversion by updating this header.

◆ parse_yaml_node()

void dynamic_graph::parse_yaml_node ( const YAML::Node &  sensors_and_controls,
VectorDGMap out_sensors_map,
VectorDGMap out_motor_controls_map 
)

parse_yaml_node allows to parse the yaml node to create the according maps of dynamicgraph::Vector.

Parameters
[in]sensors_and_controlsis the node that contains the hardware info.
[out]out_sensors_mapis the map that contains the sensors data.
[out]out_motor_controls_mapis the map that contains the motor controls data.

◆ ros_init()

ros::NodeHandle & dynamic_graph::ros_init ( std::string  node_name)

rosInit is a global method that uses the structure GlobalRos.

Its role is to create the ros::nodeHandle and the ros::spinner once at the first call. It always returns a reference to the node hanlde.

Returns
the reference of GLOBAL_ROS_VAR.node_handle_.

call ros::init

ros::NodeHandle instanciation

If spinner is not created we create it. Here we can safely assume that ros::init was called before.

create the spinner

run the spinner in a different thread

Return a reference to the node handle so any function can use it

call ros::init

ros::NodeHandle instanciation

If spinner is not created we create it. Here we can safely assume that ros::init was called before.

create the spinner

run the spinner in a different thread

Return a reference to the node handle so any function can use it

Examples:
simple_dgm.hpp.

◆ ros_spinner()

ros::AsyncSpinner & dynamic_graph::ros_spinner ( std::string  node_name)

ros_spinner return the async_spinner_.

Call dynamic_graph ros_init if ros has not been initialized

Returns
the reference of GLOBAL_ROS_VAR.async_spinner_.

Variable Documentation

◆ GLOBAL_ROS_VAR

std::map<std::string, std::unique_ptr<GlobalRos> > dynamic_graph::GLOBAL_ROS_VAR
static

GLOBAL_ROS_VAR is global variable that acts as a singleton on the ROS node handle and the spinner.

The use of the std::unique_ptr allows to delete the object and re-create at will. It is usefull to reset the ros environment specifically for unittesting.

If the node handle does not exist we call the global method ros::init. This method has for purpose to initialize the ROS environment. The creation of ROS object is permitted only after the call of this function. After ros::init being called we create the node hanlde which allows in turn to advertize the ROS services, or create topics (data pipe).