Go to the documentation of this file.
38 #include "std_msgs/String.h"
39 #include "std_msgs/Int32.h"
42 #include <gtest/gtest.h>
53 std_msgs::Int32::Ptr
s = msg->instantiate<std_msgs::Int32>();
63 std_msgs::String::Ptr
s = msg->instantiate<std_msgs::String>();
64 if (
s->data ==
"chatter")
75 std_msgs::String::Ptr
s = msg->instantiate<std_msgs::String>();
76 printf(
"Got data: %s",
s->data.c_str());
77 if (
s->data ==
"abc123")
81 printf(
"Instantiate failed!\n");
165 int main(
int argc,
char **argv){
166 ros::init(argc, argv,
"test_shapeshifter");
168 testing::InitGoogleTest(&argc, argv);
169 return RUN_ALL_TESTS();
void messageCallbackLoopback(const topic_tools::ShapeShifter::ConstPtr &msg)
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spinOnce()
void messageCallbackInt(const topic_tools::ShapeShifter::ConstPtr &msg)
void publish(const boost::shared_ptr< M > &message) const
Publisher advertise(AdvertiseOptions &ops)
int main(int argc, char **argv)
TEST_F(ShapeShifterSubscriber, testInstantiateString)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
void messageCallbackString(const topic_tools::ShapeShifter::ConstPtr &msg)
topic_tools
Author(s): Morgan Quigley, Brian Gerkey, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 03:00:05