Hi,
I've a piece of software, that I would like to be ros-indipendent (is a library for fuzzy reasoning)
Now, the results of reasoning is a set of variables with the associated values to them. Now, my implementation of the reasoner gives in output a map<string, double>. But i can use a vector (or an array) of structs.
now, i want to setup my reasoning service, so I've defined two messages, the Input message and the output message. And obviously, in my service I've got two variable as variable lenght arrays:
Reasoning.srv
#definition of the basic Reasoning service
#The input variable for the reasoning
InputVariable[] inputs
---
#The defuzzyfied output
DefuzzyfiedOutput[] results
DefuzzyfiedOutput.msg
#Definition of the defuzzyfied output type
#the name of the input variable
string name
#the defuzzyfied value
float64 value
now, when sending the results, I've to iterate over the map and set each pair of the DefuzzyfiedOutput struct, and then add it to the output vector.
there is a way to avoid that? I would like to set the map/vector/whatever when sending the message, I don't think is very smart to iterate over a map, and then let ros iterate again over the same thing to send the message.
I don't knowif it's clear what I would like to do... but I hope so...
Obviously I would like to avoid using the message as output element of my reasoning service, because I would like it to be independent from ros...
thank you very much :)
Originally posted by Boris_il_forte on ROS Answers with karma: 96 on 2013-11-23
Post score: 0