Main Page
Namespaces
Classes
Files
File List
File Members
src
orocos
types
ros_time_type.cpp
Go to the documentation of this file.
1
/******************************************************************************
2
* This file is part of the OROCOS toolchain ROS project *
3
* *
4
* (C) 2010 Steven Bellens, steven.bellens@mech.kuleuven.be *
5
* Department of Mechanical Engineering, *
6
* Katholieke Universiteit Leuven, Belgium. *
7
* *
8
* You may redistribute this software and/or modify it under either the *
9
* terms of the GNU Lesser General Public License version 2.1 (LGPLv2.1 *
10
* <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>) or (at your *
11
* discretion) of the Modified BSD License: *
12
* Redistribution and use in source and binary forms, with or without *
13
* modification, are permitted provided that the following conditions *
14
* are met: *
15
* 1. Redistributions of source code must retain the above copyright *
16
* notice, this list of conditions and the following disclaimer. *
17
* 2. Redistributions in binary form must reproduce the above copyright *
18
* notice, this list of conditions and the following disclaimer in the *
19
* documentation and/or other materials provided with the distribution. *
20
* 3. The name of the author may not be used to endorse or promote *
21
* products derived from this software without specific prior written *
22
* permission. *
23
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
24
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
25
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
26
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,*
27
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
28
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS *
29
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *
30
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, *
31
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING *
32
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
33
* POSSIBILITY OF SUCH DAMAGE. *
34
* *
35
*******************************************************************************/
36
37
#include "
ros_primitives_typekit_plugin.hpp
"
38
39
namespace
boost
{
40
namespace
serialization {
41
template
<
class
Archive>
42
void
serialize
( Archive & a,
ros::Time
& t,
unsigned
int
) {
43
using
boost::serialization::make_nvp;
44
a & make_nvp(
"sec"
, t.
sec
);
45
a & make_nvp(
"nsec"
, t.
nsec
);
46
}
47
48
template
<
class
Archive>
49
void
serialize
( Archive & a,
ros::Duration
& t,
unsigned
int
) {
50
using
boost::serialization::make_nvp;
51
a & make_nvp(
"sec"
, t.
sec
);
52
a & make_nvp(
"nsec"
, t.
nsec
);
53
}
54
}
55
}
56
57
58
namespace
ros_integration
{
59
using namespace
RTT
;
60
using namespace
RTT::types
;
61
62
// This class works around the ROS time representation.
63
class
RosTimeTypeInfo
:
public
types::StructTypeInfo
<ros::Time>
64
{
65
public
:
66
RosTimeTypeInfo
() : types::
StructTypeInfo
<
ros
::Time>(
"time"
) {}
67
};
68
69
// This class works around the ROS time representation.
70
class
RosDurationTypeInfo
:
public
types::StructTypeInfo
<ros::Duration>
71
{
72
public
:
73
RosDurationTypeInfo
() : types::
StructTypeInfo
<
ros
::Duration>(
"duration"
) {}
74
};
75
76
void
loadTimeTypes
(){
77
RTT::types::Types
()->addType(
new
RosTimeTypeInfo
);
78
RTT::types::Types
()->addType(
new
RosDurationTypeInfo
);
79
}
80
}
boost
ros::Time
TimeBase< Time, Duration >::sec
uint32_t sec
RTT::types
ros_integration::RosTimeTypeInfo::RosTimeTypeInfo
RosTimeTypeInfo()
Definition:
ros_time_type.cpp:66
ros_integration::RosDurationTypeInfo
Definition:
ros_time_type.cpp:70
TimeBase< Time, Duration >::nsec
uint32_t nsec
DurationBase< Duration >::nsec
int32_t nsec
DurationBase< Duration >::sec
int32_t sec
ros_integration::RosTimeTypeInfo
Definition:
ros_time_type.cpp:63
ros_integration::RosDurationTypeInfo::RosDurationTypeInfo
RosDurationTypeInfo()
Definition:
ros_time_type.cpp:73
ros_integration::loadTimeTypes
void loadTimeTypes()
Definition:
ros_time_type.cpp:76
ros
RTT::types::Types
TypeInfoRepository::shared_ptr Types()
RTT::types::StructTypeInfo
ros::Duration
boost::serialization::serialize
void serialize(Archive &a, RTT::ConnPolicy &c, unsigned int)
RTT
ros_integration
Definition:
ros_float32_type.cpp:39
ros_primitives_typekit_plugin.hpp
rtt_ros
Author(s): Ruben Smits
autogenerated on Sat Jun 8 2019 18:04:54