0
$\begingroup$

Rosanswers logo

hi, I want to call a service from node cpp file. is it possible?

I want to create my own node and use a service from another package. what is the aim of ros::service::call?


Originally posted by Maurizio88 on ROS Answers with karma: 155 on 2012-01-26

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Have a look at this tutorial.


Originally posted by Lorenz with karma: 22731 on 2012-01-26

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by Lorenz on 2012-02-09:
The tutorial contains an example showing how to call a service with a service proxy. Look at 1.2 Writing the Client Node. If you really need to use ros::service::call, replace the client.call(srv) by ros::service::call("add_two_ints, srv).

Comment by Maurizio88 on 2012-02-09:
thanks, but i need at least one example!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.