Skip to content
Snippets Groups Projects
Commit 345c31de authored by Christoph Schröter's avatar Christoph Schröter
Browse files

No commit message

No commit message
parent c6ac7a35
Branches
Tags
No related merge requests found
...@@ -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
......
...@@ -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";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment