37 #include <gtest/gtest.h> 52 EXPECT_EQ( 3, footprint.size() );
54 EXPECT_EQ( 1.0
f, footprint[ 0 ].x );
55 EXPECT_EQ( 1.0
f, footprint[ 0 ].y );
56 EXPECT_EQ( 0.0
f, footprint[ 0 ].z );
58 EXPECT_EQ( -1.0
f, footprint[ 1 ].x );
59 EXPECT_EQ( 1.0
f, footprint[ 1 ].y );
60 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
62 EXPECT_EQ( -1.0
f, footprint[ 2 ].x );
63 EXPECT_EQ( -1.0
f, footprint[ 2 ].y );
64 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
71 EXPECT_EQ( 3, footprint.size() );
73 EXPECT_EQ( 1.5
f, footprint[ 0 ].x );
74 EXPECT_EQ( 1.5
f, footprint[ 0 ].y );
75 EXPECT_EQ( 0.0
f, footprint[ 0 ].z );
77 EXPECT_EQ( -1.5
f, footprint[ 1 ].x );
78 EXPECT_EQ( 1.5
f, footprint[ 1 ].y );
79 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
81 EXPECT_EQ( -1.5
f, footprint[ 2 ].x );
82 EXPECT_EQ( -1.5
f, footprint[ 2 ].y );
83 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
91 EXPECT_EQ( 16, footprint.size() );
94 EXPECT_EQ( 10.0
f, footprint[ 0 ].x );
95 EXPECT_EQ( 0.0
f, footprint[ 0 ].y );
96 EXPECT_EQ( 0.0
f, footprint[ 0 ].z );
99 EXPECT_NEAR( 0.0
f, footprint[ 4 ].x, 0.0001 );
100 EXPECT_NEAR( 10.0
f, footprint[ 4 ].y, 0.0001 );
101 EXPECT_EQ( 0.0
f, footprint[ 4 ].z );
108 EXPECT_EQ( 4, footprint.size() );
110 EXPECT_EQ( 0.1
f, footprint[ 0 ].x );
111 EXPECT_EQ( 0.1
f, footprint[ 0 ].y );
112 EXPECT_EQ( 0.0
f, footprint[ 0 ].z );
114 EXPECT_EQ( -0.1
f, footprint[ 1 ].x );
115 EXPECT_EQ( 0.1
f, footprint[ 1 ].y );
116 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
118 EXPECT_EQ( -0.1
f, footprint[ 2 ].x );
119 EXPECT_EQ( -0.1
f, footprint[ 2 ].y );
120 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
122 EXPECT_EQ( 0.1
f, footprint[ 3 ].x );
123 EXPECT_EQ( -0.1
f, footprint[ 3 ].y );
124 EXPECT_EQ( 0.0
f, footprint[ 3 ].z );
131 EXPECT_EQ( 3, footprint.size() );
133 EXPECT_EQ( 1.0
f, footprint[ 0 ].x );
134 EXPECT_EQ( 2.0
f, footprint[ 0 ].y );
135 EXPECT_EQ( 0.0
f, footprint[ 0 ].z );
137 EXPECT_EQ( 3.0
f, footprint[ 1 ].x );
138 EXPECT_EQ( 4.0
f, footprint[ 1 ].y );
139 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
141 EXPECT_EQ( 5.0
f, footprint[ 2 ].x );
142 EXPECT_EQ( 6.0
f, footprint[ 2 ].y );
143 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
148 ASSERT_ANY_THROW(
Costmap2DROS cm(
"xmlrpc_fail", *tf_ ));
156 EXPECT_EQ( 16, footprint.size() );
158 EXPECT_NEAR( 0.47
f, footprint[ 0 ].x, 0.0001 );
159 EXPECT_NEAR( 0.0
f, footprint[ 0 ].y, 0.0001 );
160 EXPECT_EQ( 0.0
f, footprint[ 0 ].z );
163 int main(
int argc,
char** argv)
165 ros::init(argc, argv,
"footprint_tests_node");
173 geometry_msgs::TransformStamped base_rel_map;
175 base_rel_map.child_frame_id =
"base_link";
176 base_rel_map.header.frame_id =
"map";
180 testing::InitGoogleTest(&argc, argv);
181 return RUN_ALL_TESTS();
bool setTransform(const geometry_msgs::TransformStamped &transform, const std::string &authority, bool is_static=false)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
A ROS wrapper for a 2D Costmap. Handles subscribing to topics that provide observations about obstacl...
std::vector< geometry_msgs::Point > getRobotFootprint()
Return the current footprint of the robot as a vector of points.