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
a6c3db3b
Commit
a6c3db3b
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Add failback signal to RosTfListener
parent
3d2a8464
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ros_tf_listener.cpp
+3
-1
3 additions, 1 deletion
src/ros_tf_listener.cpp
src/ros_tf_listener.hh
+12
-2
12 additions, 2 deletions
src/ros_tf_listener.hh
with
15 additions
and
3 deletions
src/ros_tf_listener.cpp
+
3
−
1
View file @
a6c3db3b
...
...
@@ -11,10 +11,12 @@ sot::MatrixHomogeneous& TransformListenerData::getTransform(
try
{
transform
=
buffer
.
lookupTransform
(
toFrame
,
fromFrame
,
rosTime
);
}
catch
(
const
tf2
::
TransformException
&
ex
)
{
res
.
setIdentity
();
std
::
ostringstream
oss
;
oss
<<
"Enable to get transform at time "
<<
time
<<
": "
<<
ex
.
what
();
entity
->
SEND_WARNING_STREAM_MSG
(
oss
.
str
());
failbackSig
.
recompute
(
time
);
res
=
failbackSig
.
accessCopy
();
return
res
;
}
...
...
This diff is collapsed.
Click to expand it.
src/ros_tf_listener.hh
+
12
−
2
View file @
a6c3db3b
...
...
@@ -8,6 +8,7 @@
#include
<dynamic-graph/entity.h>
#include
<dynamic-graph/signal.h>
#include
<dynamic-graph/signal-ptr.h>
#include
<dynamic-graph/command-bind.h>
#include
<sot/core/matrix-geometry.hh>
...
...
@@ -18,19 +19,28 @@ class RosTfListener;
namespace
internal
{
struct
TransformListenerData
{
typedef
Signal
<
sot
::
MatrixHomogeneous
,
int
>
signal_t
;
typedef
SignalPtr
<
sot
::
MatrixHomogeneous
,
int
>
signalIn_t
;
RosTfListener
*
entity
;
tf2_ros
::
Buffer
&
buffer
;
const
std
::
string
toFrame
,
fromFrame
;
geometry_msgs
::
TransformStamped
transform
;
signal_t
signal
;
signalIn_t
failbackSig
;
TransformListenerData
(
RosTfListener
*
e
,
tf2_ros
::
Buffer
&
b
,
const
std
::
string
&
to
,
const
std
::
string
&
from
,
const
std
::
string
&
signame
)
:
entity
(
e
),
buffer
(
b
),
toFrame
(
to
),
fromFrame
(
from
),
signal
(
signame
)
{
:
entity
(
e
)
,
buffer
(
b
)
,
toFrame
(
to
)
,
fromFrame
(
from
)
,
signal
(
signame
)
,
failbackSig
(
NULL
,
signame
+
"_failback"
)
{
signal
.
setFunction
(
boost
::
bind
(
&
TransformListenerData
::
getTransform
,
this
,
_1
,
_2
));
failbackSig
.
setConstant
(
sot
::
MatrixHomogeneous
::
Identity
());
}
sot
::
MatrixHomogeneous
&
getTransform
(
sot
::
MatrixHomogeneous
&
res
,
int
time
);
...
...
@@ -79,7 +89,7 @@ class RosTfListener : public Entity {
TransformListenerData
*
tld
=
new
TransformListenerData
(
this
,
buffer
,
to
,
from
,
signalName
.
str
());
signalRegistration
(
tld
->
signal
);
signalRegistration
(
tld
->
signal
<<
tld
->
failbackSig
);
listenerDatas
[
signame
]
=
tld
;
}
...
...
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