How to assemble a robot in the model editor
I am trying to build a ROV in gazebo but I am not sure how to assemble the parts(.dae files). The tutorials just enters the position in the SDF file. But, I don't know the positions of my parts. I know where they need to go but I don't know their position's xyz coordinates. Do I just eyeball it when I join parts of the ROV or is there a proper way to do it? I built the parts in catia and the way I join parts is by constraining them to each other. But how can I do it in gazebo when I join parts?
Asked by kalvik on 2017-03-14 22:20:16 UTC
Answers
I'm not sure which tutorial you're referring to. But I also didn't find any specific tutorial on importing COLLADA meshes on the model editor, so I'll risk being overly detailed and try to give you a general overview of the process.
Import all the meshes
I'm not sure if you're clear on how to import the COLLADA meshes, so before getting to your point, let's go through the process of importing a mesh:
- Enter the editor
- On the left panel, under "Custom Shapes", click "Add"
- Browse for the mesh file and click "Import"
- A new link will appear on the 3D view using your mesh as a visual and as a collision. Click anywhere to place it.
Now repeat this for all the parts on your model. By this point, you'll have all the parts all over the place and not properly connected.
Constraints inside the editor
One thing which might be confusing is that unlike some CAD editors, on the model editor, part placement is independent of constraint creation. On Gazebo, constraints are called "joints". But these joints only take effect while you're simulating, and not inside the editor. This means that even after you create joints between links, these links can be manipulated freely in the editor.
Assembling
Now we need to do two things: position the links and create joint constraints. Steps 7 to 14 on this tutorial explain how you could do both at the same time. I imagine this could be the tutorial you went through? The tools available in the Joint Creation Dialog allow you to align and precisely position the parts you're connecting.
If those tools are not enough for you, after creating the joint, you can always reposition the links using the translate, rotate, snap and align tools and visually inspect the model to check if things look like they're going where they should. You can always use the link inspector if you need to have finer control on the position coordinates. Even if you don't know those numbers beforehand, as you said, you can change them and visually inspect how that affects the model.
There is no way to create reference axes, planes and things like that on Gazebo yet, so for now you'd have to use these tools.
Finally, you asked about the "proper way to do it". My personal opinion is that if you have parts which have been carefully sized and want to place them very precisely, you should be able to come up with the exact coordinates for the links by hand, and type those into the editor.
Asked by chapulina on 2017-03-15 10:45:24 UTC
Comments
Thank you that helped a lot. I was following the tutorial you showed and I was hoping to avoid using the basic tools and was looking for a more cad like interface where I could constrain the joints. But I guess I will just use the basic tools and the link inspector.
Asked by kalvik on 2017-03-15 14:51:13 UTC
Comments