37 #include <boost/lexical_cast.hpp> 38 #include "polled_camera/GetPolledImage.h" 40 int main(
int argc,
char** argv)
44 printf(
"Usage: %s <Hz> camera:=<namespace> output:=<namespace>\n", argv[0]);
47 double hz = boost::lexical_cast<
double>(argv[1]);
50 std::string service_name = nh.resolveName(
"camera") +
"/request_image";
51 ros::ServiceClient client = nh.serviceClient<polled_camera::GetPolledImage>(service_name);
53 polled_camera::GetPolledImage::Request req;
54 polled_camera::GetPolledImage::Response rsp;
55 req.response_namespace = nh.resolveName(
"output");
59 if (client.
call(req, rsp)) {
60 std::cout <<
"Timestamp: " << rsp.stamp << std::endl;
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
int main(int argc, char **argv)