-
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
Echosounder S500 - ping-python implementation ? #142
Comments
Hi @Tchiimy :-) We're happy for people to contribute extensions or new device types to the ping protocol, but manually modifying the auto-generated files (instead of the protocol and/or the template files) is not the recommended approach for doing so, and makes it hard to determine whether there's an error in your code implementation or in the way you tried to specify the messages. I'd recommend modifying the relevant protocol definition file(s) instead (in the I would also note that the API docs you linked to specify the S500 supports most of the Ping1D messages, but isn't clear which messages or fields it doesn't support, which makes it harder to know whether a proposed S500 definition file is correct. |
Hi @ES-Alexander :-) Thanks for your answer, for the context we were mainly trying to implement the functions We "manually modified" the definitions.py by adding:
The pingmessage.py with: And the ping1d.py with:
We didn't knew about the generation method, if I understood I need to add the modifications in ping1d.json and then run the src/generate-markdown.py right ? Or is it better to separate the devices and make a S500.json file instead ? |
If it's just for personal use (and you know you're not going to accidentally use the S500-exclusive methods when communicating with a device which only implements the Ping1D protocol) then directly extending the Ping1D file is the simplest approach to get something that works. If you're wanting to contribute to the ping-protocol repository and/or the ping-python library then keeping the extra messages separate makes sense, to avoid confusion over which messages each device supports. Then you'd want to make a file
That one is for documentation of ping-protocol. In the ping-python repo the file you want to run is |
Okay thanks for the information, I'll try to do it the clean way so that someone else won't have to do it again ! If I understood, I had to create a separated json file where I put the functions from the api pingS500.json
Then I tried to create the generate/templates/s500.py.in
To be honest I've never used .py.in files and I'm a little lost on this, could someone give a look at it ? Then after I need to run generate/generate-python.py and that's all ? |
Okay I've made a try with this json file: From the api documentation I made "set_ping_param" like:
I put profile6t and distance2 in a "response" category because I'm not sure how am I supposed to define them. Could you help me with this ? Then I made this pings500.py.in file:
And at the end I get this pings500.py file:
Could you give a look at the json and the py.in to be sure I made no mistakes ? |
We do not support response category, if the messages are being received from the sensor, they should be in the get category, if you look the python file, you'll see that there is no profile6. |
Okay so when I look at the api-doc at the set_ping_params function there is the report_id description saying : And then the packet types distance2 and profile6_t are defined after in the documentation. So how should I organize my .json or .py.in file to implement correctly this ? I suppose we have to put the distance2 and profile6_t somewhere so that the set_ping_parameters can call it properly ? Or is there something to change in the brping\pingmessage.py ?
|
Hi @Tchiimy, to help with your work, can you provide a branch or a PR that shares your changes ? With that we will be able to run the code and see if your approach will work. |
…ssue bluerobotics#142) - Implemented functions for S500 API by referencing pings500.json. - Unsure about the correct category for profile6_t and distance2. - Created `pings500.py.in` to inherit from ping1D (copied from ping1d.py.in) - Updated `pingmessage.py` with variables_msgs for profile6_t and distance2. - Modified `generate-markdown.py` and `generate-python.py` to include S500. - Ran these scripts to generate the necessary files. This implementation is a starting point and will require corrections or improvements.
Hello,
I'm trying to use the functions you are defining in this api related to the S500 echosounder.
From what I understood the ping-python library is "general" but I tried to make some modifications in the definitions.py and ping1D.py to add these functions for the api:
I tried to manually add the definitions and functions in the library:
definitions.py:
and pind1D.py:
Then I made a basic test with my S500:
And got theses output:
I send you the modified files if you require it:
test (2).zip
Did I missed something in my try ?
The text was updated successfully, but these errors were encountered: