Can you write unittests that use the parameter server?

asked 2015-10-16 06:40:57 -0500

Felix Duvallet gravatar image

updated 2015-10-16 06:43:52 -0500

I'm trying to write unittests (in python) that use the parameter server. I'd like to load some parameters from a test yaml file, and use something like the rospy.get_param() functionality.

The code under test parses information stored as ros parameters, so I to provide test input that is as close as possible to the result of get_param.

In particular, is it possible to:

  1. Run unit tests without depending/conflicting with the master parameter server (roscore may not necessarily be running)?
  2. Load parameters from a test.yaml file?
  3. Clear the parameter server between different unit tests? (to ensure each test is stateless)

I am aware the rosparam module can load parameters from a file, but it returns a list of dictionaries instead of loading the parameters into the param server (and the returned data is not compatible with get_param).

edit retag flag offensive close merge delete