Ask Your Question
1

dumping parameters from c++ node

asked 2019-07-02 08:15:34 -0600

schizzz8 gravatar image

Hi all,

I have a simple question but I can't seem to find a nice solution.

My problem is the following:

I have a YAML file that stores some parameters. These parameters are loaded into the parameter server at execution time. For some reason I want to change some parameters and store them permanently in the YAML file.

That is, I retrieve a certain field of the parameter:

XmlRpc::XmlRpcValue param;
nh.getParam("param_name", param);
ROS_ASSERT(param.getType() == XmlRpc::XmlRpcValue::TypeStruct);
std::string field = static_cast<std::string>(param["field]);

and then, after modifying it, I'd like not only to set the new value in the parameter server but also to permanently store this change.

I have seen that rosparam has the dump option and I was wondering if there is an analogous function in roscpp. I'd be very glad if someone could show me how it can be done.

Thanks.

edit retag flag offensive close merge delete

Comments

1

I do not believe there is a C++ equivalent to rosparam dump

ahendrix gravatar image ahendrix  ( 2019-07-02 10:26:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-27 08:36:19 -0600

You can do that with the tool I am working on -> https://github.com/asherikov/ariles, a slightly dated version is available as a package in melodic.

edit flag offensive delete link more

Comments

Could you please expand a little on your answer? It's not apparent from the readme of that repository how this could be used to achieve what the OP describes.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-27 09:01:44 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-07-02 08:15:34 -0600

Seen: 275 times

Last updated: Jul 02 '19