Page 1 of 1

Converting .xacro to .hrdf

Posted: Tue Oct 05, 2021 2:29 am
by cmu_fengxiang
Hello,

I'm working on a project that involves controlling a 4 degree-of-freedom manipulator arm powered by HEBI X-series actuators. So far, I've created a xacro file for my robot model and used "rosrun xacro xacro robot.xacro > robot.urdf" to create a URDF robot model but I would love to convert my .xacro file into an HRDF model and play around with the forward and inverse kinemetics of HEBI's C++ ROS API. How can I convert my xacro robot model file into an HRDF robot model file?

I am looking through the hebi_description/scripts folder (https://github.com/HebiRobotics/hebi_de ... er/scripts) but I cannot file any program that would take in a xacro file as input and convert to an HRDF format. Perhaps I'm mistaken though and would appreciate some guidance on this matter.

Re: Converting .xacro to .hrdf

Posted: Tue Oct 05, 2021 5:30 am
by florian_enner
Hi! Going from hrdf to urdf is unfortunately a lossy conversion, so it only works one way. The easiest ways to create an appropriate hrdf file is to do one of the following:

1) visually build the configuration at https://robotbuilder.hebi.us/ and click "export" in the bottom right corner

2) adapt existing hrdf files from https://github.com/HebiRobotics/hebi-hrdf or the examples. You can find the full syntax at https://docs.hebi.us/tools.html#robot-d ... ion-format.

Once you have an hrdf file, you can use the "hrdf viewer" in Scope (monitoring tab) to confirm that everything is working correctly.

Re: Converting .xacro to .hrdf

Posted: Wed Oct 06, 2021 10:20 am
by matt_tesch
Although there is not a tool for the conversion, if you are using the HEBI xacro macros, the conversion to hrdf should be straightforward in most cases. The HEBI xacro elements are designed to closely align with the corresponding hrdf elements.

If you have a specific file, feel free to list it here and we can provide the corresponding HRDF.

As Florian said, going from URDF to HRDF in general isn't possible, because you lose some of the information about the actuators when converting to URDF.