35 #include <std_msgs/Time.h>
37 #include <multisense_ros/StampedPps.h>
48 void ppsCB(
const pps::Header& header,
void* userDataP)
49 {
reinterpret_cast<Pps*
>(userDataP)->ppsCallback(header); }
63 if (Status_Ok != status) {
64 ROS_ERROR(
"Camera: failed to query device info: %s",
65 Channel::statusString(status));
70 ROS_INFO(
"hardware does not support PPS");
76 ROS_ERROR(
"PPS support requires sensor firmware v2.2 or greater (sensor is running v%d.%d)\n",
107 std_msgs::Time pps_msg;
109 multisense_ros::StampedPps stamped_pps_msg;
112 header.sensorTime % 1000000000ll);
115 stamped_pps_msg.data = pps_msg.data;
118 1000 *
header.timeMicroSeconds);
127 const int32_t old_sub_count = __sync_fetch_and_add(&
subscribers_, 1);
130 if (old_sub_count == 0)
133 if (Status_Ok != status)
135 ROS_ERROR(
"Pps: failed to start stream: %s", Channel::statusString(status));
142 const int32_t old_sub_count = __sync_fetch_and_sub(&
subscribers_, 1);
145 if (old_sub_count == 1)
148 if (Status_Ok != status)
150 ROS_ERROR(
"Pps: failed to stop stream: %s", Channel::statusString(status));