Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cobot1_TRON_testing
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Christoph Schröter
cobot1_TRON_testing
Commits
345c31de
Commit
345c31de
authored
3 years ago
by
Christoph Schröter
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
c6ac7a35
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/tron_adapter.h
+3
-4
3 additions, 4 deletions
include/tron_adapter.h
src/tron_adapter.cpp
+1
-1
1 addition, 1 deletion
src/tron_adapter.cpp
with
4 additions
and
5 deletions
include/tron_adapter.h
+
3
−
4
View file @
345c31de
...
@@ -104,7 +104,7 @@ struct Mapping {
...
@@ -104,7 +104,7 @@ struct Mapping {
Channel
channel
=
Channel
(
""
,
0
,
true
);
// TRON channel
Channel
channel
=
Channel
(
""
,
0
,
true
);
// TRON channel
// Callback used if TRON sends some message
// Callback used if TRON sends some message
// output callbacks must be specified when subscribing to topics
// output callbacks must be specified when subscribing to topics
void
(
*
input_callback
)
(
Mapping
&
map
,
int32_t
*
)
=
nullptr
;
boost
::
function
<
void
(
Mapping
&
map
,
int32_t
*
)
>
input_callback
=
0
;
// note: since ROS messages can be complex, using byte positions might be cumbersome to use
// note: since ROS messages can be complex, using byte positions might be cumbersome to use
// it is easy to implement custom callbacks using ROS message types
// it is easy to implement custom callbacks using ROS message types
...
@@ -258,7 +258,7 @@ struct TRON_Adapter {
...
@@ -258,7 +258,7 @@ struct TRON_Adapter {
pub
.
publish
(
ptr
);
pub
.
publish
(
ptr
);
return
;
return
;
}
}
throw
"did not find publisher
for topic
"
;
throw
"did not find publisher"
;
}
}
/**
/**
...
@@ -293,7 +293,6 @@ struct TRON_Adapter {
...
@@ -293,7 +293,6 @@ struct TRON_Adapter {
publish_to_topic
<
T
>
(
map
.
topic
,
shared_ptr
);
publish_to_topic
<
T
>
(
map
.
topic
,
shared_ptr
);
}
}
/**
/**
* callback reports to TRON like defined in byte-mappings
* callback reports to TRON like defined in byte-mappings
* note: this callback reports to all channels associated with calling topic
* note: this callback reports to all channels associated with calling topic
...
...
This diff is collapsed.
Click to expand it.
src/tron_adapter.cpp
+
1
−
1
View file @
345c31de
...
@@ -308,7 +308,7 @@ void TRON_Adapter::process_TRONs_msgs(){
...
@@ -308,7 +308,7 @@ void TRON_Adapter::process_TRONs_msgs(){
for
(
Mapping
&
map
:
mappings
)
for
(
Mapping
&
map
:
mappings
)
if
(
map
.
channel
.
name
==
chan
->
name
&&
map
.
channel
.
is_input
)
{
if
(
map
.
channel
.
name
==
chan
->
name
&&
map
.
channel
.
is_input
)
{
if
(
map
.
input_callback
!=
nullptr
)
if
(
!
map
.
input_callback
.
empty
()
)
map
.
input_callback
(
map
,
vals
);
map
.
input_callback
(
map
,
vals
);
else
throw
"no callback declared"
;
else
throw
"no callback declared"
;
}
}
...
...
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