Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Distributed Autonomous Networked Control Lab
MicroCART
Commits
904327cb
Commit
904327cb
authored
8 years ago
by
Jake Drahos
Browse files
Options
Downloads
Patches
Plain Diff
Replaced lambda with bind
PLEASE be supported on ground station
parent
f2efc3e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
groundStation/src/vrpn_tracker.cpp
+17
-10
17 additions, 10 deletions
groundStation/src/vrpn_tracker.cpp
with
17 additions
and
10 deletions
groundStation/src/vrpn_tracker.cpp
+
17
−
10
View file @
904327cb
#include
<iostream>
#include
<algorithm>
#include
<functional>
#include
"vrpn_Tracker.h"
#include
"quat.h"
...
...
@@ -111,6 +112,20 @@ struct ucart_vrpn_tracker {
microcart
::
Tracker
*
t
;
};
void
cb_wrapper
(
void
(
*
cb
)(
struct
ucart_vrpn_TrackerData
*
),
const
microcart
::
TrackerData
&
td
)
{
struct
ucart_vrpn_TrackerData
data
;
data
.
x
=
td
.
x
;
data
.
y
=
td
.
y
;
data
.
z
=
td
.
z
;
data
.
pitch
=
td
.
pitch
;
data
.
roll
=
td
.
roll
;
data
.
yaw
=
td
.
yaw
;
data
.
fps
=
td
.
fps
;
(
*
cb
)(
&
data
);
}
extern
"C"
{
struct
ucart_vrpn_tracker
*
ucart_vrpn_tracker_createInstance
(
...
...
@@ -135,16 +150,8 @@ extern "C"
void
(
*
cb
)(
struct
ucart_vrpn_TrackerData
*
))
{
try
{
inst
->
t
->
addCallback
([
cb
](
const
microcart
::
TrackerData
&
td
)
{
struct
ucart_vrpn_TrackerData
data
;
data
.
x
=
td
.
x
;
data
.
y
=
td
.
y
;
data
.
z
=
td
.
z
;
data
.
pitch
=
td
.
pitch
;
data
.
roll
=
td
.
roll
;
data
.
yaw
=
td
.
yaw
;
(
*
cb
)(
&
data
);
});
auto
new_cb
=
bind
(
cb_wrapper
,
cb
,
std
::
placeholders
::
_1
);
inst
->
t
->
addCallback
(
new_cb
);
}
catch
(...)
{
return
-
1
;
}
...
...
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