webots icon indicating copy to clipboard operation
webots copied to clipboard

recognitionColors to all objects

Open Simon-Steinmann opened this issue 4 years ago • 5 comments
trafficstars

Description This PR add the recognitionColors field to all .proto files in projects/objects/ that have a BaseNode of the Type Solid, and dont contain recognitionColors yet or the tag hidden

I added a script scripts\proto_splitter\protoBatchEdit.py which did the conversion as a batch. It is based on the proto2mesh script Olivier and I created a while back. It is not very cleaned up and documented, but it works and might come in handy in the future.

Simon-Steinmann avatar May 29 '21 23:05 Simon-Steinmann

* alignment of newly added PROTO header parameters should be fixed in all the files: field name, default value and description should be correctly aligned with the other existing fields

This will be a bit more tricky, as they are different for every file, but I will try to figure something out.

* Objects documentation should be regenerated by running the script `docs/guide/generate_objects_doc.py`

I simply run the script with no arguments, after the altered Proto files are in projects/objects?

Simon-Steinmann avatar May 31 '21 23:05 Simon-Steinmann

I also included 'Robot' basenodes in this one. Issues should be adressed.

Simon-Steinmann avatar Jun 01 '21 00:06 Simon-Steinmann

I ran python .\generate_objects_doc.py , however it does not seem to update the proto headers in the .md files. Perhaps you can try it out and see for yourself.

Simon-Steinmann avatar Jun 01 '21 01:06 Simon-Steinmann

I figured it out. The script uses the WEBOTS_HOME directory, not the directory relative to the script itself. My webots git repository is not my WEBOTS_HOME env_var. Setting it manually before executing the script worked. Perhaps changing the script to do a relative import of proto files might be the better way to go.

Simon-Steinmann avatar Jun 01 '21 01:06 Simon-Steinmann

Setting it manually before executing the script worked. Perhaps changing the script to do a relative import of proto files might be the better way to go.

It is fundamentally wrong to work on a Webots repository if the WEBOTS_HOME is set to a different location. Many different functionalities relies on WEBOTS_HOME and you will have a set of other issues doing it. So it is not necessary to change the documentation script and use relative import of files.

stefaniapedrazzi avatar Jun 02 '21 07:06 stefaniapedrazzi

I am closing this stalled PR for now. Feel free to re-open if needed.

omichel avatar Nov 01 '22 16:11 omichel