Hi Dave,
thanks for your detailed answer, exactly what I was hoping for.
After pondering the issue further, I have to agree that the only viable option is to (re!)model:
- everything that is part of an articulated object (robot arm and attachments[1]) as xacro
- all unarticulated objects as sdf
- the lab scene as sdf
I will then write two nodes (analogous to the gazebo2rviz ones):
- gazebo2planningscene: gazebo ROS topics -> continuous PlanningScene diffs
- sdf2planningscene: sdf -> PlanningScene diff or .scene file
Do you think I should rather generate a .scene or add collision object by collision object through the ROS api?
The whole situation is quite unsatisfactory because in the near future I need to create visually highly accurate models (perhaps with their own material shaders) for gazebo.
Gazebo allows to directly specify OGRE materials for such purposes, while urdf does not (and why should it).
I have to find some way to put everything into the xacro file, generate a valid urdf and a sdf with the additional information for gazebo (perhaps the <gazebo> tag will suffice).
However, one issue remains for which I cannot come up with a clean solution:
Finding out if (and which) URDF to load as robot, when it is part of a larger SDF. [2]
In other words: Distinguishing between unarticulated native SDF objects - to be added as collision objects - and articulated objects that are actually defined through URDF (actually by xacro) - not to be added because already part of their own move_group.
I hope the ROS future will bring better integration compared to the current state regarding modeling (all SDF?). But I guess for now there is no silver bullet and one has to fiddle around with different incompatible formats.
<sarcasm>Perhaps I should define my own XML-based super format from which both URDF and SDF can be generated ...</sarcasm>
Regards,
ahb
[1] The reason I tried to avoid going down that road are the many combinations of spacers, marker rings, cameras and optics in use. Therefore, I'll have to define many robots, although in reality, there are only a few robots with many attachments.
[2] For example, I have an SDF in which two robots (stemming then from different xacro->urdfs because of different attachments) are rigidly fixed to a table (using SDF "fixed" joints)