Converting .xacro to .hrdf

Questions about our ROS (Robot Operating System) API

Moderator: arrallan

Post Reply
cmu_fengxiang
Posts: 1
Joined: Tue Oct 05, 2021 2:22 am
Location: pittsburgh, pa

Converting .xacro to .hrdf

Post by cmu_fengxiang » Tue Oct 05, 2021 2:29 am

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.
User avatar
florian_enner
HEBI Official
Posts: 33
Joined: Wed Mar 25, 2020 11:31 am
Location: Austria

Re: Converting .xacro to .hrdf

Post by florian_enner » Tue Oct 05, 2021 5:30 am

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.
User avatar
matt_tesch
HEBI Official
Posts: 27
Joined: Mon Mar 30, 2020 9:14 am
Location: Pittsburgh, USA

Re: Converting .xacro to .hrdf

Post by matt_tesch » Wed Oct 06, 2021 10:20 am

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.
Post Reply