ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hmm, I don't see how that ever would have worked. Maybe the author forgot to push a later commit. Anyhow, try changing that block of code to this, which actually compiles and seems to work (at least, data is published--I can't say if it's right or not):

// publish tilt angle and status
if (pub_tilt_angle.getNumSubscribers() > 0)
{
  std_msgs::Float64 angle_msg;
  angle_msg.data = tilt_angle/2;
  pub_tilt_angle.publish(angle_msg);
}

if (pub_tilt_status.getNumSubscribers() > 0)
{
  std_msgs::UInt8 status_msg;
  status_msg.data = tilt_status;
  pub_tilt_status.publish(status_msg);
}