acceptancetest_publish_test.cpp
Go to the documentation of this file.
1 // Copyright (c) 2019 Pilz GmbH & Co. KG
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program. If not, see <https://www.gnu.org/licenses/>.
15 
16 #include <ros/ros.h>
17 #include <ros/duration.h>
18 #include <sensor_msgs/LaserScan.h>
19 
20 double constexpr TIMEOUT_LENGTH_S = 100.0;
21 
22 int main(int argc, char** argv)
23 {
24  ros::init(argc, argv, "acceptancetest_publish_test");
25 
26  if (ros::topic::waitForMessage<sensor_msgs::LaserScan>("laser_scanner/scan", ros::Duration(TIMEOUT_LENGTH_S)) ==
27  nullptr)
28  {
29  ROS_ERROR("TIMEOUT!");
30  return 1;
31  }
32  else
33  {
34  return 0;
35  }
36 }
double constexpr TIMEOUT_LENGTH_S
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
#define ROS_ERROR(...)


psen_scan
Author(s):
autogenerated on Mon Feb 28 2022 23:16:20