37 #include <gtest/gtest.h> 49 EXPECT_EQ( 3, footprint.size() );
51 EXPECT_EQ( 1.0
f, footprint[ 0 ].
x );
52 EXPECT_EQ( 1.0
f, footprint[ 0 ].
y );
53 EXPECT_EQ( 0.0
f, footprint[ 0 ].
z );
55 EXPECT_EQ( -1.0
f, footprint[ 1 ].x );
56 EXPECT_EQ( 1.0
f, footprint[ 1 ].y );
57 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
59 EXPECT_EQ( -1.0
f, footprint[ 2 ].x );
60 EXPECT_EQ( -1.0
f, footprint[ 2 ].y );
61 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
68 EXPECT_EQ( 3, footprint.size() );
70 EXPECT_EQ( 1.5
f, footprint[ 0 ].
x );
71 EXPECT_EQ( 1.5
f, footprint[ 0 ].
y );
72 EXPECT_EQ( 0.0
f, footprint[ 0 ].
z );
74 EXPECT_EQ( -1.5
f, footprint[ 1 ].x );
75 EXPECT_EQ( 1.5
f, footprint[ 1 ].y );
76 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
78 EXPECT_EQ( -1.5
f, footprint[ 2 ].x );
79 EXPECT_EQ( -1.5
f, footprint[ 2 ].y );
80 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
88 EXPECT_EQ( 16, footprint.size() );
91 EXPECT_EQ( 10.0
f, footprint[ 0 ].
x );
92 EXPECT_EQ( 0.0
f, footprint[ 0 ].
y );
93 EXPECT_EQ( 0.0
f, footprint[ 0 ].
z );
96 EXPECT_NEAR( 0.0
f, footprint[ 4 ].x, 0.0001 );
97 EXPECT_NEAR( 10.0
f, footprint[ 4 ].y, 0.0001 );
98 EXPECT_EQ( 0.0
f, footprint[ 4 ].z );
105 EXPECT_EQ( 4, footprint.size() );
107 EXPECT_EQ( 0.1
f, footprint[ 0 ].
x );
108 EXPECT_EQ( 0.1
f, footprint[ 0 ].
y );
109 EXPECT_EQ( 0.0
f, footprint[ 0 ].
z );
111 EXPECT_EQ( -0.1
f, footprint[ 1 ].x );
112 EXPECT_EQ( 0.1
f, footprint[ 1 ].y );
113 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
115 EXPECT_EQ( -0.1
f, footprint[ 2 ].x );
116 EXPECT_EQ( -0.1
f, footprint[ 2 ].y );
117 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
119 EXPECT_EQ( 0.1
f, footprint[ 3 ].x );
120 EXPECT_EQ( -0.1
f, footprint[ 3 ].y );
121 EXPECT_EQ( 0.0
f, footprint[ 3 ].z );
128 EXPECT_EQ( 3, footprint.size() );
130 EXPECT_EQ( 1.0
f, footprint[ 0 ].
x );
131 EXPECT_EQ( 2.0
f, footprint[ 0 ].
y );
132 EXPECT_EQ( 0.0
f, footprint[ 0 ].
z );
134 EXPECT_EQ( 3.0
f, footprint[ 1 ].x );
135 EXPECT_EQ( 4.0
f, footprint[ 1 ].y );
136 EXPECT_EQ( 0.0
f, footprint[ 1 ].z );
138 EXPECT_EQ( 5.0
f, footprint[ 2 ].x );
139 EXPECT_EQ( 6.0
f, footprint[ 2 ].y );
140 EXPECT_EQ( 0.0
f, footprint[ 2 ].z );
145 ASSERT_ANY_THROW(
Costmap2DROS cm(
"xmlrpc_fail", *tf_ ));
153 EXPECT_EQ( 16, footprint.size() );
155 EXPECT_NEAR( 0.47
f, footprint[ 0 ].
x, 0.0001 );
156 EXPECT_NEAR( 0.0
f, footprint[ 0 ].
y, 0.0001 );
157 EXPECT_EQ( 0.0
f, footprint[ 0 ].
z );
160 int main(
int argc,
char** argv)
162 ros::init(argc, argv,
"footprint_tests_node");
175 testing::InitGoogleTest(&argc, argv);
176 return RUN_ALL_TESTS();
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE const tfScalar & x() const
TFSIMD_FORCE_INLINE const tfScalar & z() const
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.