1 #include <gtest/gtest.h>
4 #include <opencv2/highgui/highgui.hpp>
7 #include <ros/console.h>
8 #include <ros/package.h>
40 ROS_DEBUG_STREAM(
"Setting up... ");
48 if (
const char* original_path = ::getenv(name.
c_str()))
52 std::string package_path = ros::package::getPath(
"ed_sensor_integration");
59 ROS_INFO_STREAM(
"New " << name <<
": " << new_path);
60 ::setenv(name.c_str(), new_path.
c_str(), 1);
65 ROS_DEBUG_STREAM(
"Tearing down... ");
69 ::setenv(it->first.c_str(), it->second, 1);
71 ::unsetenv(it->first.c_str());
81 ROS_INFO_STREAM(
"Starting testsuite");
83 std::string path = ros::package::getPath(
"ed_sensor_integration");
84 path +=
"/test/test_laser_model.sdf";
90 world_model.
update(request);
94 uint num_beams = 1000;
105 geo::Pose3D test_pose(0.0, 0.0, 0.2, 0.0, 0.0, 0.0);
107 updater.
renderWorld(test_pose, world_model, sensor_ranges);
110 double timestamp = 0.0;
113 updater.
update(empty_world, sensor_ranges, test_pose, timestamp,
req);
115 int n_entities_found =
req.updated_entities.size();
116 EXPECT_EQ(n_entities_found, 3) <<
"3 entities in world, updater found " << n_entities_found;
120 int main(
int argc,
char **argv)
122 testing::InitGoogleTest(&argc, argv);
123 return RUN_ALL_TESTS();