Skip to content

Commit

Permalink
try if including callback_queue first fixes ros#1343
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Mar 14, 2018
1 parent 69daa17 commit 147b36f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions clients/roscpp/src/libros/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "ros/callback_queue.h"
#include "ros/init.h"
#include "ros/names.h"
#include "ros/xmlrpc_manager.h"
Expand All @@ -42,7 +43,6 @@
#include "ros/this_node.h"
#include "ros/network.h"
#include "ros/file_log.h"
#include "ros/callback_queue.h"
#include "ros/param.h"
#include "ros/rosout_appender.h"
#include "ros/subscribe_options.h"
Expand Down Expand Up @@ -415,9 +415,9 @@ void start()
g_internal_queue_thread = boost::thread(internalCallbackQueueThreadFunc);
getGlobalCallbackQueue()->enable();

ROSCPP_LOG_DEBUG("Started node [%s], pid [%d], bound on [%s], xmlrpc port [%d], tcpros port [%d], using [%s] time",
this_node::getName().c_str(), getpid(), network::getHost().c_str(),
XMLRPCManager::instance()->getServerPort(), ConnectionManager::instance()->getTCPPort(),
ROSCPP_LOG_DEBUG("Started node [%s], pid [%d], bound on [%s], xmlrpc port [%d], tcpros port [%d], using [%s] time",
this_node::getName().c_str(), getpid(), network::getHost().c_str(),
XMLRPCManager::instance()->getServerPort(), ConnectionManager::instance()->getTCPPort(),
Time::useSystemTime() ? "real" : "sim");

// Label used to abort if we've started shutting down in the middle of start(), which can happen in
Expand Down
10 changes: 5 additions & 5 deletions clients/roscpp/src/libros/node_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "ros/callback_queue.h"
#include "ros/node_handle.h"
#include "ros/this_node.h"
#include "ros/service.h"
#include "ros/callback_queue.h"

#include "ros/time.h"
#include "ros/rate.h"
Expand Down Expand Up @@ -119,7 +119,7 @@ NodeHandle::NodeHandle(const NodeHandle& rhs)
remappings_ = rhs.remappings_;
unresolved_remappings_ = rhs.unresolved_remappings_;

construct(rhs.namespace_, true);
construct(rhs.namespace_, true);

unresolved_namespace_ = rhs.unresolved_namespace_;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ Publisher NodeHandle::advertise(AdvertiseOptions& ops)
}
}

SubscriberCallbacksPtr callbacks(boost::make_shared<SubscriberCallbacks>(ops.connect_cb, ops.disconnect_cb,
SubscriberCallbacksPtr callbacks(boost::make_shared<SubscriberCallbacks>(ops.connect_cb, ops.disconnect_cb,
ops.tracked_object, ops.callback_queue));

if (TopicManager::instance()->advertise(ops, callbacks))
Expand Down Expand Up @@ -389,7 +389,7 @@ ServiceClient NodeHandle::serviceClient(ServiceClientOptions& ops)
return client;
}

Timer NodeHandle::createTimer(Duration period, const TimerCallback& callback,
Timer NodeHandle::createTimer(Duration period, const TimerCallback& callback,
bool oneshot, bool autostart) const
{
TimerOptions ops;
Expand Down Expand Up @@ -420,7 +420,7 @@ Timer NodeHandle::createTimer(TimerOptions& ops) const
return timer;
}

WallTimer NodeHandle::createWallTimer(WallDuration period, const WallTimerCallback& callback,
WallTimer NodeHandle::createWallTimer(WallDuration period, const WallTimerCallback& callback,
bool oneshot, bool autostart) const
{
WallTimerOptions ops;
Expand Down
2 changes: 1 addition & 1 deletion clients/roscpp/src/libros/spinner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "ros/callback_queue.h"
#include "ros/spinner.h"
#include "ros/ros.h"
#include "ros/callback_queue.h"

#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
Expand Down
6 changes: 3 additions & 3 deletions clients/roscpp/src/libros/topic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "ros/topic.h"
#include "ros/callback_queue.h"
#include "ros/topic.h"

namespace ros
{
namespace topic
{

void waitForMessageImpl(SubscribeOptions& ops,
const boost::function<bool(void)>& ready_pred,
void waitForMessageImpl(SubscribeOptions& ops,
const boost::function<bool(void)>& ready_pred,
NodeHandle& nh, ros::Duration timeout)
{
ros::CallbackQueue queue;
Expand Down
3 changes: 2 additions & 1 deletion clients/roscpp/src/libros/transport_publisher_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "ros/callback_queue.h"

#include <ros/platform.h> // platform dependendant requirements

#include "ros/transport_publisher_link.h"
Expand All @@ -45,7 +47,6 @@
#include "ros/poll_manager.h"
#include "ros/transport/transport_tcp.h"
#include "ros/timer_manager.h"
#include "ros/callback_queue.h"
#include "ros/internal_timer_manager.h"

#include <boost/bind.hpp>
Expand Down

0 comments on commit 147b36f

Please sign in to comment.