def test_valid_variables(self):
ENVIRONMENTAL_VARIABLES = frozenset(
VariableInfo.from_dict(d)
for d in rospy.get_param("/var_types/environment_variables").itervalues())
RECIPE_VARIABLES = frozenset(
VariableInfo.from_dict(d)
for d in rospy.get_param("/var_types/recipe_variables").itervalues())
VALID_VARIABLES = ENVIRONMENTAL_VARIABLES.union(RECIPE_VARIABLES)
print(VALID_VARIABLES)
assert len(VALID_VARIABLES) == 19
# This builds a dictionary of publisher instances using a
# "dictionary comprehension" (syntactic sugar for building dictionaries).
# The constant has to be declared here because get_message_class
# needs to be called after the node is initialized.
PUBLISHERS = {
variable.name: rospy.Publisher(
"{}/desired".format(variable.name),
get_message_class(variable.type),
queue_size=10)
for variable in VALID_VARIABLES
}
test_load_env_var_types.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录