Description
Hi guys,
I am trying to understand Pinocchio's design choice when comes to parsing and saving XML files. My primary goal is to generate a URDF XML file/object from a Pinocchio model. For instance, I would like to do things like:
- Initializing Pybullet from Pinocchio saved URDF file
import pybullet as pb
import pinocchio
model = pinocchio.buildSampleModelHumanoid()
# Save a Urdf XML from model, e.g.,
# model.saveToUrdf("myurdf.urdf")
client = pb.connect(pb.DIRECT)
pb.loadURDF("myurdf.urdf")
- Setting a ros param from Pinocchio retrieved URDF object
import rospy
import pinocchio
rospy.init_node("my_urdf_param_node", anonymous=True)
model = pinocchio.buildSampleModelHumanoid()
# Get a URDF Xml from model, e.g.,
# urdfXml = model.saveToUrdf()
rospy.set_param("robot_description", urdfXml)
It is my understanding that these two things are not possible with Pinocchio, right? Please let me know if there is a workaround.
Additionally, when reviewing Pinocchio's signature I got confused with the definition of the XML format. It seems Pinocchio handles two types of XML formats, which I call Pinocchio XML and URDF XML. Supporting both might be OK, but the distinction between them is not clearly documented and the signature naming choices are not good enough IMO. For instance, these signatures handle Pinocchio XML:
model.saveToXML(filename, tag)
model.loadFromXML()
and this handles URDF XML
pinocchio.buildModelFromXML(myUrdfXml)
To address this, it seems to me that we should rename the latter function as buildModelFromUrdfXML
and specify in the former signatures that this is a Pinocchio XML format.
Many thanks for the support.