-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing data of different type (CON-24) #39
Comments
Hi @ilya1725 ,
It should work. The scripting layer will try to convert any number to the right type. Can you send a reproducer so i can debug the issue?
I agree: we are aware of this issue, we just did not get around of doing it yet. I created an internal request CON-24 (for future reference) |
An example file attached. It is modified
|
Hello @ilya1725 , The return value for now has not meaning. We will add return code when we implement CON-24. As for the example you attached, let me explain what is happening: In the example, if I set the dictionary in this way:
Everything works. The receiver gets all the data (including shapesize = 345) But if i set the shapesize field as a double:
But if i change the dictionary to be
The receiver won't get shapesize (or better it will be set to '0'). The problem is in the way the json parser works. shapesize is defined as a long in the XML file. But your dictionary has a double. So we do not set that field. As for the write() operation, unfortunately we are not reporting errors all the way to the python layer yet. The setNumber api works because it threats all the number the same way and does a conversion internally. So is not the write operations that fails (it a single operation for the all sample.. not field to field) but the set that fails. Does the explanation make sense to you? |
@gianpiero it does explain the error, thank you. My concern was that |
@ilya1725 i think we have to decide internally what to do with the types.. is it an error to try to set a long using a json_double? or we should do it anyway (like we do with setNumber()) ? and, if it is an error, we should report it when you try to set it! This is very good conversation: thanks! I will bring this up with the team! |
I have the following data structure defined in the XML file for commands:
When I explicitly set the data as double, like this:
The command is being set fine. However, if the data is set like this:
it isn't sent. I use the
python code to write DDS commands.
I have two questions:
self._command_writer.write()
? It is very inconvenient/dangerous for the API to just accept a command and provide no status back.The text was updated successfully, but these errors were encountered: