2 #include <mrpt/core/exceptions.h> 8 #include <mvsim/mvsim-msgs/GenericAnswer.pb.h> 9 #include <mvsim/mvsim-msgs/SrvSetPose.pb.h> 10 #include <mvsim/mvsim-msgs/SrvSetPoseTwist.pb.h> 12 int main(
int argc,
char** argv)
19 for (
int i = 0; i < 20; i++)
22 mvsim_msgs::SrvSetPose req;
24 req.set_objectid(
"r1");
25 req.mutable_pose()->set_x(i * 0.50);
26 req.mutable_pose()->set_y(0.0);
27 req.mutable_pose()->set_z(0.0);
28 req.mutable_pose()->set_yaw(0.0);
29 req.mutable_pose()->set_pitch(0.0);
30 req.mutable_pose()->set_roll(0.0);
32 mvsim_msgs::GenericAnswer ans;
35 std::cout <<
"called service. Input:\n" 36 << req.DebugString() <<
"Response:\n" 37 << ans.DebugString() << std::endl;
39 std::this_thread::sleep_for(std::chrono::milliseconds(1000));
44 catch (
const std::exception& e)
46 std::cerr << mrpt::exception_to_str(e);
int main(int argc, char **argv)
void callService(const std::string &serviceName, const INPUT_MSG_T &input, OUTPUT_MSG_T &output)