How to send a complex request and save a complex response (service) in ROS?
Hi I don´t have a high level in ROS so I would request your help. Last weeks I was trying to make a client for testing that package https://github.com/sniekum/dmp Alwais I had problems running it (the client) so I decided to run it by CMD
I used this commands to send the request to one of the service´s package:
rosservice call /learn_dmp_from_demo "{'demo': {'points': [{'positions': [1.05], 'velocities': [0]}, {'positions': [4.05], 'velocities': [0]}, {'positions': [6.05], 'velocities': [0]}, {'positions': [4.05], 'velocities': [0]}, {'positions': [6.55], 'velocities': [0]}, {'positions': [6.05], 'velocities': [0]}, {'positions': [5.05], 'velocities': [0]}, {'positions': [2.05], 'velocities': [0]}], 'times': [0, 0.15, 0.65, 1.3, 2.32, 3.5, 4.8, 5.9, 7]}, 'd_gains': [0.5], 'k_gains': [1.5], 'num_bases': 50}"
I got this response:
dmp_list:
-
k_gain: 1.5
d_gain: 0.5
weights: []
f_domain: [0.0, 0.02542372881355932, 0.11016949152542373, 0.22033898305084745, 0.3932203389830508, 0.5932203389830508, 0.8135593220338982, 1.0]
f_targets: [0.0, 3526.023021050232, -1212.684557129261, -707.1580492824511, 827.153942036789, -818.845524643713, -197.3391387004624, -4666.23882178427]
tau: 7.0
So It was succesfull. The question is, How can I send the request without command line? and store the response in a YAML file for using it later? I was reading about Ros Param Server and bag files and store YAML files, but I´m a little bit lost with it
Thanks a lot
Writing a node which has the service client for
learn_dmp_from_demo
is the right direction. Maybe you can share what problem you were having when writing this service client.