0
$\begingroup$

Rosanswers logo

node_name1: param_name1: value param_name2: value

node_name2: param_name1: value param_name2: value

This is a yaml file,but how can we get param from yaml in our .cpp files? .getParam doesnot work. THANK YOU!


Originally posted by neil on ROS Answers with karma: 3 on 2017-08-02

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

In your launch file, put


Originally posted by vkee with karma: 127 on 2017-08-02

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by jayess on 2017-08-02:
This will load it into the Parameter Server and make the params available to your node. Now you can use getParam() to access those set params.

Comment by neil on 2017-08-02:
Thank you very much! I have solved the problems.I misunderstood the Parameter Server.Now I understand it . getParam() get params from Paramter Server ,no mater the params come from launch file or yaml file. thank you again.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Check this for cpp programming or this for python.


Originally posted by Chaos with karma: 396 on 2017-08-02

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by neil on 2017-08-02:
Thank you very much! I have solved the problems.I misunderstood the Parameter Server.Now I understand it . getParam() get params from Paramter Server ,no mater the params come from launch file or yaml file. thank you again. ROS answer is wonderful.

$\endgroup$

Your Answer

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