I'm attempting to build an OSIM <-> URDF/SDF (the Gazebo model format) converter to allow conversion of the inertial models between the two formats (ignoring the format specific pieces like muscles, etc).
Since Opensim and Gazebo share support for simbody I imagined that it would be possible to use that common piece to do most of the heavy lifting.
The proposed scheme is :
SDF -> OSIM
* Read an SDF file using Gazebo library code to construct the system all the way to Simbody objects
* Take those simbody objects, graft them into Opensim objects
* Use Opensim library code to write out the OSIM file
OSIM -> SDF
* Same thing but in reverse
If it works, the converter would be able to handle all formats past and future that the two underlying libraries support.
Does this scheme sound doable?
My worry is that the grafting process is too complex. Does anyone have insight into attachment points between Opensim and Simbody?
OSIM <-> URDF/SDF converter scheme tenable?
- andrew somerville
- Posts: 5
- Joined: Tue Sep 10, 2013 10:11 am
- Michael Sherman
- Posts: 814
- Joined: Fri Apr 01, 2005 6:05 pm
Re: OSIM <-> URDF/SDF converter scheme tenable?
Hi, Andrew.
I don't think it makes sense to try to convert sdf to osim via Simbody objects. They are too low-level. Instead, a conversion from the Gazebo model format to the OpenSim model format would be better. One issue you will need to address is the construction of a multibody spanning tree. For sdf files where the parent->child ordering already specifies a tree, it should be straightforward to map to the .osim tree structure. You could consider limiting the conversion to those cases since they are very common and I would certainly do that initially. If you get that far and want some help converting non-tree-structured models into trees, post again.
The osim->sdf direction could be very difficult because of the limited set of joint types supported by sdf. Many osim models use joints with custom kinematics because biological joints are not typically pure revolute or prismatic. Do you have ideas for how to perform that mapping?
Regards,
Sherm
I don't think it makes sense to try to convert sdf to osim via Simbody objects. They are too low-level. Instead, a conversion from the Gazebo model format to the OpenSim model format would be better. One issue you will need to address is the construction of a multibody spanning tree. For sdf files where the parent->child ordering already specifies a tree, it should be straightforward to map to the .osim tree structure. You could consider limiting the conversion to those cases since they are very common and I would certainly do that initially. If you get that far and want some help converting non-tree-structured models into trees, post again.
The osim->sdf direction could be very difficult because of the limited set of joint types supported by sdf. Many osim models use joints with custom kinematics because biological joints are not typically pure revolute or prismatic. Do you have ideas for how to perform that mapping?
Regards,
Sherm
- andrew somerville
- Posts: 5
- Joined: Tue Sep 10, 2013 10:11 am
Re: OSIM <-> URDF/SDF converter scheme tenable?
I'm thinking it might be the case that this is a larger challenge than planned for.
The hope was that the shared underlying simbody representation would offer the ability to convert between the formats essentially "for free".
I'm starting to realize that the simbody representations are incomplete without the respective gazebo and opensim layers, and married in a difficult way to tease apart.
I suspect that to do it correctly, we'd need to include a prismatic just after each custom joint and provide a controller which was responsible for coordinating the more complex behaviors. I believe this is how it's done for the pr2_mechanism_model which has the concept of transmissions and actuators to handle non simple joint types.
http://wiki.ros.org/ros_control#Transmi ... RDF_Format
http://wiki.ros.org/urdf/XML/Transmission
http://wiki.ros.org/pr2_mechanism_model
The hope was that the shared underlying simbody representation would offer the ability to convert between the formats essentially "for free".
I'm starting to realize that the simbody representations are incomplete without the respective gazebo and opensim layers, and married in a difficult way to tease apart.
I agree the mapping would be problematic. To be honest I didn't realize how complex the joint representations were in OSIM. I intended to punt by only converting rotational elements.The osim->sdf direction could be very difficult because of the limited set of joint types supported by sdf. Many osim models use joints with custom kinematics because biological joints are not typically pure revolute or prismatic. Do you have ideas for how to perform that mapping?
I suspect that to do it correctly, we'd need to include a prismatic just after each custom joint and provide a controller which was responsible for coordinating the more complex behaviors. I believe this is how it's done for the pr2_mechanism_model which has the concept of transmissions and actuators to handle non simple joint types.
http://wiki.ros.org/ros_control#Transmi ... RDF_Format
http://wiki.ros.org/urdf/XML/Transmission
http://wiki.ros.org/pr2_mechanism_model
- ehtishamul hasan
- Posts: 1
- Joined: Sat Sep 19, 2020 12:25 am
Re: OSIM <-> URDF/SDF converter scheme tenable?
Hi,sherm wrote: ↑Mon Apr 14, 2014 10:34 amHi, Andrew.
I don't think it makes sense to try to convert sdf to osim via Simbody objects. They are too low-level. Instead, a conversion from the Gazebo model format to the OpenSim model format would be better. One issue you will need to address is the construction of a multibody spanning tree. For sdf files where the parent->child ordering already specifies a tree, it should be straightforward to map to the .osim tree structure. You could consider limiting the conversion to those cases since they are very common and I would certainly do that initially. If you get that far and want some help converting non-tree-structured models into trees, post again.
The osim->sdf direction could be very difficult because of the limited set of joint types supported by sdf. Many osim models use joints with custom kinematics because biological joints are not typically pure revolute or prismatic. Do you have ideas for how to perform that mapping?
Regards,
Sherm
I am trying to use the opensim full body model for human robot collaboration. I want to know if there is any documentation where the human model in OpeSim can be brought to Gazebo simulation environment so that my robot can interact through a collaboration task with the human model. Is it possible ? I am unable to find specific documentation on this please.
- Ayman Habib
- Posts: 2255
- Joined: Fri Apr 01, 2005 12:24 pm
Re: OSIM <-> URDF/SDF converter scheme tenable?
Hello,
The functionality referred to in this thread (to have Gazebo models and OpenSim models interact) was not implemented in OpenSim to my knowledge. Typically the issues with getting models from multiple simulation environments to work together is that the abstractions are different and are baked in (for example Gazebo may not have muscles which are central to OpenSim functionality, while OpenSim doesn't support some types of constraints or controllers that Gazebo implements).
The likely shortest path to get these working together is to import a model from one system to the other and reimplement or map the missing functionality. Best case scenario for the OpenSim community would be to do it generically and provide a converter/importer so other users can benefit, just keep in mind that it's a rather significant task.
Hope this helps,
-Ayman
The functionality referred to in this thread (to have Gazebo models and OpenSim models interact) was not implemented in OpenSim to my knowledge. Typically the issues with getting models from multiple simulation environments to work together is that the abstractions are different and are baked in (for example Gazebo may not have muscles which are central to OpenSim functionality, while OpenSim doesn't support some types of constraints or controllers that Gazebo implements).
The likely shortest path to get these working together is to import a model from one system to the other and reimplement or map the missing functionality. Best case scenario for the OpenSim community would be to do it generically and provide a converter/importer so other users can benefit, just keep in mind that it's a rather significant task.
Hope this helps,
-Ayman