Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing and saving Pinocchio and URDF XMLs #2048

Open
cmastalli opened this issue Sep 1, 2023 · 0 comments
Open

Parsing and saving Pinocchio and URDF XMLs #2048

cmastalli opened this issue Sep 1, 2023 · 0 comments

Comments

@cmastalli
Copy link
Member

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:

  1. 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")
  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant