Skip to content

Commit

Permalink
add no_delay parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeferguson committed May 20, 2015
1 parent 8077e01 commit 2d0dfba
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/GraftParameterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,17 @@ void GraftParameterManager::loadParameters(
odom->setName(topic_name);
topics.push_back(odom);

// Should we specify nodelay so that packets arrive without delay
ros::TransportHints hints;
bool tcp_nodelay;
if (tnh.getParam("no_delay", tcp_nodelay))
{
if (tcp_nodelay)
hints.tcpNoDelay();
}

// Subscribe to topic
ros::Subscriber sub = n_.subscribe(full_topic, queue_size_, &GraftOdometryTopic::callback, odom);
ros::Subscriber sub = n_.subscribe(full_topic, queue_size_, &GraftOdometryTopic::callback, odom, hints);
subs.push_back(sub);

// Parse rest of parameters
Expand All @@ -273,13 +282,22 @@ void GraftParameterManager::loadParameters(
continue;
}

// Create Odometry object
// Create Imu object
boost::shared_ptr<GraftImuTopic> imu(new GraftImuTopic());
imu->setName(topic_name);
topics.push_back(imu);

// Should we specify nodelay so that packets arrive without delay
ros::TransportHints hints;
bool tcp_nodelay;
if (tnh.getParam("no_delay", tcp_nodelay))
{
if (tcp_nodelay)
hints.tcpNoDelay();
}

// Subscribe to topic
ros::Subscriber sub = n_.subscribe(full_topic, queue_size_, &GraftImuTopic::callback, imu);
ros::Subscriber sub = n_.subscribe(full_topic, queue_size_, &GraftImuTopic::callback, imu, hints);
subs.push_back(sub);

// Parse rest of parameters
Expand Down

0 comments on commit 2d0dfba

Please sign in to comment.