33 #include <gtest/gtest.h> 40 TEST(InteractiveMarkerServer, addRemove)
46 visualization_msgs::InteractiveMarker int_marker;
47 int_marker.name =
"marker1";
50 geometry_msgs::Pose pose;
51 pose.orientation.w = 1.0;
55 ASSERT_TRUE( server.
get(
"marker1", int_marker) );
58 ASSERT_TRUE( server.
get(
"marker1", int_marker) );
60 ASSERT_TRUE( server.
erase(
"marker1" ) );
61 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
64 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
69 ASSERT_TRUE( server.
get(
"marker1", int_marker) );
71 ASSERT_TRUE( server.
erase(
"marker1" ) );
72 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
75 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
79 ASSERT_TRUE( server.
get(
"marker1", int_marker) );
82 ASSERT_TRUE( server.
get(
"marker1", int_marker) );
85 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
88 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
92 ASSERT_TRUE( server.
setPose(
"marker1", pose) );
96 ASSERT_FALSE( server.
get(
"marker1", int_marker) );
101 ASSERT_FALSE( server.
erase(
"marker1") );
104 std::this_thread::sleep_for(std::chrono::microseconds(1000));
109 int main(
int argc,
char **argv)
112 testing::InitGoogleTest(&argc, argv);
113 return RUN_ALL_TESTS();
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
boost::shared_ptr< interactive_markers::InteractiveMarkerServer > server
TEST(InteractiveMarkerServer, addRemove)
INTERACTIVE_MARKERS_PUBLIC bool get(std::string name, visualization_msgs::InteractiveMarker &int_marker) const
INTERACTIVE_MARKERS_PUBLIC void insert(const visualization_msgs::InteractiveMarker &int_marker)
INTERACTIVE_MARKERS_PUBLIC void applyChanges()
INTERACTIVE_MARKERS_PUBLIC void clear()
INTERACTIVE_MARKERS_PUBLIC bool setPose(const std::string &name, const geometry_msgs::Pose &pose, const std_msgs::Header &header=std_msgs::Header())
int main(int argc, char **argv)
INTERACTIVE_MARKERS_PUBLIC bool erase(const std::string &name)