Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic_graph_bridge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
dynamic_graph_bridge
Commits
1accd8f8
Commit
1accd8f8
authored
6 years ago
by
Joseph Mirabel
Committed by
Olivier Stasse
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
RosPublish can publish booleans
parent
037dceb5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/converter.hh
+12
-0
12 additions, 0 deletions
src/converter.hh
src/ros_publish.cpp
+3
-1
3 additions, 1 deletion
src/ros_publish.cpp
src/sot_to_ros.cpp
+1
-0
1 addition, 0 deletions
src/sot_to_ros.cpp
src/sot_to_ros.hh
+25
-0
25 additions, 0 deletions
src/sot_to_ros.hh
with
41 additions
and
1 deletion
src/converter.hh
+
12
−
0
View file @
1accd8f8
...
@@ -44,6 +44,17 @@ namespace dynamicgraph
...
@@ -44,6 +44,17 @@ namespace dynamicgraph
template
<
typename
D
,
typename
S
>
template
<
typename
D
,
typename
S
>
void
converter
(
D
&
dst
,
const
S
&
src
);
void
converter
(
D
&
dst
,
const
S
&
src
);
// Boolean
SOT_TO_ROS_IMPL
(
bool
)
{
dst
.
data
=
src
;
}
ROS_TO_SOT_IMPL
(
bool
)
{
dst
=
src
.
data
;
}
// Double
// Double
SOT_TO_ROS_IMPL
(
double
)
SOT_TO_ROS_IMPL
(
double
)
{
{
...
@@ -216,6 +227,7 @@ namespace dynamicgraph
...
@@ -216,6 +227,7 @@ namespace dynamicgraph
} \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
DG_BRIDGE_MAKE_SHPTR_IMPL
(
bool
);
DG_BRIDGE_MAKE_SHPTR_IMPL
(
double
);
DG_BRIDGE_MAKE_SHPTR_IMPL
(
double
);
DG_BRIDGE_MAKE_SHPTR_IMPL
(
unsigned
int
);
DG_BRIDGE_MAKE_SHPTR_IMPL
(
unsigned
int
);
DG_BRIDGE_MAKE_SHPTR_IMPL
(
Vector
);
DG_BRIDGE_MAKE_SHPTR_IMPL
(
Vector
);
...
...
This diff is collapsed.
Click to expand it.
src/ros_publish.cpp
+
3
−
1
View file @
1accd8f8
...
@@ -78,7 +78,9 @@ namespace dynamicgraph
...
@@ -78,7 +78,9 @@ namespace dynamicgraph
const
std
::
string
&
signal
=
values
[
1
].
value
();
const
std
::
string
&
signal
=
values
[
1
].
value
();
const
std
::
string
&
topic
=
values
[
2
].
value
();
const
std
::
string
&
topic
=
values
[
2
].
value
();
if
(
type
==
"double"
)
if
(
type
==
"boolean"
)
entity
.
add
<
bool
>
(
signal
,
topic
);
else
if
(
type
==
"double"
)
entity
.
add
<
double
>
(
signal
,
topic
);
entity
.
add
<
double
>
(
signal
,
topic
);
else
if
(
type
==
"unsigned"
)
else
if
(
type
==
"unsigned"
)
entity
.
add
<
unsigned
int
>
(
signal
,
topic
);
entity
.
add
<
unsigned
int
>
(
signal
,
topic
);
...
...
This diff is collapsed.
Click to expand it.
src/sot_to_ros.cpp
+
1
−
0
View file @
1accd8f8
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
dynamicgraph
namespace
dynamicgraph
{
{
const
char
*
SotToRos
<
bool
>::
signalTypeName
=
"bool"
;
const
char
*
SotToRos
<
double
>::
signalTypeName
=
"Double"
;
const
char
*
SotToRos
<
double
>::
signalTypeName
=
"Double"
;
const
char
*
SotToRos
<
unsigned
int
>::
signalTypeName
=
"Unsigned"
;
const
char
*
SotToRos
<
unsigned
int
>::
signalTypeName
=
"Unsigned"
;
const
char
*
SotToRos
<
Matrix
>::
signalTypeName
=
"Matrix"
;
const
char
*
SotToRos
<
Matrix
>::
signalTypeName
=
"Matrix"
;
...
...
This diff is collapsed.
Click to expand it.
src/sot_to_ros.hh
+
25
−
0
View file @
1accd8f8
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
# include <boost/format.hpp>
# include <boost/format.hpp>
# include <std_msgs/Bool.h>
# include <std_msgs/Float64.h>
# include <std_msgs/Float64.h>
# include <std_msgs/UInt32.h>
# include <std_msgs/UInt32.h>
# include "dynamic_graph_bridge_msgs/Matrix.h"
# include "dynamic_graph_bridge_msgs/Matrix.h"
...
@@ -48,6 +49,30 @@ namespace dynamicgraph
...
@@ -48,6 +49,30 @@ namespace dynamicgraph
template
<
typename
SotType
>
template
<
typename
SotType
>
class
SotToRos
;
class
SotToRos
;
template
<
>
struct
SotToRos
<
bool
>
{
typedef
bool
sot_t
;
typedef
std_msgs
::
Bool
ros_t
;
typedef
std_msgs
::
BoolConstPtr
ros_const_ptr_t
;
typedef
dynamicgraph
::
Signal
<
sot_t
,
int
>
signal_t
;
typedef
dynamicgraph
::
SignalPtr
<
sot_t
,
int
>
signalIn_t
;
typedef
boost
::
function
<
sot_t
&
(
sot_t
&
,
int
)
>
callback_t
;
static
const
char
*
signalTypeName
;
template
<
typename
S
>
static
void
setDefault
(
S
&
s
)
{
s
.
setConstant
(
false
);
}
static
void
setDefault
(
sot_t
&
s
)
{
s
=
false
;
}
};
template
<
>
template
<
>
struct
SotToRos
<
double
>
struct
SotToRos
<
double
>
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment