dynamic_graph_manager
converter.hh File Reference
#include <stdexcept>
#include "dg_to_ros.hh"
#include <ros/time.h>
#include <std_msgs/Header.h>
#include <boost/date_time/date.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/static_assert.hpp>
Include dependency graph for converter.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 dynamic_graph
 this is this package namespace in order to avoid naming conflict
 

Macros

#define DG_TO_ROS_IMPL(T)
 
#define ROS_TO_DG_IMPL(T)
 
#define DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL(T, ATTRIBUTE, EXTRA)
 This macro generates a converter for a stamped type from dynamic-graph to ROS. More...
 
#define DG_BRIDGE_MAKE_SHPTR_IMPL(T)
 This macro generates a converter for a shared pointer on a ROS type to a dynamic-graph type. More...
 
#define DG_BRIDGE_MAKE_STAMPED_IMPL(T, ATTRIBUTE, EXTRA)
 This macro generates a converter for a stamped type. More...
 
#define DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL(T, ATTRIBUTE, EXTRA)
 This macro generates a converter for a shared pointer on a stamped type. More...
 

Typedefs

typedef boost::posix_time::ptime dynamic_graph::ptime
 
typedef boost::posix_time::seconds dynamic_graph::seconds
 
typedef boost::posix_time::microseconds dynamic_graph::microseconds
 
typedef boost::posix_time::time_duration dynamic_graph::time_duration
 
typedef boost::gregorian::date dynamic_graph::date
 

Functions

void dynamic_graph::makeHeader (std_msgs::Header &header)
 
template<typename D , typename S >
void dynamic_graph::converter (D &dst, const S &src)
 Handle ROS <-> dynamic-graph conversion. More...
 
 dynamic_graph::DG_TO_ROS_IMPL (double)
 
 dynamic_graph::ROS_TO_DG_IMPL (double)
 
 dynamic_graph::DG_TO_ROS_IMPL (unsigned int)
 
 dynamic_graph::ROS_TO_DG_IMPL (unsigned int)
 
 dynamic_graph::DG_TO_ROS_IMPL (Vector)
 
 dynamic_graph::ROS_TO_DG_IMPL (Vector)
 
 dynamic_graph::DG_TO_ROS_IMPL (specific::Vector3)
 
 dynamic_graph::ROS_TO_DG_IMPL (specific::Vector3)
 
 dynamic_graph::DG_TO_ROS_IMPL (Matrix)
 
 dynamic_graph::ROS_TO_DG_IMPL (Matrix)
 
 dynamic_graph::DG_TO_ROS_IMPL (MatrixHomogeneous)
 
 dynamic_graph::ROS_TO_DG_IMPL (MatrixHomogeneous)
 
 dynamic_graph::DG_TO_ROS_IMPL (specific::Twist)
 
 dynamic_graph::ROS_TO_DG_IMPL (specific::Twist)
 
 dynamic_graph::DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (specific::Vector3, vector, ;)
 
 dynamic_graph::DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (MatrixHomogeneous, transform, dst.child_frame_id="";)
 
 dynamic_graph::DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (specific::Twist, twist, ;)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (double)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (unsigned int)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (Vector)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (specific::Vector3)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (Matrix)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (MatrixHomogeneous)
 
 dynamic_graph::DG_BRIDGE_MAKE_SHPTR_IMPL (specific::Twist)
 
 dynamic_graph::DG_BRIDGE_MAKE_STAMPED_IMPL (specific::Vector3, vector, ;)
 
 dynamic_graph::DG_BRIDGE_MAKE_STAMPED_IMPL (MatrixHomogeneous, transform, ;)
 
 dynamic_graph::DG_BRIDGE_MAKE_STAMPED_IMPL (specific::Twist, twist, ;)
 
 dynamic_graph::DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (specific::Vector3, vector, ;)
 
 dynamic_graph::DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (MatrixHomogeneous, transform, ;)
 
 dynamic_graph::DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (specific::Twist, twist, ;)
 
template<typename U , typename V >
void dynamic_graph::converter (U &dst, V &src)
 If an impossible/unimplemented conversion is required, fail. More...
 
boost::posix_time::ptime dynamic_graph::rosTimeToPtime (const ros::Time &rosTime)
 
ros::Time dynamic_graph::pTimeToRostime (const boost::posix_time::ptime &time)
 

Detailed Description

Author
Maximilien Naveau (maxim.nosp@m.ilie.nosp@m.n.nav.nosp@m.eau@.nosp@m.gmail.nosp@m..com)
License:
License BSD-3-Clause
Date
2019-05-22

Macro Definition Documentation

◆ DG_BRIDGE_MAKE_SHPTR_IMPL

#define DG_BRIDGE_MAKE_SHPTR_IMPL (   T)
Value:
template <> \
inline void converter( \
DgToRos<T>::dg_t& dst, \
const boost::shared_ptr<DgToRos<T>::ros_t const>& src) \
{ \
converter<DgToRos<T>::dg_t, DgToRos<T>::ros_t>(dst, *src); \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
void converter(U &dst, V &src)
If an impossible/unimplemented conversion is required, fail.
Definition: converter.hh:287

This macro generates a converter for a shared pointer on a ROS type to a dynamic-graph type.

A converter for the underlying type is required. I.e. to convert a shared_ptr<T> to T', a converter from T to T' is required.

◆ DG_BRIDGE_MAKE_STAMPED_IMPL

#define DG_BRIDGE_MAKE_STAMPED_IMPL (   T,
  ATTRIBUTE,
  EXTRA 
)
Value:
template <> \
inline void converter(DgToRos<std::pair<T, Vector> >::dg_t& dst, \
const DgToRos<std::pair<T, Vector> >::ros_t& src) \
{ \
converter<DgToRos<T>::dg_t, DgToRos<T>::ros_t>(dst, src.ATTRIBUTE); \
do \
{ \
EXTRA \
} while (0); \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
void converter(U &dst, V &src)
If an impossible/unimplemented conversion is required, fail.
Definition: converter.hh:287

This macro generates a converter for a stamped type.

I.e. A data associated with its timestamp.

FIXME: the timestamp is not yet forwarded to the dg signal.

◆ DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL

#define DG_BRIDGE_MAKE_STAMPED_SHPTR_IMPL (   T,
  ATTRIBUTE,
  EXTRA 
)
Value:
template <> \
inline void converter( \
DgToRos<std::pair<T, Vector> >::dg_t& dst, \
const boost::shared_ptr<DgToRos<std::pair<T, Vector> >::ros_t const>& \
src) \
{ \
converter<DgToRos<T>::dg_t, DgToRos<T>::ros_t>(dst, src->ATTRIBUTE); \
do \
{ \
EXTRA \
} while (0); \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
void converter(U &dst, V &src)
If an impossible/unimplemented conversion is required, fail.
Definition: converter.hh:287

This macro generates a converter for a shared pointer on a stamped type.

I.e. A data associated with its timestamp.

FIXME: the timestamp is not yet forwarded to the dg signal.

◆ DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL

#define DG_BRIDGE_TO_ROS_MAKE_STAMPED_IMPL (   T,
  ATTRIBUTE,
  EXTRA 
)
Value:
template <> \
inline void converter(DgToRos<std::pair<T, Vector> >::ros_t& dst, \
const DgToRos<std::pair<T, Vector> >::dg_t& src) \
{ \
makeHeader(dst.header); \
converter<DgToRos<T>::ros_t, DgToRos<T>::dg_t>(dst.ATTRIBUTE, src); \
do \
{ \
EXTRA \
} while (0); \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
void converter(U &dst, V &src)
If an impossible/unimplemented conversion is required, fail.
Definition: converter.hh:287

This macro generates a converter for a stamped type from dynamic-graph to ROS.

I.e. A data associated with its timestamp.

◆ DG_TO_ROS_IMPL

#define DG_TO_ROS_IMPL (   T)
Value:
template <> \
inline void converter(DgToRos<T>::ros_t& dst, const DgToRos<T>::dg_t& src)
void converter(U &dst, V &src)
If an impossible/unimplemented conversion is required, fail.
Definition: converter.hh:287

◆ ROS_TO_DG_IMPL

#define ROS_TO_DG_IMPL (   T)
Value:
template <> \
inline void converter(DgToRos<T>::dg_t& dst, const DgToRos<T>::ros_t& src)
void converter(U &dst, V &src)
If an impossible/unimplemented conversion is required, fail.
Definition: converter.hh:287