Message thread on Webots Modeling

Can I build .proto file?by Kun Kun (33) 2018-04-17 04:31:32
I build the 3D model of the my robot in Solidworks. And I want to know how to convert this model into .proto model? Is there any instruction? thank you.
Best Regards.
Kun
Re: Can I build .proto file?by Stefania Pedrazzi (Webots PRO - 536) 2018-04-18 10:59:54
Hi Kun,

The PROTO format is an extension of the Webots WBT format.
So first I suggest you to import your model in Webots using the VRML format and the item option "Import VRML97" from the File menu. Once your model looks correct, then you can create the PROTO file.

At the moment, PROTO files has to be created manually.
Here are the required steps:
1. create <YourModel>.proto file with a default PROTO interface. For example for "MyProto.proto" (file and PROTO name have to match):
#VRML_SIM R2018a utf8
# You can add here the description of your model.

PROTO MyProto [
  # this is the interface containing the open fields visible in the scene tree
]
{
  # this is the body section: copy here your node definition
}
2. copy your node definition from the Webots WBT file and paste it to the PROTO body section marked in the example above
3. add the desired fields in the PROTO interface and link them to the nodes in the body section using the IS keywork or Lua statements

Please refer to the documentation of PROTO nodes for further details, examples and instruction about how to use the IS keywork or Lua.

Don't hesitate to ask if you have issues.

Best regards,
Stefania
Re: Can I build .proto file?by Kun Kun (33) 2018-05-30 04:25:14
Hi Stefania
Sorry for the late reply. The proto model work is delayed and now I have some time to research this problem.
I am trapped by the first step. I do not know the position of the default PROTO interface. I can not find a way to create or convert my model into PROTO. file
thank for your reply~

Best regards,
Kun
Re: Can I build .proto file?by Stefania Pedrazzi (Webots PRO - 536) 2018-05-30 08:30:38
Hi Kun,

there is no default PROTO file that you have to copy.
Simply create a new file named <your_proto>.proto with the following content:
#VRML_SIM R2018a utf8
# You can add here the description of your model.

PROTO <your_proto> [
  # this is the interface containing the open fields visible in the scene tree
]
{
  # this is the body section: copy here your node definition
}

Then you can continue with step 2) and 3).

I strongly suggest you to read the PROTO nodes documentation to understand how PROTO nodes are built:
https://www.cyberbotics.com/doc/reference/proto

Best regards,
Stefania
Re: Can I build car.proto file?by Punitan Sivasamy (2) 2018-12-27 14:16:05
1. What u mean by ' copy your node definition from the Webots WBT file and paste it to the PROTO body section marked in the example above'. i have uploaded my vrml file which is a car. so i have all the nodes that yet to be transformed. where should i get the node definition from. u mean i have to use all the translation value under the scene tree ?

2. once i import my vrml file it's a car, there are so many parts to be transformed. how to reduce thm?

Thank you
Re: Can I build car.proto file?by Punitan Sivasamy (2) 2018-12-27 17:04:08
where can i find the node definition?

so many transform present once i import my vrml. how to reduce them?
Re: Can I build car.proto file?by David Mansolino (Webots PRO - 358) 2019-01-14 12:38:39
Dear Punitan,

We decided to close this forum, please ask your question directly here: https://stackoverflow.com/questions/tagged/webots

Sincerely,
David

Forum closed

This forum is closed, please ask technical questions about Webots on Stack Overflow or open a support ticket.

COMMUNITY CHAT (Discord) Discord