0
$\begingroup$

Rosanswers logo

with an example,

AddTwoInts.srv

int64 a

int64 b


int64 sum

client.cpp

srv.request.a =atoll(argv[1]);

srv. request.b =atoll(argv[2]);

/* which takes the value during run time */

can I assign the value of a and b during writing of the code? pre assign of the value to the variable ?


Originally posted by rama_bhuyan on ROS Answers with karma: 11 on 2018-08-21

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Yes. Like any other variable, you can assign any value to the service request parameters. (could come from user input, a file, or just a pre-assigned value).


Originally posted by ahendrix with karma: 47576 on 2018-08-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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