File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,17 @@ namespace dynamicgraph
66
66
dst = src.data ;
67
67
}
68
68
69
+ // Int
70
+ SOT_TO_ROS_IMPL (int )
71
+ {
72
+ dst.data = src;
73
+ }
74
+
75
+ ROS_TO_SOT_IMPL (int )
76
+ {
77
+ dst = src.data ;
78
+ }
79
+
69
80
// Unsigned
70
81
SOT_TO_ROS_IMPL (unsigned int )
71
82
{
@@ -229,6 +240,7 @@ namespace dynamicgraph
229
240
230
241
DG_BRIDGE_MAKE_SHPTR_IMPL (bool );
231
242
DG_BRIDGE_MAKE_SHPTR_IMPL (double );
243
+ DG_BRIDGE_MAKE_SHPTR_IMPL (int );
232
244
DG_BRIDGE_MAKE_SHPTR_IMPL (unsigned int );
233
245
DG_BRIDGE_MAKE_SHPTR_IMPL (Vector);
234
246
DG_BRIDGE_MAKE_SHPTR_IMPL (specific::Vector3);
Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ namespace dynamicgraph
84
84
entity.add <double > (signal, topic);
85
85
else if (type == " unsigned" )
86
86
entity.add <unsigned int > (signal, topic);
87
+ else if (type == " int" )
88
+ entity.add <int > (signal, topic);
87
89
else if (type == " matrix" )
88
90
entity.add <Matrix> (signal, topic);
89
91
else if (type == " vector" )
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ namespace dynamicgraph
5
5
6
6
const char * SotToRos<bool >::signalTypeName = " bool" ;
7
7
const char * SotToRos<double >::signalTypeName = " Double" ;
8
+ const char * SotToRos<int >::signalTypeName = " int" ;
8
9
const char * SotToRos<unsigned int >::signalTypeName = " Unsigned" ;
9
10
const char * SotToRos<Matrix>::signalTypeName = " Matrix" ;
10
11
const char * SotToRos<Vector>::signalTypeName = " Vector" ;
Original file line number Diff line number Diff line change 8
8
# include < std_msgs/Bool.h>
9
9
# include < std_msgs/Float64.h>
10
10
# include < std_msgs/UInt32.h>
11
+ # include < std_msgs/Int32.h>
11
12
# include " dynamic_graph_bridge_msgs/Matrix.h"
12
13
# include " dynamic_graph_bridge_msgs/Vector.h"
13
14
@@ -121,6 +122,30 @@ namespace dynamicgraph
121
122
}
122
123
};
123
124
125
+ template <>
126
+ struct SotToRos <int >
127
+ {
128
+ typedef int sot_t ;
129
+ typedef std_msgs::Int32 ros_t ;
130
+ typedef std_msgs::Int32ConstPtr ros_const_ptr_t ;
131
+ typedef dynamicgraph::Signal<sot_t , int > signal_t ;
132
+ typedef dynamicgraph::SignalPtr<sot_t , int > signalIn_t;
133
+ typedef boost::function<sot_t & (sot_t &, int )> callback_t ;
134
+
135
+ static const char * signalTypeName;
136
+
137
+ template <typename S>
138
+ static void setDefault (S& s)
139
+ {
140
+ s.setConstant (0 );
141
+ }
142
+
143
+ static void setDefault (sot_t & s)
144
+ {
145
+ s = 0 ;
146
+ }
147
+ };
148
+
124
149
template <>
125
150
struct SotToRos <Matrix>
126
151
{
You can’t perform that action at this time.
0 commit comments